units¶
- class Angle(value: float | int, unit: str)¶
Bases:
AngularPositionAngleobject.Attributes¶
Methods¶
to()It converts actual
valueto a new value computed usingtarget_unitas the reference unit of measurement.sin()It computes the sine of the angle at a given frequency.
cos()It computes the cosine of the angle at a given frequency.
tan()It computes the tangent of the angle at a given frequency.
- cos(frequency: float | int | None = 0.15915494309189535) float¶
It computes the cosine of the angle at a given frequency.
Parameters¶
Returns¶
floatComputed cosine of the angle.
- sin(frequency: float | int | None = 0.15915494309189535) float¶
It computes the sine of the angle at a given frequency.
Parameters¶
Returns¶
floatComputed sine of the angle.
- tan(frequency: float | int | None = 0.15915494309189535) float¶
It computes the tangent of the angle at a given frequency.
Parameters¶
Returns¶
floatComputed tangent of the angle.
- to(target_unit: str, inplace: bool = False) Angle¶
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¶
AngleConverted angle.
Raises
Examples
Angleinstantiation.>>> from gearpy.units import Angle >>> a = Angle(180, 'deg') >>> a 180 deg
Conversion from degree to radian with
inplace=Falseby default, so it does not override the current value.>>> a.to('rad') 3.141592653589793 rad >>> a 180 deg
Conversion from degree to minute of arc with
inplace=True, in order to override the current value.>>> a.to('arcmin', inplace=True) 10800.0 arcmin >>> a 10800.0 arcmin
- class AngularAcceleration(value: float | int, unit: str)¶
Bases:
UnitBaseAngularAccelerationobject.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) AngularAcceleration¶
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¶
AngularAccelerationConverted angular acceleration.
Raises
Examples
AngularAccelerationinstantiation.>>> from gearpy.units import AngularAcceleration >>> a = AngularAcceleration(180, 'deg/s^2') >>> a 180 deg/s^2
Conversion from degree per second squared to radian per second squared with
inplace=Falseby default, so it does not override the current value.>>> a.to('rad/s^2') 3.141592653589793 rad/s^2 >>> a 180 deg/s^2
Conversion from degree per second squared to radian per second squared with
inplace=True, in order to override the current value.>>> a.to('rad/s^2', inplace=True) 3.141592653589793 rad/s^2 >>> a 3.141592653589793 rad/s^2
- property unit: str¶
Symbol of the unit of measurement for angular acceleration. It must be a
str. Available units are:'rad/s^2'for radian per second squared,'deg/s^2'for degree per second squared,'rot/s^2'for rotation per second squared.
Returns¶
strSymbol of the unit of measurement for angular acceleration.
- class AngularPosition(value: float | int, unit: str)¶
Bases:
UnitBaseAngularPositionobject.Attributes¶
Methods¶
to()It converts actual
valueto a new value computed usingtarget_unitas the reference unit of measurement.sin()It computes the sine of the angular position at a given frequency.
cos()It computes the cosine of the angular position at a given frequency.
tan()It computes the tangent of the angular position at a given frequency.
- cos(frequency: float | int | None = 0.15915494309189535) float¶
It computes the cosine of the angular position at a given frequency.
Parameters¶
Returns¶
floatComputed cosine of the angular position.
- sin(frequency: float | int | None = 0.15915494309189535) float¶
It computes the sine of the angular position at a given frequency.
Parameters¶
Returns¶
floatComputed sine of the angular position.
- tan(frequency: float | int | None = 0.15915494309189535) float¶
It computes the tangent of the angular position at a given frequency.
Parameters¶
Returns¶
floatComputed tangent of the angular position.
- 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
- 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.
- class Current(value: float | int, unit: str)¶
Bases:
UnitBaseCurrentobject.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) Current¶
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¶
CurrentConverted electrical current.
Raises
Examples
Currentinstantiation.>>> from gearpy.units import Current >>> i = Current(1, 'A') >>> i 1 A
Conversion from ampere to milli-ampere with
inplace=Falseby default, so it does not override the current value.>>> i.to('mA') 1000.0 mA >>> i 1 A
Conversion from ampere to milli-ampere with
inplace=True, in order to override the current value.>>> i.to('mA', inplace=True) 1000.0 mA >>> i 1000.0 mA
- class Force(value: float | int, unit: str)¶
Bases:
UnitBaseForceobject.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) Force¶
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¶
ForceConverted force.
Raises
Examples
Forceinstantiation.>>> from gearpy.units import Force >>> f = Force(1, 'N') >>> f 1 N
Conversion from newton to kilogram force with
inplace=Falseby default, so it does not override the current value.>>> f.to('kgf') 0.10197162129779283 kgf >>> f 1 N
Conversion from newton to kilogram force with
inplace=True, in order to override the current value.>>> f.to('kgf', inplace=True) 0.10197162129779283 kgf >>> f 0.10197162129779283 kgf
- 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.
- class Length(value: float | int, unit: str)¶
Bases:
UnitBaseLengthobject.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) Length¶
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¶
LengthConverted length.
Raises
Examples
Lengthinstantiation.>>> from gearpy.units import Length >>> l = Length(1, 'm') >>> l 1 m
Conversion from meter to centimeter with
inplace=Falseby default, so it does not override the current value.>>> l.to('cm') 100.0 cm >>> l 1 m
Conversion from meter to centimeter with
inplace=True, in order to override the current value.>>> l.to('cm', inplace=True) 100.0 cm >>> l 100.0 cm
- class Stress(value: float | int, unit: str)¶
Bases:
UnitBaseStressobject.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) Stress¶
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¶
StressConverted stress.
Raises
Examples
Stressinstantiation.>>> from gearpy.units import Stress >>> s = Stress(1, 'GPa') >>> s 1 GPa
Conversion from giga-pascal to mega-pascal with
inplace=Falseby default, so it does not override the current value.>>> s.to('MPa') 1000.0 MPa >>> s 1 GPa
Conversion from giga-pascal to mega-pascal with
inplace=True, in order to override the current value.>>> s.to('MPa', inplace=True) 1000.0 MPa >>> s 1000.0 MPa
- class Surface(value: float | int, unit: str)¶
Bases:
UnitBaseSurfaceobject.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) Surface¶
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¶
SurfaceConverted surface.
Raises
Examples
Surfaceinstantiation.>>> from gearpy.units import Surface >>> s = Surface(1, 'm^2') >>> s 1 m^2
Conversion from square meter to square millimeter with
inplace=Falseby default, so it does not override the current value.>>> s.to('mm^2') 1000000.0 mm^2 >>> s 1 m^2
Conversion from square meter to square millimeter with
inplace=True, in order to override the current value.>>> s.to('mm^2', inplace=True) 1000000.0 mm^2 >>> s 1000000.0 mm^2
- class Time(value: float | int, unit: str)¶
Bases:
UnitBaseTimeobject.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) Time¶
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¶
TimeConverted time.
Raises
Examples
Timeinstantiation.>>> from gearpy.units import Time >>> t = Time(1, 'hour') >>> t 1 hour
Conversion from hour to second with
inplace=Falseby default, so it does not override the current value.>>> t.to('sec') 3600.0 sec >>> t 1 hour
Conversion from hour to second with
inplace=True, in order to override the current value.>>> t.to('sec', inplace=True) 3600.0 sec >>> t 3600.0 sec
- class TimeInterval(value: float | int, unit: str)¶
Bases:
TimeTimeIntervalobject.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) TimeInterval¶
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¶
TimeIntervalConverted time interval.
Raises
Examples
TimeIntervalinstantiation.>>> from gearpy.units import TimeInterval >>> dt = TimeInterval(1, 'hour') >>> dt 1 hour
Conversion from hour to second with
inplace=Falseby default, so it does not override the current value.>>> dt.to('sec') 3600.0 sec >>> dt 1 hour
Conversion from hour to second with
inplace=True, in order to override the current value.>>> dt.to('sec', inplace=True) 3600.0 sec >>> dt 3600.0 sec
- class Torque(value: float | int, unit: str)¶
Bases:
UnitBaseTorqueobject.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) Torque¶
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¶
TorqueConverted torque.
Raises
Examples
Torqueinstantiation.>>> from gearpy.units import Torque >>> T = Torque(1, 'Nm') >>> T 1 Nm
Conversion from newton-meter to kilogram force-meter with
inplace=Falseby default, so it does not override the current value.>>> T.to('kgfm') 0.10197162129779283 kgfm >>> T 1 Nm
Conversion from newton-meter to kilogram force-meter with
inplace=True, in order to override the current value.>>> T.to('kgfm', inplace=True) 0.10197162129779283 kgfm >>> T 0.10197162129779283 kgfm
- property unit: str¶
Symbol of the unit of measurement for Torque. It must be a
str. Available units are:'Nm'for newton-meter,'mNm'for milli-newton-meter,'mNdm'for milli-newton-decimeter,'mNcm'for milli-newton-centimeter,'mNmm'for milli-newton-millimeter,'kNm'for kilo-newton-meter,'kNdm'for kilo-newton-decimeter,'kNcm'for kilo-newton-centimeter,'kNmm'for kilo-newton-millimeter,'kgfm'for kilogram force-meter,'kgfdm'for kilogram force-decimeter,'kgfcm'for kilogram force-centimeter,'kgfmm'for kilogram force-millimeter,'gfm'for gram force-meter,'gfdm'for gram force-decimeter,'gfcm'for gram force-centimeter,'gfmm'for gram force-millimeter.
Returns¶
strSymbol of the unit of measurement for torque.
- class UnitBase(value: float | int, unit: str)¶
Bases:
ABCUnitBaseobject.Abstract base class for creating unit objects.
See Also