test_deg2rad



In [1]:
import numpy as np
from pint import UnitRegistry
ureg = UnitRegistry()
Q_ = ureg.Quantity

In [2]:
angle = 45
np.deg2rad(angle)


Out[2]:
0.7853981633974483

In [3]:
angle = 45 * ureg.degree
np.deg2rad(angle)


Out[3]:
0.7853981633974483 radian

In [4]:
angle = 0.785 * ureg.radian
np.deg2rad(angle)


Out[4]:
0.785 radian

In [5]:
angle = 45 * ureg.dimensionless
np.deg2rad(angle)


Out[5]:
45.0 radian

In [ ]: