MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / dimensionsEqual

Function dimensionsEqual

src/compute-engine/numerics/unit-data.ts:207–220  ·  view source on GitHub ↗
(
  a: DimensionVector,
  b: DimensionVector
)

Source from the content-addressed store, hash-verified

205 'ft': { dimension: [1, 0, 0, 0, 0, 0, 0, 0], scale: 0.3048 },
206 'yd': { dimension: [1, 0, 0, 0, 0, 0, 0, 0], scale: 0.9144 },
207 'mi': { dimension: [1, 0, 0, 0, 0, 0, 0, 0], scale: 1609.344 },
208 'lb': { dimension: [0, 1, 0, 0, 0, 0, 0, 0], scale: 0.45359237 },
209 'oz': { dimension: [0, 1, 0, 0, 0, 0, 0, 0], scale: 0.028349523125 },
210 'gal': { dimension: [3, 0, 0, 0, 0, 0, 0, 0], scale: 3.785411784e-3 },
211 // Volume: US liquid convention (matching gal = 3.785411784e-3). Imperial
212 // qt/pt differ by ~20%; gal already established the US convention here.
213 'qt': { dimension: [3, 0, 0, 0, 0, 0, 0, 0], scale: 9.46352946e-4 },
214 'pt': { dimension: [3, 0, 0, 0, 0, 0, 0, 0], scale: 4.73176473e-4 },
215 'cup': { dimension: [3, 0, 0, 0, 0, 0, 0, 0], scale: 2.365882365e-4 },
216 'atm': { dimension: [-1, 1, -2, 0, 0, 0, 0, 0], scale: 101325 },
217 'bar': { dimension: [-1, 1, -2, 0, 0, 0, 0, 0], scale: 1e5 },
218 'cal': { dimension: [2, 1, -2, 0, 0, 0, 0, 0], scale: 4.184 },
219 'kWh': { dimension: [2, 1, -2, 0, 0, 0, 0, 0], scale: 3.6e6 },
220 '\u00C5': { dimension: [1, 0, 0, 0, 0, 0, 0, 0], scale: 1e-10 }, // Å
221
222 // ---- Currency (8th dimension) ----
223 // Only USD is represented. EUR/GBP/etc. have no fixed exchange rate to USD,

Callers 7

units.test.tsFile · 0.90
quantityCompareFunction · 0.90
units.tsFile · 0.90
quantityDivideFunction · 0.90
areCompatibleUnitsFunction · 0.85
convertUnitFunction · 0.85
convertCompoundUnitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected