[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

## 17.3 Trigonometry

Octave provides the following trigonometric functions where angles are
specified in radians. To convert from degrees to radians multiply by
`pi/180`

(e.g., `sin (30 * pi/180)`

returns the sine of 30 degrees). As
an alternative, Octave provides a number of trigonometric functions
which work directly on an argument specified in degrees. These functions
are named after the base trigonometric function with a ‘`d`’ suffix. For
example, `sin`

expects an angle in radians while `sind`

expects an
angle in degrees.

__Mapping Function:__**sech***(*`x`)Compute the hyperbolic secant of each element of

`x`.**See also:**asech.

__Mapping Function:__**csch***(*`x`)Compute the hyperbolic cosecant of each element of

`x`.**See also:**acsch.

__Mapping Function:__**coth***(*`x`)Compute the hyperbolic cotangent of each element of

`x`.**See also:**acoth.

__Mapping Function:__**asinh***(*`x`)Compute the inverse hyperbolic sine for each element of

`x`.**See also:**sinh.

__Mapping Function:__**acosh***(*`x`)Compute the inverse hyperbolic cosine for each element of

`x`.**See also:**cosh.

__Mapping Function:__**atanh***(*`x`)Compute the inverse hyperbolic tangent for each element of

`x`.**See also:**tanh.

__Mapping Function:__**asech***(*`x`)Compute the inverse hyperbolic secant of each element of

`x`.**See also:**sech.

__Mapping Function:__**acsch***(*`x`)Compute the inverse hyperbolic cosecant of each element of

`x`.**See also:**csch.

__Mapping Function:__**acoth***(*`x`)Compute the inverse hyperbolic cotangent of each element of

`x`.**See also:**coth.

__Mapping Function:__**atan2***(*`y`,`x`)Compute atan (

`y`/`x`) for corresponding elements of`y`and`x`. Signal an error if`y`and`x`do not match in size and orientation.

Octave provides the following trigonometric functions where angles are specified in degrees. These functions produce true zeros at the appropriate intervals rather than the small roundoff error that occurs when using radians. For example:

cosd (90) ⇒ 0 cos (pi/2) ⇒ 6.1230e-17 |

__Function File:__**sind***(*`x`)Compute the sine for each element of

`x`in degrees. Returns zero for elements where

is an integer.`x`/180

__Function File:__**cosd***(*`x`)Compute the cosine for each element of

`x`in degrees. Returns zero for elements where`(`

is an integer.`x`-90)/180

__Function File:__**tand***(*`x`)Compute the tangent for each element of

`x`in degrees. Returns zero for elements where

is an integer and`x`/180`Inf`

for elements where`(`

is an integer.`x`-90)/180

[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |