Main Content

degtorad

(Not recommended) Convert angles from degrees to radians

degtorad is not recommended. Use the deg2rad function instead. For more information, see Compatibility Considerations.

Description

example

angleInRadians = degtorad(angleInDegrees) converts angle units from degrees to radians.

Examples

collapse all

Convert 90 degrees to radians.

angleInRadians = degtorad(90)
angleInRadians =

    1.5708

Input Arguments

collapse all

Angle in degrees, specified as a scalar, vector, matrix, or N-D array.

Version History

Introduced in R2009b

collapse all

R2015b: degtorad is not recommended

The degtorad function is not recommended. Use the deg2rad function instead.

To update your code, replace instances of the degtorad function with the deg2rad function.

While the degtorad function accepts input arguments of integer types such as uint8, the deg2rad function accepts only single- and double-precision types. You can convert integer types to single- or double-precision types by using the single or double function.

See Also