A direction using angles.
- The horizontal angle ranging from -180 (inclusive) to 180 (exclusive) degrees which is a rotation in the horizontal plane
- A vertical angle ranging from -90 (inclusive) to 90 (exclusive) degrees which is the rotation in the up/down direction applied after the horizontal rotation has been applied. The angles are automatically normalized to stay within the abovenmentioned ranges.
|
| __init__ (self, horizontal=Angle(), vertical=Angle()) |
| Create a new direction.
|
|
| FromVector3 (Vector3 v) |
|
Vector3 | ToVector3 (self) |
| Convert the direction to a Vector3 coordinate.
|
|
| __eq__ (self, direction) |
| Test whether this direction is equal to another direction.
|
|
| __neg__ (self) |
| Negate/reverse the direction.
|
|
| Inverse (self) |
| This is a synonym for negation.
|
|
| Normalize (self) |
| Normalize this vector to the specified ranges.
|
|
| __repr__ (self) |
|
| __init__ (self, horizontal=Angle(), vertical=Angle()) |
| Create a new direction.
|
|
| FromVector3 (Vector3 v) |
|
Vector3 | ToVector3 (self) |
| Convert the direction to a Vector3 coordinate.
|
|
| __eq__ (self, direction) |
| Test whether this direction is equal to another direction.
|
|
| isclose (self, other, rel_tol=1e-9, abs_tol=1e-8) |
|
| __neg__ (self) |
| Negate/reverse the direction.
|
|
| Inverse (self) |
| This is a synonym for negation.
|
|
| Normalize (self) |
| Normalize this vector to the specified ranges.
|
|
| __repr__ (self) |
|
|
| Degrees (float horizontal, float vertical) |
| Create a direction using angle values in degrees.
|
|
| Radians (float horizontal, float vertical) |
| Create a direction using angle values in radians.
|
|
| Degrees (float horizontal, float vertical) |
| Create a direction using angle values in degrees.
|
|
| Radians (float horizontal, float vertical) |
| Create a direction using angle values in radians.
|
|
|
| zero |
|
| forward |
|
| backward |
|
| up |
|
| down |
|
| left |
|
| right |
|
◆ __init__() [1/2]
__init__ |
( |
|
self, |
|
|
|
horizontal = Angle() , |
|
|
|
vertical = Angle() |
|
) |
| |
Create a new direction.
- Parameters
-
horizontal | The horizontal angle |
vertical | The vertical angle. |
◆ __init__() [2/2]
__init__ |
( |
|
self, |
|
|
|
horizontal = Angle() , |
|
|
|
vertical = Angle() |
|
) |
| |
Create a new direction.
- Parameters
-
horizontal | The horizontal angle |
vertical | The vertical angle. |
◆ Degrees() [1/2]
Degrees |
( |
float |
horizontal, |
|
|
float |
vertical |
|
) |
| |
|
static |
Create a direction using angle values in degrees.
- Parameters
-
horizontal | The horizontal angle in degrees |
vertical | The vertical angle in degrees |
- Returns
- The direction
◆ Radians() [1/2]
Radians |
( |
float |
horizontal, |
|
|
float |
vertical |
|
) |
| |
|
static |
Create a direction using angle values in radians.
- Parameters
-
horizontal | The horizontal angle in radians |
vertical | The vertical angle in radians |
- Returns
- The direction
◆ ToVector3() [1/2]
Vector3 ToVector3 |
( |
|
self | ) |
|
Convert the direction to a Vector3 coordinate.
- Returns
- The vector coordinate
◆ __eq__() [1/2]
__eq__ |
( |
|
self, |
|
|
|
direction |
|
) |
| |
Test whether this direction is equal to another direction.
- Parameters
-
direction | The direction to compare to |
- Returns
- True when the direction angles are equal, false otherwise.
◆ __neg__() [1/2]
Negate/reverse the direction.
- Returns
- The reversed direction.
◆ Normalize() [1/2]
Normalize this vector to the specified ranges.
- Note
- Should not be needed but available in case it is.
◆ Degrees() [2/2]
Degrees |
( |
float |
horizontal, |
|
|
float |
vertical |
|
) |
| |
|
static |
Create a direction using angle values in degrees.
- Parameters
-
horizontal | The horizontal angle in degrees |
vertical | The vertical angle in degrees |
- Returns
- The direction
◆ Radians() [2/2]
Radians |
( |
float |
horizontal, |
|
|
float |
vertical |
|
) |
| |
|
static |
Create a direction using angle values in radians.
- Parameters
-
horizontal | The horizontal angle in radians |
vertical | The vertical angle in radians |
- Returns
- The direction
◆ ToVector3() [2/2]
Vector3 ToVector3 |
( |
|
self | ) |
|
Convert the direction to a Vector3 coordinate.
- Returns
- The vector coordinate
◆ __eq__() [2/2]
__eq__ |
( |
|
self, |
|
|
|
direction |
|
) |
| |
Test whether this direction is equal to another direction.
- Parameters
-
direction | The direction to compare to |
- Returns
- True when the direction angles are equal, false otherwise.
◆ __neg__() [2/2]
Negate/reverse the direction.
- Returns
- The reversed direction.
◆ Normalize() [2/2]
Normalize this vector to the specified ranges.
- Note
- Should not be needed but available in case it is.
The documentation for this class was generated from the following files:
- d:/Python/RoboidControl/RoboidControl/LinearAlgebra/build/lib/LinearAlgebra/Direction.py
- d:/Python/RoboidControl/RoboidControl/LinearAlgebra/LinearAlgebra/Direction.py