InertiaMoment¶
- class InertiaMoment(value: float | int, unit: str)¶
Bases:
UnitBaseInertiaMomentobject.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) 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
- property unit: str¶
Symbol of the unit of measurement for moment of inertia. It must be a
str. Available units are:'kgm^2'for kilogram-square meter,'kgdm^2'for kilogram-square decimeter,'kgcm^2'for kilogram-square centimeter,'kgmm^2'for kilogram-square millimeter,'gm^2'for gram-square meter,'gdm^2'for gram-square decimeter,'gcm^2'for gram-square centimeter,'gmm^2'for gram-square millimeter.
Returns¶
strSymbol of the unit of measurement for moment of inertia.