GNU Octave Manual Version 3by John W. Eaton, David Bateman, Søren Hauberg Paperback (6"x9"), 568 pages ISBN 095461206X RRP £24.95 ($39.95) |

## 17.3 Trigonometry

Octave provides the following trigonometric functions. 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).

__Mapping Function:__**sin***(*`x`)- Compute the sine of each element of
`x`.

__Mapping Function:__**cos***(*`x`)- Compute the cosine of each element of
`x`.

__Mapping Function:__**tan***(*`z`)- Compute tangent of each element of
`x`.

__Mapping Function:__**sec***(*`x`)- Compute the secant of each element of
`x`.

__Mapping Function:__**csc***(*`x`)- Compute the cosecant of each element of
`x`.

__Mapping Function:__**cot***(*`x`)- Compute the cotangent of each element of
`x`.

__Mapping Function:__**asin***(*`x`)- Compute the inverse sine of each element of
`x`.

__Mapping Function:__**acos***(*`x`)- Compute the inverse cosine of each element of
`x`.

__Mapping Function:__**atan***(*`x`)- Compute the inverse tangent of each element of
`x`.

__Mapping Function:__**asec***(*`x`)- Compute the inverse secant of each element of
`x`.

__Mapping Function:__**acsc***(*`x`)- Compute the inverse cosecant of each element of
`x`.

__Mapping Function:__**acot***(*`x`)- Compute the inverse cotangent of each element of
`x`.

__Mapping Function:__**sinh***(*`x`)- Compute the hyperbolic sine of each element of
`x`.

__Mapping Function:__**cosh***(*`x`)- Compute the hyperbolic cosine of each element of
`x`.

__Mapping Function:__**tanh***(*`x`)- Compute hyperbolic tangent of each element of
`x`.

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

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

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

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

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

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

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

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

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

Each of these functions expects a single argument. For matrix arguments, they work on an element by element basis. For example,

sin ([1, 2; 3, 4]) => 0.84147 0.90930 0.14112 -0.75680

__Mapping Function:__**atan2***(*`y`,`x`)- Compute atan (
`y`/`x`) for corresponding elements of`y`and`x`. The result is in the range -pi to pi.

In addition to the trigonometric functions that work with radians, Octave also provides the following functions which work with degrees.

__Function File:__**sind***(*`x`)- Compute the sine of each element of
`x`. Returns zero in elements for which

is an integer.`x`/180See also sin, cosd, tand, acosd, asind, atand

__Function File:__**cosd***(*`x`)- Compute the cosine of an angle in degrees. Returns zero in elements
for which
`(`

is an integer.`x`-90)/180See also cos, sind, tand, acosd, asind, atand

__Function File:__**tand***(*`x`)- Compute the tangent of an angle in degrees. Returns zero for elements
of for which

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

for elements where`(`

is an integer.`x`-90)/180See also tan, cosd, sind, acosd, asind, atand

__Function File:__**secd***(*`x`)- Compute the secant of an angle in degrees.
See also sec, cscd, sind, cosd

__Function File:__**cscd***(*`x`)- Compute the cosecant of an angle in degrees.
See also csc, secd, sind, cosd

__Function File:__**cotd***(*`x`)- Compute the cotangent of an angle in degrees.
See also cot, tand

__Function File:__**asind***(*`x`)- Compute the inverse sine of an angle in degrees.
See also asin, sind, acosd

__Function File:__**acosd***(*`x`)- Compute the inverse cosine of an angle in degrees.
See also acos, cosd, asecd

__Function File:__**atand***(*`x`)- Compute the inverse tangent of an angle in degrees.
See also acot, tand

__Function File:__**asecd***(*`x`)- Compute inverse secant in degrees.
See also asec, secd, acscd

__Function File:__**acscd***(*`x`)- Compute the inverse cosecant of an angle in degrees.
See also acsc, cscd, asecd

__Function File:__**acotd***(*`x`)- Compute the inverse cotangent of an angle in degrees.
See also atan, tand

ISBN 095461206X | GNU Octave Manual Version 3 | See the print edition |