Skip to content

Angle

Canonical path: NemAll_Python_Geometry.Angle

Representation class for angle in [rad].

Deg property writable

Deg: float

Get angle as degree value.

Rad property writable

Rad: float

Get angle as radian value.

DegToRad staticmethod

DegToRad(angleDeg: float) -> float

Convert angle from deg to rad

Can be used for initialization of Angle class with deg angle.

angle = Angle(Angle.DegToRad(45)); // angle will be 0.75[rad] (approx.)

Parameters:

  • angleDeg (float) –

    Angle in deg

Returns:

  • float

    Angle in rad

FromDeg staticmethod

FromDeg(angleDeg: float) -> Angle

Parameters:

  • angleDeg (float) –

    Angle in degree

Returns:

Get

Get() -> float

Get angle as radian value.

Returns:

  • float

    double as radian value.

GetDeg

GetDeg() -> float

Get angle as degree value.

Returns:

  • float

    double as degree value.

Normalize2Pi

Normalize2Pi()

Normalize the angle to a range of <0, 2PI>.

This method is checked and set Angle to 0 while angle is out of range <-1e8, 1e8>. The algorithm isn't stable for angle out of this range.

NormalizePi

NormalizePi()

Normalize the angle to a range of <-PI, PI>.

This method is checked and set Angle to 0 while angle is out of range <-1e8, 1e8>. The algorithm isn't stable for angle out of this range.

RadToDeg staticmethod

RadToDeg(angleRad: float) -> float

Convert angle from rad to deg

Parameters:

  • angleRad (float) –

    Angle in rad

Returns:

  • float

    Angle in rad

RadToGrad staticmethod

RadToGrad(angleRad: float) -> float

Convert angle from rad to grad

Parameters:

  • angleRad (float) –

    Angle in rad

Returns:

  • float

    Angle in grad

Set overloaded

Set(angle: float)

Set angle as radian value.

Parameters:

  • angle (float) –

    angle which will be set.

Set(angle: Angle)

Set angle as radian value.

Parameters:

  • angle (Angle) –

    angle which will be set.

SetDeg

SetDeg(angleDeg: float)

Set angle as degree value.

Parameters:

  • angleDeg (float) –

    angle as degree value which will be set.

__add__ overloaded

__add__(angle: Angle) -> Angle

Addition operator

Parameters:

  • angle (Angle) –

    Angle which will be added

Returns:

__add__(angle: float) -> Angle

Addition operator

Parameters:

  • angle (float) –

    Angle as double value which will be added

Returns:

__eq__

__eq__(angle: Angle) -> bool

Comparison of angles.

Be careful, this method work without tolerance!

Parameters:

  • angle (Angle) –

    angle to be compared.

Returns:

  • bool

    True when angles are equal, otherwise false.

__float__

__float__() -> float

Type conversion operator.

Returns:

  • float

    Angle as double.

__iadd__

__iadd__(angle: Angle) -> Angle

Addition assignment operator.

Parameters:

  • angle (Angle) –

    Angle which will be added.

Returns:

  • Angle

    Reference to Angle.

__init__ overloaded

__init__()

Initialize

__init__(angle: Angle)

Copy constructor.

Parameters:

  • angle (Angle) –

    angle which will be copied.

__init__(angle: float)

Constructor.

Initialize angle from single value

Parameters:

  • angle (float) –

    Angle.

__isub__

__isub__(angle: Angle) -> Angle

Addition assignment operator.

Parameters:

  • angle (Angle) –

    Angle which will be added.

Returns:

  • Angle

    Reference to Angle.

__ne__

__ne__(angle: Angle) -> bool

Comparison of angles.

Be careful, this method work without tolerance!

Parameters:

  • angle (Angle) –

    angle to be compared.

Returns:

  • bool

    True when angles are not equal, otherwise false.

__repr__

__repr__() -> str

Convert to string

Placeholder