to¶
- InertiaMoment.to(target_unit: str, inplace: bool = False) InertiaMoment
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¶
InertiaMomentConverted moment of inertia.
Raises
Examples
InertiaMomentinstantiation.>>> from gearpy.units import InertiaMoment >>> i = InertiaMoment(1, 'kgm^2') >>> i ... 1 kgm^2
Conversion from kilogram-square meter to gram-square meter with
inplace = Falseby default, so it does not override the current value.>>> i.to('gm^2') ... 1000.0 gm^2 >>> i ... 1 kgm^2
Conversion from kilograms-square meter to gram-square meter with
inplace = True, in order to override the current value.>>> i.to('gm^2', inplace = True) ... 1000.0 gm^2 >>> i ... 1000.0 gm^2