Variables
Const acceleration
acceleration
: Unit < {} > = defineUnit({length: 1, time: -2},{varName: 'a'},'acceleration')
Const amount
amount
: Unit < {} > = cu(P.amount)
Const angle
angle
: Unit < {} > = cu(P.angle)
Const angstrom
angstrom
: Unit < {} > & Alias = defineAlias('angstrom', 'Å', {},Units.length, 0.0000000001, 0,'ångstrom')
Const angularVelocity
angular
Velocity: Unit < {} > = defineUnit({angle: 1, time: -1},{varName: 'ω'},'angularVelocity')
Const area
area
: Unit < {} > = defineUnit({length: 2},{varName: 'a'},'area')
Const candela
candela
: Unit < {} > = cu(P.candela)
Const capacitance
capacitance
: Unit < {} > = defineUnit({length: -2, mass: -1, time: 4, current: 2},{name: 'farad', symbol: 'F'},'capacitance')
Const celsius
celsius
: Unit < {} > & Alias = defineAlias('celsius', '°C', {},Units.temperature, 273.15)
Const charge
charge
: Unit < {} > = defineUnit({current: 1, time: 1},{name: 'coulomb', symbol: 'C'},'charge')
Const conductance
conductance
: Unit < {} > = defineUnit({length: -2, mass: -1, time: 3, current: 1},{name: 'siemen', symbol: 'S'},'conductance')
Const current
current
: Unit < {} > = cu(P.current)
Const cycles
cycles
: Unit < {} > = cu(P.cycles)
Const day
day
: Unit < {} > & Alias = defineAlias('day', 'd', {},Units.time, 3600 * 24)
Const degreeArc
degree
Arc: Unit < {} > & Alias = defineAlias('degreeArc', '°', {},Units.angle, Math.PI / 180)
Const density
density
: Unit < {} > = defineUnit({mass: 1, length: -3},{},'density')
Const energy
energy
: Unit < {} > = defineUnit({mass: 1, length: 2, time: -2},{symbol: 'J', varName: 'E', name: 'joule'},'energy')
Const flux
flux
: Unit < {} > = defineUnit({length: 2, mass: 1, time: -2, current: -1},{name: 'weber', symbol: 'Wb'},'flux')
Const fluxDensity
flux
Density: Unit < {} > = defineUnit({mass: 1, time: -2, current: -1},{name: 'tesla', symbol: 'T'},'fluxDensity')
Const foot
foot
: Unit < {} > & Alias = defineAlias('foot', 'ft', {},Units.length, 0.3048)
Const force
force
: Unit < {} > = defineUnit({mass: 1, length: 1, time: -2},{name: 'newton', symbol: 'N', varName: 'F'},'force')
Const frequency
frequency
: Unit < {} > = defineUnit({cycles: 1, time: -1},{name: 'hertz', symbol: 'Hz', varName: 'f'},'frequency')
Const gram
gram
: Unit < {} > & Alias = defineAlias('gram', 'g', {},Units.mass, 0.001)
Const hectare
hectare
: Unit < {} > & Alias = defineAlias('hectare', `ha`, {},Units.area, 10000)
Const hour
hour
: Unit < {} > & Alias = defineAlias('hour', 'h', {},Units.time, 3600, 0,'hr')
Const inch
inch
: Unit < {} > & Alias = defineAlias('inch', 'in', {},Units.length, 0.0254)
Const inductance
inductance
: Unit < {} > = defineUnit({length: 2, mass: 1, time: -2, current: -2},{name: 'henry', symbol: 'H'},'inductance')
Const length
length
: Unit < {} > = cu(P.length)
Const liter
liter
: Unit < {} > & Alias = defineAlias('liter', 'L', {},volume, 0.001, 0,'litre')
Const mass
mass
: Unit < {} > = cu(P.mass)
Const mile
mile
: Unit < {} > & Alias = defineAlias('mile', 'mi', {},Units.length, 1609.344)
Const minute
minute
: Unit < {} > & Alias = defineAlias('minute', 'min', {},Units.time, 60)
Const minuteArc
minute
Arc: Unit < {} > & Alias = defineAlias('minuteArc', `'`, {},Units.angle, Math.PI / (180 * 60))
Const momentum
momentum
: Unit < {} > = defineUnit({mass: 1, length: 1, time: -1},{varName: 'p'},'momentum', 'impulse')
Const power
power
: Unit < {} > = defineUnit({mass: 1, length: 2, time: -3},{name: 'watt', symbol: 'W'},'power')
Const resistance
resistance
: Unit < {} > = defineUnit({length: 2, mass: 1, time: -3, current: -1},{name: 'ohm', symbol: 'Ω', varName: 'R'},'resistance')
Const secondArc
second
Arc: Unit < {} > & Alias = defineAlias('secondArc', `"`, {},Units.angle, Math.PI / (180 * 3600))
Const solidAngle
solid
Angle: Unit < {} > = cu(P.solidAngle)
Const temperature
temperature
: Unit < {} > = cu(P.temperature)
Const time
time
: Unit < {} > = cu(P.time)
Const tonne
tonne
: Unit < {} > & Alias = defineAlias('tonne', 'Ton', {},Units.mass, 1000)
Const torque
torque
: Unit < {} > = defineUnit({mass: 1, length: 2, time: -2},{},'torque')
Const unity
unity
: Unit < {} > = defineUnit({},{name: '1', symbol: '', si_base: true},'unity')
Const velocity
velocity
: Unit < {} > = defineUnit({length: 1, time: -1},{varName: 'V'},'velocity')
Const voltage
voltage
: Unit < {} > = defineUnit({length: 2, mass: 1, time: -3, current: -1},{name: 'volt', symbol: 'V', varName: 'V'},'voltage', 'EMF')
Const volume
volume
: Unit < {} > = defineUnit({length: 3},{varName: 'V'},'volume')
Const wavelength
wavelength
: Unit < {} > = defineUnit({length: 1, cycles: -1},{},'wavelength')
Const week
week
: Unit < {} > & Alias = defineAlias('week', 'wk', {},Units.time, 3600 * 24 * 7)
Const yard
yard
: Unit < {} > & Alias = defineAlias('yard', 'yd', {},Units.length, 0.9144)
Functions
Const cu
Type parameters
Parameters
Returns Unit < {} >
Legend
Namespace
Object literal
Variable
Function
Function with type parameter
Type alias
Type alias with type parameter
Interface
Interface with type parameter
Class
Class with type parameter
Collect common unit constants under a U namespace. Using a namespace allows precise typescript typing, while keeping the namespace distinct from the start. Otherwise, import * from './unit-defs' would be dangerous as types are added.
This is a better alternative to prefixing all the names with U_.