acos
Inverse Trigonometric Functions

Description

Inverse trigonometric functions (value in radians).

Usage

acos(x)
asin(x)
atan(x)
atan2(y, x)

Arguments

x a numeric or complex vector (expect for atan2, which requires a numeric vector). Missing values (NAs) are allowed.
y For atan2 only, a numeric vector that is the same length as x. Missing values (NAs) are allowed.

Details

For numeric (i.e., real) arguments, the domain of acos and asin is the interval [-1, 1], and the range is 0 <= acos(x) <= pi and -pi/2 <= asin(x) <= pi/2. For numeric arguments the domain of atan is unrestricted and the range is -pi/2 < atan(x) < pi/2. For numeric arguments outside of the appropriate domains, NaN is returned. For complex arguments any values are accepted and complex results are returned.
atan2(y,x) requires two numeric (not complex) arguments and returns the angle from the positive x axis to the ray from 0,0 to x,y. Its value, in radians, is in the range -pi < atan2(y,x) <= pi.
These functions are members of the Math group of generic functions: a writer of a new class may quickly generate methods for all members of this group by writing a Math.<class> method.
Value
returns, in radians, the value of the inverse trigonometric function, with attributes preserved.
See Also
acosh, cos, cosh.
Examples
atan2(-1, 1) == atan(-1)   # both return -pi/4
atan2(1, -1)  # returns 3*pi/4
acos(1/2)   # returns pi/3

disk <- complex(arg = seq(-pi,pi, len=13))[-13] # 12 points equispaced on a unit circle asin(disk) / pi

Package base version 6.0.0-69
Package Index