Skip to content

Commit 5da8e22

Browse files
committed
Decomposed the rounded expressions in the unit definitions into operations with exact coefficients (breaking)
1 parent f7b4edb commit 5da8e22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+486
-300
lines changed

Common/UnitDefinitions/HeatFlux.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
{
2828
"SingularName": "WattPerSquareInch",
2929
"PluralName": "WattsPerSquareInch",
30-
"FromUnitToBaseFunc": "{x} * 1.5500031e3",
31-
"FromBaseToUnitFunc": "{x} / 1.5500031e3",
30+
"FromUnitToBaseFunc": "{x} / (2.54e-2 * 2.54e-2)",
31+
"FromBaseToUnitFunc": "{x} * (2.54e-2 * 2.54e-2)",
3232
"Localization": [
3333
{
3434
"Culture": "en-US",
@@ -39,8 +39,8 @@
3939
{
4040
"SingularName": "WattPerSquareFoot",
4141
"PluralName": "WattsPerSquareFoot",
42-
"FromUnitToBaseFunc": "{x} * 1.07639e1",
43-
"FromBaseToUnitFunc": "{x} / 1.07639e1",
42+
"FromUnitToBaseFunc": "{x} / (0.3048 * 0.3048)",
43+
"FromBaseToUnitFunc": "{x} * (0.3048 * 0.3048)",
4444
"Localization": [
4545
{
4646
"Culture": "en-US",
@@ -51,8 +51,8 @@
5151
{
5252
"SingularName": "BtuPerSecondSquareInch",
5353
"PluralName": "BtusPerSecondSquareInch",
54-
"FromUnitToBaseFunc": "{x} * 1.63533984e6",
55-
"FromBaseToUnitFunc": "{x} / 1.63533984e6",
54+
"FromUnitToBaseFunc": "{x} * 1055.05585262 / (2.54e-2 * 2.54e-2)",
55+
"FromBaseToUnitFunc": "{x} * (2.54e-2 * 2.54e-2) / 1055.05585262",
5656
"Localization": [
5757
{
5858
"Culture": "en-US",
@@ -63,8 +63,8 @@
6363
{
6464
"SingularName": "BtuPerSecondSquareFoot",
6565
"PluralName": "BtusPerSecondSquareFoot",
66-
"FromUnitToBaseFunc": "{x} * 1.13565267e4",
67-
"FromBaseToUnitFunc": "{x} / 1.13565267e4",
66+
"FromUnitToBaseFunc": "{x} * 1055.05585262 / (0.3048 * 0.3048)",
67+
"FromBaseToUnitFunc": "{x} * (0.3048 * 0.3048) / 1055.05585262",
6868
"Localization": [
6969
{
7070
"Culture": "en-US",
@@ -75,8 +75,8 @@
7575
{
7676
"SingularName": "BtuPerMinuteSquareFoot",
7777
"PluralName": "BtusPerMinuteSquareFoot",
78-
"FromUnitToBaseFunc": "{x} * 1.89275445e2",
79-
"FromBaseToUnitFunc": "{x} / 1.89275445e2",
78+
"FromUnitToBaseFunc": "{x} * 1055.05585262 / (0.3048 * 0.3048 * 60)",
79+
"FromBaseToUnitFunc": "{x} * (0.3048 * 0.3048 * 60) / 1055.05585262",
8080
"Localization": [
8181
{
8282
"Culture": "en-US",
@@ -87,8 +87,8 @@
8787
{
8888
"SingularName": "BtuPerHourSquareFoot",
8989
"PluralName": "BtusPerHourSquareFoot",
90-
"FromUnitToBaseFunc": "{x} * 3.15459075",
91-
"FromBaseToUnitFunc": "{x} / 3.15459075",
90+
"FromUnitToBaseFunc": "{x} * 1055.05585262 / (0.3048 * 0.3048 * 3600)",
91+
"FromBaseToUnitFunc": "{x} * (0.3048 * 0.3048 * 3600) / 1055.05585262",
9292
"Localization": [
9393
{
9494
"Culture": "en-US",
@@ -99,8 +99,8 @@
9999
{
100100
"SingularName": "CaloriePerSecondSquareCentimeter",
101101
"PluralName": "CaloriesPerSecondSquareCentimeter",
102-
"FromUnitToBaseFunc": "{x} * 4.1868e4",
103-
"FromBaseToUnitFunc": "{x} / 4.1868e4",
102+
"FromUnitToBaseFunc": "{x} * 4.184e4",
103+
"FromBaseToUnitFunc": "{x} / 4.184e4",
104104
"Prefixes": [ "Kilo" ],
105105
"Localization": [
106106
{
@@ -112,8 +112,8 @@
112112
{
113113
"SingularName": "KilocaloriePerHourSquareMeter",
114114
"PluralName": "KilocaloriesPerHourSquareMeter",
115-
"FromUnitToBaseFunc": "{x} * 1.163",
116-
"FromBaseToUnitFunc": "{x} / 1.163",
115+
"FromUnitToBaseFunc": "{x} * 4.184e3 / 3600",
116+
"FromBaseToUnitFunc": "{x} * 3600 / 4.184e3",
117117
"Localization": [
118118
{
119119
"Culture": "en-US",
@@ -124,8 +124,8 @@
124124
{
125125
"SingularName": "PoundForcePerFootSecond",
126126
"PluralName": "PoundsForcePerFootSecond",
127-
"FromUnitToBaseFunc": "{x} * 1.459390293720636e1",
128-
"FromBaseToUnitFunc": "{x} / 1.459390293720636e1",
127+
"FromUnitToBaseFunc": "{x} * 1.3558179483314004 / 9.290304e-2",
128+
"FromBaseToUnitFunc": "{x} * 9.290304e-2 / 1.3558179483314004",
129129
"Localization": [
130130
{
131131
"Culture": "en-US",

Common/UnitDefinitions/HeatTransferCoefficient.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
{
4646
"SingularName": "BtuPerHourSquareFootDegreeFahrenheit",
4747
"PluralName": "BtusPerHourSquareFootDegreeFahrenheit",
48-
"FromUnitToBaseFunc": "{x} * 5.6782633411134878",
49-
"FromBaseToUnitFunc": "{x} / 5.6782633411134878",
48+
"FromUnitToBaseFunc": "{x} * ((1055.05585262 / (0.3048 * 0.3048 * 3600)) * 1.8)",
49+
"FromBaseToUnitFunc": "{x} / ((1055.05585262 / (0.3048 * 0.3048 * 3600)) * 1.8)",
5050
"Localization": [
5151
{
5252
"Culture": "en-US",
@@ -58,8 +58,8 @@
5858
"SingularName": "CaloriePerHourSquareMeterDegreeCelsius",
5959
"PluralName": "CaloriesPerHourSquareMeterDegreeCelsius",
6060
"Prefixes": [ "Kilo" ],
61-
"FromUnitToBaseFunc": "({x} * 4.1868) / 3600",
62-
"FromBaseToUnitFunc": "({x} / 4.1868) * 3600",
61+
"FromUnitToBaseFunc": "({x} * 4.184) / 3600",
62+
"FromBaseToUnitFunc": "({x} / 4.184) * 3600",
6363
"Localization": [
6464
{
6565
"Culture": "en-US",

Common/UnitDefinitions/Impulse.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"M": "Pound",
5252
"T": "Second"
5353
},
54-
"FromUnitToBaseFunc": "{x} / 7.230657989877",
55-
"FromBaseToUnitFunc": "{x} * 7.230657989877",
54+
"FromUnitToBaseFunc": "{x} * (0.45359237 * 0.3048)",
55+
"FromBaseToUnitFunc": "{x} / (0.45359237 * 0.3048)",
5656
"Localization": [
5757
{
5858
"Culture": "en-US",
@@ -63,8 +63,8 @@
6363
{
6464
"SingularName": "PoundForceSecond",
6565
"PluralName": "PoundForceSeconds",
66-
"FromUnitToBaseFunc": "{x} / 0.2248089430997",
67-
"FromBaseToUnitFunc": "{x} * 0.2248089430997",
66+
"FromUnitToBaseFunc": "{x} * 0.45359237 * 9.80665",
67+
"FromBaseToUnitFunc": "{x} / 4.4482216152605",
6868
"Localization": [
6969
{
7070
"Culture": "en-US",
@@ -80,8 +80,8 @@
8080
"M": "Slug",
8181
"T": "Second"
8282
},
83-
"FromUnitToBaseFunc": "{x} / 0.224735720691",
84-
"FromBaseToUnitFunc": "{x} * 0.224735720691",
83+
"FromUnitToBaseFunc": "{x} * (0.45359237 * 9.80665)",
84+
"FromBaseToUnitFunc": "{x} / (0.45359237 * 9.80665)",
8585
"Localization": [
8686
{
8787
"Culture": "en-US",

Common/UnitDefinitions/Luminosity.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
{
3131
"SingularName": "SolarLuminosity",
3232
"PluralName": "SolarLuminosities",
33-
"FromUnitToBaseFunc": "{x} * 3.846e26",
34-
"FromBaseToUnitFunc": "{x} / 3.846e26",
35-
"XmlDocRemarks": "https://www.britannica.com/science/luminosity",
33+
"XmlDocSummary": "The IAU has defined a nominal solar luminosity of 3.828×10^26 W to promote publication of consistent and comparable values in units of the solar luminosity.",
34+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Luminosity#Measurement",
35+
"FromUnitToBaseFunc": "{x} * 3.828e26",
36+
"FromBaseToUnitFunc": "{x} / 3.828e26",
3637
"Localization": [
3738
{
3839
"Culture": "en-US",

Common/UnitDefinitions/Power.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
{
3030
"SingularName": "MechanicalHorsepower",
3131
"PluralName": "MechanicalHorsepower",
32-
"FromUnitToBaseFunc": "{x} * 745.69",
33-
"FromBaseToUnitFunc": "{x} / 745.69",
32+
"XmlDocSummary": "Assuming the third CGPM (1901, CR 70) definition of standard gravity, gn = 9.80665 m/s2, is used to define the pound-force as well as the kilogram force, and the international avoirdupois pound (1959), one imperial horsepower is: 76.0402249 × 9.80665 kg⋅m2/s3",
33+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Horsepower#Imperial_horsepower",
34+
"FromUnitToBaseFunc": "{x} * 76.0402249 * 9.80665",
35+
"FromBaseToUnitFunc": "{x} / (76.0402249 * 9.80665)",
3436
"Localization": [
3537
{
3638
"Culture": "en-US",
@@ -41,6 +43,8 @@
4143
{
4244
"SingularName": "MetricHorsepower",
4345
"PluralName": "MetricHorsepower",
46+
"XmlDocSummary": "DIN 66036 defines one metric horsepower as the power to raise a mass of 75 kilograms against the Earth's gravitational force over a distance of one metre in one second:[18] 75 kg × 9.80665 m/s2 × 1 m / 1 s = 75 kgf⋅m/s = 1 PS. This is equivalent to 735.49875 W, or 98.6% of an imperial horsepower.",
47+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Horsepower#Metric_horsepower_(PS,_KM,_cv,_hk,_pk,_k,_ks,_ch)",
4448
"FromUnitToBaseFunc": "{x} * 735.49875",
4549
"FromBaseToUnitFunc": "{x} / 735.49875",
4650
"Localization": [
@@ -53,6 +57,8 @@
5357
{
5458
"SingularName": "ElectricalHorsepower",
5559
"PluralName": "ElectricalHorsepower",
60+
"XmlDocSummary": "Nameplates on electrical motors show their power output, not the power input (the power delivered at the shaft, not the power consumed to drive the motor). This power output is ordinarily stated in watts or kilowatts. In the United States, the power output is stated in horsepower, which for this purpose is defined as exactly 746 W.",
61+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Horsepower#Electrical_horsepower",
5662
"FromUnitToBaseFunc": "{x} * 746",
5763
"FromBaseToUnitFunc": "{x} / 746",
5864
"Localization": [
@@ -65,6 +71,8 @@
6571
{
6672
"SingularName": "BoilerHorsepower",
6773
"PluralName": "BoilerHorsepower",
74+
"XmlDocSummary": "Boiler horsepower is a boiler's capacity to deliver steam to a steam engine and is not the same unit of power as the 550 ft lb/s definition. One boiler horsepower is equal to the thermal energy rate required to evaporate 34.5 pounds (15.6 kg) of fresh water at 212 °F (100 °C) in one hour.",
75+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Horsepower#Boiler_horsepower",
6876
"FromUnitToBaseFunc": "{x} * 9812.5",
6977
"FromBaseToUnitFunc": "{x} / 9812.5",
7078
"Localization": [
@@ -77,6 +85,8 @@
7785
{
7886
"SingularName": "HydraulicHorsepower",
7987
"PluralName": "HydraulicHorsepower",
88+
"XmlDocSummary": "Hydraulic horsepower can represent the power available within hydraulic machinery, power through the down-hole nozzle of a drilling rig, or can be used to estimate the mechanical power needed to generate a known hydraulic flow rate.",
89+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Horsepower#Hydraulic_horsepower",
8090
"FromUnitToBaseFunc": "{x} * 745.69988145",
8191
"FromBaseToUnitFunc": "{x} / 745.69988145",
8292
"Localization": [
@@ -89,8 +99,8 @@
8999
{
90100
"SingularName": "BritishThermalUnitPerHour",
91101
"PluralName": "BritishThermalUnitsPerHour",
92-
"FromUnitToBaseFunc": "{x} * 0.29307107017",
93-
"FromBaseToUnitFunc": "{x} / 0.29307107017",
102+
"FromUnitToBaseFunc": "{x} * 1055.05585262 / 3600",
103+
"FromBaseToUnitFunc": "{x} * 3600 / 1055.05585262",
94104
"Prefixes": [ "Kilo", "Mega" ],
95105
"Localization": [
96106
{

0 commit comments

Comments
 (0)