to¶
- AngularSpeed.to(target_unit: str, inplace: bool = False) AngularSpeed
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¶
AngularSpeedConverted angular speed.
Raises
Examples
AngularSpeedinstantiation.>>> from gearpy.units import AngularSpeed >>> s = AngularSpeed(1000, 'rpm') >>> s ... 1000 rpm
Conversion from revolutions per minute to radian per second with
inplace = Falseby default, so it does not override the current value.>>> s.to('rad/s') ... 104.71975511965977 rad/s >>> s ... 1000 rpm
Conversion from revolutions per minute to revolutions per second with
inplace = True, in order to override the current value.>>> s.to('rps', inplace = True) ... 16.666666666666664 rps >>> s ... 16.666666666666664 rps