to¶
- Angle.to(target_unit: str, inplace: bool = False) Angle
It converts actual
valueto a new value computed usingtarget_unitas the reference unit of measurement.If
inplaceisTrue, it overrides actualvalueandunit, otherwise it returns a new instance with the convertedvalueand thetarget_unitasunit.Parameters¶
Returns¶
AngleConverted angle.
Raises
Examples
Angleinstantiation.>>> from gearpy.units import Angle >>> a = Angle(180, 'deg') >>> a 180 deg
Conversion from degree to radian with
inplace=Falseby default, so it does not override the current value.>>> a.to('rad') 3.141592653589793 rad >>> a 180 deg
Conversion from degree to minute of arc with
inplace=True, in order to override the current value.>>> a.to('arcmin', inplace=True) 10800.0 arcmin >>> a 10800.0 arcmin