[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.8.2 Trigonometric functions
cl_R sin (const cl_R& x)
-
Returns
sin(x)
. The range of the result is the interval-1 <= sin(x) <= 1
. cl_N sin (const cl_N& z)
Returns
sin(z)
. The range of the result is the entire complex plane.cl_R cos (const cl_R& x)
-
Returns
cos(x)
. The range of the result is the interval-1 <= cos(x) <= 1
. cl_N cos (const cl_N& x)
Returns
cos(z)
. The range of the result is the entire complex plane.struct cos_sin_t { cl_R cos; cl_R sin; };
cos_sin_t cos_sin (const cl_R& x)
Returns both
sin(x)
andcos(x)
. This is more efficient than computing them separately. The relationcos^2 + sin^2 = 1
will hold only approximately.cl_R tan (const cl_R& x)
cl_N tan (const cl_N& x)
Returns
tan(x) = sin(x)/cos(x)
.cl_N cis (const cl_R& x)
cl_N cis (const cl_N& x)
Returns
exp(i*x)
. The name ‘cis’ means “cos + i sin”, becausee^(i*x) = cos(x) + i*sin(x)
.cl_N asin (const cl_N& z)
Returns
arcsin(z)
. This is defined asarcsin(z) = log(iz+sqrt(1-z^2))/i
and satisfiesarcsin(-z) = -arcsin(z)
. The range of the result is the strip in the complex domain-pi/2 <= realpart(arcsin(z)) <= pi/2
, excluding the numbers withrealpart = -pi/2
andimagpart < 0
and the numbers withrealpart = pi/2
andimagpart > 0
.cl_N acos (const cl_N& z)
-
Returns
arccos(z)
. This is defined asarccos(z) = pi/2 - arcsin(z) = log(z+i*sqrt(1-z^2))/i
and satisfiesarccos(-z) = pi - arccos(z)
. The range of the result is the strip in the complex domain0 <= realpart(arcsin(z)) <= pi
, excluding the numbers withrealpart = 0
andimagpart < 0
and the numbers withrealpart = pi
andimagpart > 0
. cl_R atan (const cl_R& x, const cl_R& y)
Returns the angle of the polar representation of the complex number
x+iy
. This isatan(y/x)
ifx>0
. The range of the result is the interval-pi < atan(x,y) <= pi
. The result will be an exact number only ifx > 0
andy
is the exact0
. WARNING: In Common Lisp, this function is called as(atan y x)
, with reversed order of arguments.cl_R atan (const cl_R& x)
Returns
arctan(x)
. This is the same asatan(1,x)
. The range of the result is the interval-pi/2 < atan(x) < pi/2
. The result will be an exact number only ifx
is the exact0
.cl_N atan (const cl_N& z)
Returns
arctan(z)
. This is defined asarctan(z) = (log(1+iz)-log(1-iz)) / 2i
and satisfiesarctan(-z) = -arctan(z)
. The range of the result is the strip in the complex domain-pi/2 <= realpart(arctan(z)) <= pi/2
, excluding the numbers withrealpart = -pi/2
andimagpart >= 0
and the numbers withrealpart = pi/2
andimagpart <= 0
.
Archimedes’ constant pi = 3.14… is returned by the following functions:
cl_F pi (float_format_t f)
-
Returns pi as a float of format
f
. cl_F pi (const cl_F& y)
Returns pi in the float format of
y
.cl_F pi (void)
Returns pi as a float of format
default_float_format
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on August 27, 2013 using texi2html 5.0.