Angles and trigonometry
Angle is a dimension. sin, cos, and tan take an angle, so a number
needs its unit: 30 deg or 0.5 rad. The inverse functions return an angle.
sin(30 deg)
sin(0.5 rad)
cos(60 deg)
atan(1) to deg
6 m * sin(30 deg)
0.5 deg to dms
dms shows degrees, minutes, and seconds.
Built-in functions
Section titled “Built-in functions”| Function | Notes |
|---|---|
sqrt, cube root, nth root(x, n) | sqrt carries units: sqrt(9 m^2) is 3 m |
abs, min, max, clamp(x, lo, hi) | keep their unit |
floor, ceil, round | plain numbers |
ln, exp, log, log10, log2 | log is base 10 |
gcd, lcm, modulo | whole numbers |
sin, cos, tan, asin, acos, atan | angles |
Constants: pi, tau, e, golden ratio, speed of light,
standard gravity. More constants are one import away; see
Imports.