sec

Secant of an angle in radians, 1/cos(x).

Category: Mathematics > Elementary Math

Syntax

Y = sec(X)

Returns 1./cos(X) for each element of X, with X in radians.

Description

The secant is the reciprocal of the cosine, so it has vertical asymptotes where the cosine vanishes, at odd multiples of pi/2. Because pi/2 is not represented exactly, sec(pi/2) gives a huge number rather than Inf.

For angles in degrees use secd; the hyperbolic counterpart is sech.

Input arguments

X
Angles in radians; real or complex.

Output arguments

Y
Array of the same size as X, with absolute value at least 1 for real input.

Example

Values at common angles

sec([0 pi/3 pi])
sec(pi/2)
Output
ans = 1×3

    1.0000    2.0000   -1.0000
ans = 1.6331e+16

See also

cos secd sech csc asec