cot

cot(x)

Try it yourself:

See also:

Calculate cotangent with cot

cot(x) returns the cotangent of angle x in radians. It is the reciprocal of tangent and can be written cos(x) / sin(x). Cotangent is useful where a reciprocal slope or trigonometric ratio is the natural form.

Examples and relationships

cot(pi / 4) is 1. Because cotangent is built from cos and sin, it repeats every pi radians. Compare it with tan, which is its reciprocal wherever both are defined, and acot, which returns a principal inverse angle.

Poles and numerical care

Cotangent is undefined where sine is zero: at integer multiples of pi. Near those angles its magnitude becomes very large, so finite-precision calculations can be sensitive to small input errors. Test for the special case before dividing, especially in geometric formulas. csc has the same sine-zero restriction.

Practical use

In a right triangle, cotangent is adjacent over opposite when x is an acute angle. In coordinate geometry and wave calculations, expressing a result through cotangent can simplify a reciprocal tangent term. Keep units consistent: calculator trig functions expect radians, so convert degree measurements using pi.

Try Cot in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions