Skip to content

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.

FunctionNotes
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, roundplain numbers
ln, exp, log, log10, log2log is base 10
gcd, lcm, modulowhole numbers
sin, cos, tan, asin, acos, atanangles

Constants: pi, tau, e, golden ratio, speed of light, standard gravity. More constants are one import away; see Imports.