RoboidControl
|
A spherical vector. More...
#include <Spherical.h>
Public Member Functions | |
Spherical () | |
Create a new spherical vector with zero degrees and distance. | |
Spherical (float distance, Angle horizontalAngle, Angle verticalAngle) | |
Create a new spherical vector. | |
Spherical (Polar polar) | |
Convert polar coordinates to spherical coordinates. | |
Spherical (Vector3 v) | |
Convert 3D carthesian coordinates to spherical coordinates. | |
bool | operator== (const Spherical &v) const |
Equality test to another vector. | |
float | magnitude () const |
The vector length. | |
Spherical | normalized () const |
Convert the vector to a length of a. | |
Spherical | operator- () const |
Negate the vector. | |
Spherical | operator*= (float f) |
Spherical | operator/= (float f) |
Static Public Member Functions | |
static float | Magnitude (const Spherical &v) |
The vector length. | |
static Spherical | Normalize (const Spherical &v) |
Convert the vector to a length of 1. | |
static Spherical | Rotate (const Spherical &v, Angle horizontalAngle, Angle verticalAngle) |
The distance between two vectors. | |
static Spherical | RotateHorizontal (const Spherical &v, Angle angle) |
static Spherical | RotateVertical (const Spherical &v, Angle angle) |
Public Attributes | |
float | distance |
The distance in meters. | |
Angle | horizontalAngle |
The angle in the horizontal plane in degrees, clockwise rotation. | |
Angle | verticalAngle |
The angle in the vertical plane in degrees. Positive is upward. | |
Static Public Attributes | |
static const Spherical | zero = Spherical(0.0f, 0.0f, 0.0f) |
A spherical vector with zero degree angles and distance. | |
static const Spherical | forward = Spherical(1.0f, 0.0f, 0.0f) |
A normalized forward-oriented vector. | |
static const Spherical | back = Spherical(1.0f, 180.0f, 0.0f) |
A normalized back-oriented vector. | |
static const Spherical | right = Spherical(1.0f, 90.0f, 0.0f) |
A normalized right-oriented vector. | |
static const Spherical | left = Spherical(1.0f, -90.0f, 0.0f) |
A normalized left-oriented vector. | |
static const Spherical | up = Spherical(1.0f, 0.0f, 90.0f) |
A normalized up-oriented vector. | |
static const Spherical | down = Spherical(1.0f, 0.0f, -90.0f) |
A normalized down-oriented vector. | |
Friends | |
Spherical | operator* (const Spherical &v, float f) |
Scale the vector uniformly up. | |
Spherical | operator* (float f, const Spherical &v) |
Spherical | operator/ (const Spherical &v, float f) |
Scale the vector uniformly down. | |
Spherical | operator/ (float f, const Spherical &v) |
A spherical vector.
This is a vector in 3D space using a spherical coordinate system. It consists of a distance and the polar and elevation angles from a reference direction. The reference direction is typically thought of as a forward direction.
Spherical::Spherical | ( | ) |
Create a new spherical vector with zero degrees and distance.
Create a new spherical vector.
distance | The distance in meters |
horizontalAngle | The angle in the horizontal plane in degrees, clockwise rotation |
verticalAngle | The angle in the vertical plan in degrees, zero is forward, positive is upward |
Spherical::Spherical | ( | Polar | polar | ) |
Convert polar coordinates to spherical coordinates.
polar | The polar coordinate |
Spherical::Spherical | ( | Vector3 | v | ) |
Convert 3D carthesian coordinates to spherical coordinates.
v | Vector in 3D carthesian coordinates; |
Equality test to another vector.
v | The vector to check against |
The vector length.
v | The vector for which you need the length |
|
inline |
The vector length.
Convert the vector to a length of 1.
v | The vector to convert |
Spherical Spherical::normalized | ( | ) | const |
Convert the vector to a length of a.
Spherical Spherical::operator- | ( | ) | const |
Negate the vector.
|
static |
The distance between two vectors.
v1 | The first vector |
v2 | The second vector |
Scale the vector uniformly up.
f | The scaling factor |
Scale the vector uniformly down.
f | The scaling factor |
float Passer::LinearAlgebra::Spherical::distance |
The distance in meters.
Angle Passer::LinearAlgebra::Spherical::horizontalAngle |
The angle in the horizontal plane in degrees, clockwise rotation.
The angle is automatically normalized to -180 .. 180
Angle Passer::LinearAlgebra::Spherical::verticalAngle |
The angle in the vertical plane in degrees. Positive is upward.
The angle is automatically normalized to -180 .. 180
A spherical vector with zero degree angles and distance.
A normalized forward-oriented vector.
A normalized back-oriented vector.
A normalized right-oriented vector.
A normalized left-oriented vector.
A normalized up-oriented vector.
A normalized down-oriented vector.