# cot() Function & Examples

Use the cot() trigonometry function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## cot

#### cot(x)

Try it yourself:

```calculio
cot(2)
1 / tan(2)
```

[sec](https://calcul.io/function/sec/index.md)

[csc](https://calcul.io/function/csc/index.md)

[tan](https://calcul.io/function/tan/index.md)

---

## 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](https://calcul.io/function/cos/index.md) and [sin](https://calcul.io/function/sin/index.md), it repeats every pi radians. Compare it with [tan](https://calcul.io/function/tan/index.md), which is its reciprocal wherever both are defined, and [acot](https://calcul.io/function/acot/index.md), 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](https://calcul.io/function/csc/index.md) 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](https://calcul.io/function/pi/index.md).

[All functions](https://calcul.io/functions/index.md)
