manpagez: man pages & more
info cln
Home | html | info | man
 [ << ] [ < ] [ 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)` and `cos(x)`. This is more efficient than computing them separately. The relation `cos^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”, because `e^(i*x) = cos(x) + i*sin(x)`.

`cl_N asin (const cl_N& z)`

Returns `arcsin(z)`. This is defined as `arcsin(z) = log(iz+sqrt(1-z^2))/i` and satisfies `arcsin(-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 with `realpart = -pi/2` and `imagpart < 0` and the numbers with `realpart = pi/2` and `imagpart > 0`.

`cl_N acos (const cl_N& z)`

Returns `arccos(z)`. This is defined as `arccos(z) = pi/2 - arcsin(z) = log(z+i*sqrt(1-z^2))/i` and satisfies `arccos(-z) = pi - arccos(z)`. The range of the result is the strip in the complex domain `0 <= realpart(arcsin(z)) <= pi`, excluding the numbers with `realpart = 0` and `imagpart < 0` and the numbers with `realpart = pi` and `imagpart > 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 is `atan(y/x)` if `x>0`. The range of the result is the interval `-pi < atan(x,y) <= pi`. The result will be an exact number only if `x > 0` and `y` is the exact `0`. 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 as `atan(1,x)`. The range of the result is the interval `-pi/2 < atan(x) < pi/2`. The result will be an exact number only if `x` is the exact `0`.

`cl_N atan (const cl_N& z)`

Returns `arctan(z)`. This is defined as `arctan(z) = (log(1+iz)-log(1-iz)) / 2i` and satisfies `arctan(-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 with `realpart = -pi/2` and `imagpart >= 0` and the numbers with `realpart = pi/2` and `imagpart <= 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.

```© manpagez.com 2000-2018