Next: Sums and Products, Previous: Complex Arithmetic, Up: Arithmetic [Contents][Index]
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.
Compute the sine for each element of x in radians.
Compute the cosine for each element of x in radians.
Compute the tangent for each element of x in radians.
Compute the secant for each element of x in radians.
Compute the cosecant for each element of x in radians.
Compute the cotangent for each element of x in radians.
Compute the inverse sine in radians for each element of x.
Compute the inverse cosine in radians for each element of x.
Compute the inverse tangent in radians for each element of x.
Compute the inverse secant in radians for each element of x.
Compute the inverse cosecant in radians for each element of x.
Compute the inverse cotangent in radians for each element of x.
Compute the hyperbolic sine for each element of x.
Compute the hyperbolic cosine for each element of x.
Compute hyperbolic tangent for each element of x.
Compute the hyperbolic secant of each element of x.
See also: asech.
Compute the hyperbolic cosecant of each element of x.
See also: acsch.
Compute the hyperbolic cotangent of each element of x.
See also: acoth.
Compute the inverse hyperbolic sine for each element of x.
See also: sinh.
Compute the inverse hyperbolic cosine for each element of x.
See also: cosh.
Compute the inverse hyperbolic tangent for each element of x.
See also: tanh.
Compute the inverse hyperbolic secant of each element of x.
See also: sech.
Compute the inverse hyperbolic cosecant of each element of x.
See also: csch.
Compute the inverse hyperbolic cotangent of each element of x.
See also: coth.
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 round-off error that occurs when using radians. For example:
cosd (90) ⇒ 0 cos (pi/2) ⇒ 6.1230e-17
Compute the sine for each element of x in degrees. Returns zero
for elements where x/180
is an integer.
Compute the cosine for each element of x in degrees. Returns zero
for elements where (x-90)/180
is an integer.
Compute the tangent for each element of x in degrees. Returns zero
for elements where x/180
is an integer and Inf
for
elements where (x-90)/180
is an integer.
Compute the cosecant for each element of x in degrees.
Compute the cotangent for each element of x in degrees.
Compute the inverse sine in degrees for each element of x.
Compute the inverse cosine in degrees for each element of x.
Compute the inverse tangent in degrees for each element of x.
Compute the inverse secant in degrees for each element of x.
Compute the inverse cosecant in degrees for each element of x.
Compute the inverse cotangent in degrees for each element of x.
Next: Sums and Products, Previous: Complex Arithmetic, Up: Arithmetic [Contents][Index]