---
title: "tan"
subtitle: "Function in std::math"
excerpt: "Compute the tangent of a number."
layout: manual
---

Compute the tangent of a number.

```kcl
tan(@num: number(Angle)): number(_)
```



### Arguments

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |

### Returns

[`number(_)`](/docs/kcl-std/types/std-types-number) - A number.


### Examples

```kcl
exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> angledLine(
    angle = 50,
    length = 50 * tan((1/2): number(rad)),
  )
  |> yLine(endAbsolute = 0)
  |> close()

example = extrude(exampleSketch, length = 5)
```

![Rendered example of tan 0](data:image/png;base64,[encoded data, 84944 characters])


