Skip to content

novaphy.deg2rad

Convert an angle from degrees to radians.

def deg2rad(degrees: float) -> float

Parameters

Parameter Description
degrees Input angle in degrees.

Returns

The angle expressed in radians (degrees * π / 180).

Example

import math
import novaphy

assert math.isclose(novaphy.deg2rad(180.0), math.pi)
assert math.isclose(novaphy.deg2rad(-90.0), -math.pi / 2)

Notes

  • Use this helper when authoring URDF / MJCF-style angle inputs from Python literals.
  • For NumPy arrays of angles, prefer numpy.deg2rad; this helper accepts a single scalar.

See Also