# llTan

*LSL function*

```lsl
float float llTan(float theta);
```

- `float theta`: Angle in radians.

- Returns: `float`
- Energy: 10

Returns the tangent of theta. Theta is in radians.

Returns a [float](https://wiki.secondlife.com/wiki/float) that is the tangent of **theta**.

```lsl title="How to use" frame="terminal"
float result = llTan(0.0);
```

## Caveats

Because of IEE754 on floats , `llTan(PI_BY_TWO)` returns -22877332 ( hex: 0xCBAE8A4A) and not infinity

## Examples

<details open>
<summary>Example 1</summary>

```lsl
// Touch the object with this script in it to see the tangent of random numbers!
default
{
    touch_start(integer num)
    {
        float r = llFrand(TWO_PI);
        llOwnerSay("The tangent of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llTan(r));
    }
}
```

</details>

## See also

### Functions

- [llSin](/functions/llSin/) — [llAsin](/functions/llAsin/) — sine & inverse Sine
- [llCos](/functions/llCos/) — [llAcos](/functions/llAcos/) — cosine & inverse cosine
- [llAtan2](/functions/llAtan2/) — inverse tangent

---

*Source: [LlTan](https://wiki.secondlife.com/wiki/LlTan) on the Second Life Wiki. Content from the Second Life Wiki articles LlTan (revision 1197475, 2015-09-14) and Template:LSL Function/angle (revision 1169077, 2012-06-13), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llTan/
