iconEuler Reference

Units

Units in Euler and conversion routines.

Units are defined with an ending $, so that they become accessible globally. Euler can convert units with the -> syntax.

The following units are known to Euler. You can define own units easily in the same manner.

kilometer$:=1000;
km$:=kilometer$;
cm$:=0.01;
minute$:=60;
min$:=minute$;
minutes$:=minute$;
hour$:=60*minute$;
h$:=hour$;
hours$:=hour$;
day$:=24*hour$;
days$:=day$;
d$:=day$;
year$:=365.2425*day$;
years$:=year$;
y$:=year$;
inch$:=0.0254;
in$:=inch$;
feet$:=12*inch$;
foot$:=feet$;
ft$:=feet$;
yard$:=3*feet$;
yards$:=yard$;
yd$:=yard$;
mile$:=1760*yard$;
miles$:=mile$;
kg$:=1;
m$:=1;
sec$:=1;
s$:=1;
ha$:=10000;
Ar$:=100;
Tagwerk$:=3408;
Acre$:=4046.8564224;
Euro$:=1.95593;
gammaEuler$:=0.577215664901532860606512090082402431042;
gamma$:=gammaEuler$;
c$:=299792458;
cLight$:=299792458;
lightyear$:=365.25*days$*c$;
ly$:=lightyear$;
astrounit$:=149597870691;
AU$:=astrounit$;
parsec$:=3.085677581281553e16;
hquantum$:=6.62606876e-34;
mol$:=6.02214199e23;
KelvinMol$:=8.314472/mol$;
Rgas$:=8.314472;
R$:=8.314472;
Celsius0$:=273.15;
elemcharge$:=1.602176462e-19;
electronmass$:=0.910938188e-30;
protonmass$:=1.67262158e-27;
neutronmass$:=1.6749286e-27;
mumass$:=1.660538782e-27;
molair$:=28.9644;
gravconstant$:=6.67390e-11;
calory$:=4.1868;
cal$:=calory$;
calories$:=cal$;
kJ$:=1000;
kW$:=1000;
PS$:=0.73549875*1000;
kcal$:=1000*cal$;
gearth$:=9.80665;
g$:=gearth$;
Torr$:=101325/760;
molair$:=28.9644;
function atmosphere (h=0, p0=1013.25, T0=288.15, geo=0, temp=0)

  Normed atmosphere h<11 km
  
  This function assumes a constant Temp-Gradient dT:=6.5 K/km.
  
  h [in m]: potential height above sea level
  geo<>0 : geometrical height
  p0 [in hPa], T0 [in K] := pressure, temp. at h=0
  
  Returns the pressure p, and with temp<>0 additionally the
  temperature as {p, T}
function FahrenheitToCelsius (x)

  Convert Fahrenheit to Celsius with (x-32)*5/9
function CelsiusToFahrenheit (x)

  Convert Celsius to Fahrenheit with x*9/5+32
function KelvinToCelsius (x)

  Convert Kelvin to Celsius with x-273.15
function CelsiusToKelvin (x)

  Convert Kelvin to Celsius with x+273.15
function rearth (lat:number, r1=6378137, r2=6356752)

  WSG84 radius of earth at that latitude
rEarth$:=rearth(45°);

Documentation Homepage