AngularSpeed¶
- class AngularSpeed(value: float | int, unit: str)¶
Bases:
UnitBaseAngularSpeedobject.Attributes¶
Methods¶
to()It converts actual
valueto a new value computed usingtarget_unitas the reference unit of measurement.
- 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
- property unit: str¶
Symbol of the unit of measurement for angular speed. It must be a
str. Available units are:'rad/s'for radian per second,'rad/min'for radian per minute,'rad/h'for radian per hour,'deg/s'for degree per second,'deg/min'for degree per minute,'deg/h'for degree per hour,'rps'for revolutions per second,'rpm'for revolutions per minute,'rph'for revolutions per hour.
Returns¶
strSymbol of the unit of measurement for angular speed.