Skip to main content
These functions take an angle and return a ratio, or take a ratio and return an angle. Each accepts a number or a table, returning the same shape.

Angle units

A bare number is interpreted as degrees. Attach an angle unit to be explicit:
  • value — degrees (the default)
  • value deg — degrees
  • value rad — radians
The inverse functions return their result in degrees. To read one in radians, cast the result — (asin(0.5))rad. A unit on the argument of an inverse function is an error, since the argument is a dimensionless ratio.

Sine, cosine, and tangent [sin, cos, tan]

The sine, cosine, and tangent of an angle. Angles use the shared angle units — degrees unless you append rad.

Secant, cosecant, and cotangent [sec, csc, cot]

The secant, cosecant, and cotangent of an angle — the reciprocals of cosine, sine, and tangent. Angles use the shared angle units — degrees unless you append rad.

Inverse functions [asin, acos, atan]

The arc-sine, arc-cosine, and arc-tangent. asin and acos take a dimensionless ratio between -1 and 1; atan takes any dimensionless ratio. All three return an angle in degrees. Angles use the shared angle units — degrees unless you append rad.

Hyperbolic functions [sinh, cosh, tanh, asinh, acosh, atanh]

The hyperbolic sine, cosine, and tangent, and their inverses. These read their argument as an angle too, on the same angle units as the circular functions — so sinh(1) is the hyperbolic sine of one degree. Write sinh(1rad) for the value usually written as sinh(1). The inverses return degrees, so cast the result to read it in radians.
Because angle units are unambiguous, sin(45 deg) and sin((pi/4) rad) refer to the same angle. See Units.