# Tan(float)

> Returns the tangent of angle f in radians.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static float Tan(float f)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The input angle, in radians.

### Returns

| Type                                                          | Description                                          |
| ------------------------------------------------------------- | ---------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The return value in the range (-Infinity, Infinity). |

### Remarks

The tangent trigonometric function has two properties than are worth considering:

* It has two vertical asymptotes at `f` = ±π/2. This means that when approaching these `f` values, the output of the function will grow towards ±Infinity (without ever reaching them).
* It is periodic at π intervals, which means that the output for a value `f` will be the same than the output for value `f` + π (or 2π, 3π, etc.)

Additional Resources: [Mathf.Cos](/engine/6000.7/script-reference/unityengine/mathf/cos.md), [Mathf.Sin](/engine/6000.7/script-reference/unityengine/mathf/sin.md).

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Example()
    {
        // Prints 2.287733E+07
        Debug.Log(Mathf.Tan(-Mathf.PI / 2.0f));
        // Prints 0
        Debug.Log(Mathf.Tan(0.0f));
        // Prints 2.287733E+07
        Debug.Log(Mathf.Tan(Mathf.PI / 2.0f));
        // Prints 1        
        Debug.Log(Mathf.Tan(Mathf.PI / 4.0f));
        // Prints 1
        Debug.Log(Mathf.Tan(Mathf.PI + Mathf.PI / 4.0f));
    }
}
```
