to¶
- AngularPosition.to(target_unit: str, inplace: bool = False) AngularPosition
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¶
AngularPositionConverted angular position.
Raises
Examples
AngularPositioninstantiation.>>> from gearpy.units import AngularPosition >>> p = AngularPosition(180, 'deg') >>> p ... 180 deg
Conversion from degree to radian with
inplace = Falseby default, so it does not override the current value.>>> p.to('rad') ... 3.141592653589793 rad >>> p ... 180 deg
Conversion from degree to minute of arc with
inplace = True, in order to override the current value.>>> p.to('arcmin', inplace = True) ... 10800.0 arcmin >>> p ... 10800.0 arcmin