![]() |
RoboidControl
|
A polar vector. More...
#include <Polar.h>
Public Member Functions | |
| Polar () | |
| A new vector with polar coordinates with zero degrees and distance. | |
| Polar (float distance, Angle angle) | |
| A new vector with polar coordinates. | |
| Polar (Vector2 v) | |
| Convert a vector from 2D carthesian coordinates to polar coordinates. | |
| Polar (Spherical s) | |
| Convert a vector from spherical coordinates to polar coordinates. | |
| bool | operator== (const Polar &v) const |
| Equality test to another vector. | |
| float | magnitude () const |
| The vector length. | |
| Polar | normalized () const |
| Convert the vector to a length of a. | |
| Polar | operator- () const |
| Negate the vector. | |
| Polar | operator- (const Polar &v) const |
| Subtract a polar vector from this vector. | |
| Polar | operator-= (const Polar &v) |
| Polar | operator+ (const Polar &v) const |
| Add a polar vector to this vector. | |
| Polar | operator+= (const Polar &v) |
| Polar | operator*= (float f) |
| Polar | operator/= (float f) |
Static Public Member Functions | |
| static float | Magnitude (const Polar &v) |
| The vector length. | |
| static Polar | Normalize (const Polar &v) |
| Convert the vector to a length of 1. | |
| static float | Distance (const Polar &v1, const Polar &v2) |
| The distance between two vectors. | |
| static Polar | Rotate (const Polar &v, Angle a) |
| Rotate a vector. | |
Public Attributes | |
| float | distance |
| The distance in meters. | |
| Angle | angle |
| The angle in degrees clockwise rotation. | |
Static Public Attributes | |
| static const Polar | zero = Polar(0.0f, 0.0f) |
| A polar vector with zero degrees and distance. | |
| static const Polar | forward = Polar(1.0f, 0.0f) |
| A normalized forward-oriented vector. | |
| static const Polar | back = Polar(1.0, 180.0f) |
| A normalized back-oriented vector. | |
| static const Polar | right = Polar(1.0, 90.0f) |
| A normalized right-oriented vector. | |
| static const Polar | left = Polar(1.0, -90.0f) |
| A normalized left-oriented vector. | |
Friends | |
| Polar | operator* (const Polar &v, float f) |
| Scale the vector uniformly up. | |
| Polar | operator* (float f, const Polar &v) |
| Polar | operator/ (const Polar &v, float f) |
| Scale the vector uniformly down. | |
| Polar | operator/ (float f, const Polar &v) |
A polar vector.
This will use the polar coordinate system consisting of a angle from a reference direction and a distance.
| Polar::Polar | ( | ) |
A new vector with polar coordinates with zero degrees and distance.
A new vector with polar coordinates.
| distance | The distance in meters |
| angle | The angle in degrees, clockwise rotation |
| Polar::Polar | ( | Vector2 | v | ) |
Convert a vector from 2D carthesian coordinates to polar coordinates.
| v | The vector to convert |
| Passer::LinearAlgebra::Polar::Polar | ( | Spherical | s | ) |
Convert a vector from spherical coordinates to polar coordinates.
| s | The vector to convert |
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 |
| Polar Polar::normalized | ( | ) | const |
Convert the vector to a length of a.
| Polar Polar::operator- | ( | ) | const |
Negate the vector.
Subtract a polar vector from this vector.
| v | The vector to subtract |
Add a polar vector to this vector.
| v | The vector to add |
The distance between two vectors.
| v1 | The first vector |
| v2 | The second vector |
Rotate a vector.
| v | The vector to rotate |
| a | The angle in degreesto rotate |
Scale the vector uniformly up.
| f | The scaling factor |
Scale the vector uniformly down.
| f | The scaling factor |
| float Passer::LinearAlgebra::Polar::distance |
The distance in meters.
| Angle Passer::LinearAlgebra::Polar::angle |
The angle in degrees clockwise rotation.