Math

math functions

This page lists scalar math functions. Inputs are converted to real; outputs are real.

  • sin(x) — sine of x radians.
  • cos(x) — cosine of x radians.
  • tan(x) — tangent of x radians.
  • asin(x) / asin2(x) — arcsine of x (radians).
  • acos(x) / acos2(x) — arccosine of x (radians).
  • atan(x) — arctangent of x (radians).
  • atan2(y, x) — arctangent using signs of y and x (radians).
  • pow(base, exponent) — base raised to exponent.
  • pi() — constant π.
  • radians(degrees) — converts degrees to radians.
  • degrees(radians) — converts radians to degrees.

Examples

Basic trig:

datatable(angle:real)[0, 1.5707963267948966]
| extend s = sin(angle), c = cos(angle), t = tan(angle)
anglesct
0010
1.5707963267948966101.633123935319537e+16

Inverse trig:

datatable(v:real)[-1, 0, 1]
| extend a_sin = asin(v), a_cos = acos(v), a_tan = atan(v)
va_sina_cosa_tan
-1-1.57079632679489663.141592653589793-0.7853981633974483
001.57079632679489660
11.570796326794896600.7853981633974483

Powers and constants:

print eight = pow(2, 3), pi_val = pi()
eightpi_val
83.141592653589793

Degree/radian conversion:

datatable(deg:real)[0, 180]
| extend rad = radians(deg), back = degrees(rad)
degradback
000
1803.141592653589793180