tan

tan(x)

Try it yourself:

See also:

tan(): tangent of an angle

tan(x) returns the tangent of angle x, normally measured in radians. In a right triangle it is opposite side divided by adjacent side.

Examples and asymptotes

tan(0) is 0. Tangent becomes undefined at odd multiples of π/2, where cosine is zero, and values grow rapidly near those angles.

Related trigonometry

Use sin() and cos() for the component functions, atan() for the inverse, and pi for exact angle forms. atan2() finds an angle from coordinates.

Caveat

Convert degree inputs before calling tan, and avoid evaluating extremely close to an asymptote without a numerical plan.

All functions