Main Content

Trigonometry

Sine, cosine, and related functions, with results in radians or degrees

The trigonometric functions in MATLAB® calculate standard trigonometric values in radians or degrees, hyperbolic trigonometric values in radians, and inverse variants of each function. You can use the rad2deg and deg2rad functions to convert between radians and degrees, or functions like cart2pol to convert between coordinate systems.

Functions

expand all

sinSine of argument in radians
sindSine of argument in degrees
sinpiCompute sin(X*pi) accurately
asinInverse sine in radians
asindInverse sine in degrees
sinhHyperbolic sine
asinhInverse hyperbolic sine
cosCosine of argument in radians
cosdCosine of argument in degrees
cospiCompute cos(X*pi) accurately
acosInverse cosine in radians
acosdInverse cosine in degrees
coshHyperbolic cosine
acoshInverse hyperbolic cosine
tanTangent of argument in radians
tandTangent of argument in degrees
atanInverse tangent in radians
atandInverse tangent in degrees
atan2Four-quadrant inverse tangent
atan2dFour-quadrant inverse tangent in degrees
tanhHyperbolic tangent
atanhInverse hyperbolic tangent
cscCosecant of input angle in radians
cscdCosecant of argument in degrees
acscInverse cosecant in radians
acscdInverse cosecant in degrees
cschHyperbolic cosecant
acschInverse hyperbolic cosecant
secSecant of angle in radians
secdSecant of argument in degrees
asecInverse secant in radians
asecdInverse secant in degrees
sechHyperbolic secant
asechInverse hyperbolic secant
cotCotangent of angle in radians
cotdCotangent of argument in degrees
acotInverse cotangent in radians
acotdInverse cotangent in degrees
cothHyperbolic cotangent
acothInverse hyperbolic cotangent
hypotSquare root of sum of squares (hypotenuse)

Degrees/Radians Conversion

deg2radConvert angle from degrees to radians
rad2degConvert angle from radians to degrees

Coordinate Conversion

cart2polTransform Cartesian coordinates to polar or cylindrical
cart2sphTransform Cartesian coordinates to spherical
pol2cartTransform polar or cylindrical coordinates to Cartesian
sph2cartTransform spherical coordinates to Cartesian