Atan(float)
Returns the arc-tangent of f - the angle in radians whose tangent is f.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static float Atan(float f)
Parameters
Value to compute the arc-tangent for, in the range [-Infinity, Infinity].
Returns
Type | Description |
|---|---|
| float | Angle in radians whose tangent equals |
Remarks
For values of outside of the [-1,1] range, this function will return NaN.
fAdditional Resources: Mathf.Tan, Mathf.Atan2.
Examples
using UnityEngine;public class ScriptExample : MonoBehaviour{ void Start() { // Prints -1.570796 Debug.Log(Mathf.Atan(-Mathf.Infinity)); // Prints -0.7853982 Debug.Log(Mathf.Atan(-1)); // Prints 0 Debug.Log(Mathf.Atan(0)); // Prints 0.7853982 Debug.Log(Mathf.Atan(1)); // Prints 1.570796 Debug.Log(Mathf.Atan(Mathf.Infinity)); }}