Angle
Canonical path: NemAll_Python_Geometry.Angle
Representation class for angle in [rad].
DegToRad
staticmethod
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
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
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
Convert angle from rad to deg
Parameters:
-
angleRad
(float
) –Angle in rad
Returns:
-
float
–Angle in rad
RadToGrad
staticmethod
Convert angle from rad to grad
Parameters:
-
angleRad
(float
) –Angle in rad
Returns:
-
float
–Angle in grad
Set
overloaded
SetDeg
Set angle as degree value.
Parameters:
-
angleDeg
(float
) –angle as degree value which will be set.
__add__
overloaded
__add__(angle: float) -> Angle
Addition operator
Parameters:
-
angle
(float
) –Angle as double value which will be added
Returns:
-
Angle
–New angle
__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.
__iadd__
__init__
overloaded
Initialize
__init__(angle: Angle)
Constructor.
Initialize angle from single value
Parameters:
-
angle
(float
) –Angle.