Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.48 KB

081_asin.asciidoc

File metadata and controls

77 lines (56 loc) · 1.48 KB

asin

NAME

asin - arc sine function.

SYNOPSIS
#include <math.h>

double asin(double x);
DESCRIPTION

The asin() function calculates the arc sine of x; that is the value whose sine is x. If x falls outside the range -1 to 1, asin() fails and errno is set.

Warning
You’ll also need to link the program against the math library (see example below) using the -lm compile/link option.
RETURN VALUE

The asin() function returns the arc sine in radians and the value is mathematically defined to be between -PI/2 and PI/2 (inclusive).

ERRORS

EDOM - x is out of range [-1, 1].

SEE ALSO

acos, atan, atan2, cos, sin, tan

EXAMPLE
link:src/asin.c[role=include]
OUTPUT
$ gcc -Wall -lm asin.c
$ ./a.out
ASIN(-1.000000) = -1.570796
ASIN(-0.900000) = -1.119769
ASIN(-0.800000) = -0.927295
ASIN(-0.700000) = -0.775397
ASIN(-0.600000) = -0.643501
ASIN(-0.500000) = -0.523599
ASIN(-0.400000) = -0.411517
ASIN(-0.300000) = -0.304693
ASIN(-0.200000) = -0.201358
ASIN(-0.100000) = -0.100167
ASIN(0.000000) = 0.000000
ASIN(0.100000) = 0.100167
ASIN(0.200000) = 0.201358
ASIN(0.300000) = 0.304693
ASIN(0.400000) = 0.411517
ASIN(0.500000) = 0.523599
ASIN(0.600000) = 0.643501
ASIN(0.700000) = 0.775398
ASIN(0.800000) = 0.927295
ASIN(0.900000) = 1.119770