AngularPosition¶
- 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