Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Asin(float)

Returns the arc-sine of f - the angle in radians whose sine is f.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static float Asin(float f)

Parameters

Value to compute the arc-sine for, in the range [-1,1].

Returns

Type

Description

floatAngle in radians whose sine equals
f
, in the range [-Pi/2, Pi/2].

Remarks

For values of
f
outside of the [-1,1] range, this function will return NaN.
Additional Resources: Mathf.Sin.

Examples

using UnityEngine;public class ScriptExample : MonoBehaviour{ void Start() { // Prints NaN Debug.Log(Mathf.Asin(-1.0000001f)); // Prints -1.570796 Debug.Log(Mathf.Asin(-1)); // Prints 0 Debug.Log(Mathf.Asin(0)); // Prints 1.570796 Debug.Log(Mathf.Asin(1)); // Prints NaN Debug.Log(Mathf.Asin(1.0000001f)); }}