NAME

asin - returns arcsine of scalars and vectors.

SYNOPSIS

  float  asin( float  a );
  float1 asin( float2 a );
  float2 asin( float2 a );
  float3 asin( float3 a );
  float4 asin( float4 a );
 
  half   asin( half  a );
  half1  asin( half2 a );
  half2  asin( half2 a );
  half3  asin( half3 a );
  half4  asin( half4 a );
 
  fixed  asin( fixed  a );
  fixed1 asin( fixed2 a );
  fixed2 asin( fixed2 a );
  fixed3 asin( fixed3 a );
  fixed4 asin( fixed4 a );

PARAMETERS

a

Vector or scalar of which to determine the arcsine.

DESCRIPTION

Returns the arcsine of a in the range [-pi/2,+pi/2], expecting a to be in the range [-1,+1].

For vectors, the returned vector contains the arcsine of each element of the input vector.

REFERENCE IMPLEMENTATION

asin for a float scalar could be implemented like this.

  // Handbook of Mathematical Functions
  // M. Abramowitz and I.A. Stegun, Ed.

  float asin(float x) {
    float negate = float(x < 0);
    x = abs(x);
    float ret = -0.0187293;
    ret *= x;
    ret += 0.0742610;
    ret *= x;
    ret -= 0.2121144;
    ret *= x;
    ret += 1.5707288;
    ret = 3.14159265358979*0.5 - sqrt(1.0 - x)*ret;
    return ret - 2 * negate * ret;
  }

PROFILE SUPPORT

asin is supported in all profiles.

Support in the fp20 is limited.

SEE ALSO

abs, acos, sin, sqrt