asin
number => radians
acos
number => radians
atan
number1 &optional number2 => radians
number--a number.
number1--a number if number2 is not supplied, or a real if number2 is supplied.
number2--a real.
radians--a number (of radians).
asin, acos, and atan compute the arc sine, arc cosine, and arc tangent respectively.
The arc sine, arc cosine, and arc tangent (with only number1 supplied) functions can be defined mathematically for number or number1 specified as x as in Figure 12-13.
Function Definition Arc sine -i log (ix+ \sqrt1-x^2 ) Arc cosine (\pi/2) - arcsin x Arc tangent -i log ((1+ix) \sqrt1/(1+x^2) ) Figure 12--13: Mathematical definition of arc sine, arc cosine, and arc tangent
These formulae are mathematically correct, assuming completely accurate computation. They are not necessarily the simplest ones for real-valued computations.
If both number1 and number2 are supplied for atan, the result is the arc tangent of number1/number2. The value of atan is always between -\pi (exclusive) and~\pi (inclusive)
when minus zero is not supported. The range of the two-argument arc tangent when minus zero is supported includes -\pi.
For a
real
number1, the result is
a real
and lies between -\pi/2 and~\pi/2 (both exclusive). number1 can be a complex if number2 is not supplied. If both are supplied, number2 can be zero provided number1 is not zero.
[Reviewer Note by Barmar: Should add "However, if the implementation distinguishes positive and negative zero, both may be signed zeros, and limits are used to define the result."]
The following definition for arc sine determines the range and branch cuts:
The following definition for arc cosine determines the range and branch cuts:
The following definition for (one-argument) arc tangent determines the range and branch cuts:
For atan, the signs of number1 (indicated as x) and number2 (indicated as y) are used to derive quadrant information. Figure 12-14 details various special cases.
The asterisk (*) indicates that the entry in the figure applies to implementations that support minus zero.
to 1pcy Condition x Condition Cartesian locus Range of result to 1pc y = 0 x > 0 Positive x-axis 0 to 1pc* y = +0 x > 0 Positive x-axis +0 to 1pc* y = -0 x > 0 Positive x-axis -0 to 1pc y > 0 x > 0 Quadrant I 0 < result < \pi/2 to 1pc y > 0 x = 0 Positive y-axis \pi/2 to 1pc y > 0 x < 0 Quadrant II \pi/2 < result < \pi to 1pc y = 0 x < 0 Negative x-axis \pi to 1pc* y = +0 x < 0 Negative x-axis +\pi to 1pc* y = -0 x < 0 Negative x-axis -\pi to 1pc y < 0 x < 0 Quadrant III -\pi < result < -\pi/2 to 1pc y < 0 x = 0 Negative y-axis -\pi/2 to 1pc y < 0 x > 0 Quadrant IV -\pi/2 < result < 0 to 1pc y = 0 x = 0 Origin undefined consequences to 1pc* y = +0 x = +0 Origin +0 to 1pc* y = -0 x = +0 Origin -0 to 1pc* y = +0 x = -0 Origin +\pi to 1pc* y = -0 x = -0 Origin -\pi Figure 12--14: Quadrant information for arc tangent
(asin 0) => 0.0 (acos #c(0 1)) => #C(1.5707963267948966 -0.8813735870195432) (/ (atan 1 (sqrt 3)) 6) => 0.087266 (atan #c(0 2)) => #C(-1.5707964 0.54930615)
acos and asin should signal an error of type type-error if number is not a number. atan should signal type-error if one argument is supplied and that argument is not a number, or if two arguments are supplied and both of those arguments are not reals.
acos, asin, and atan might signal arithmetic-error.
The result of either asin or acos can be a complex even if number is not a complex; this occurs when the absolute value of number is greater than one.