11namespace LinearAlgebra {
157using namespace Passer::LinearAlgebra;
159#include "Spherical.h"
An angle in various representations.
Definition Angle.h:21
A polar vector using an angle in various representations.
Definition Polar.h:18
static PolarOf< T > FromSpherical(SphericalOf< T > v)
Convert a vector from spherical coordinates to polar coordinates.
Definition Polar.cpp:44
friend PolarOf operator*(const PolarOf &v, float f)
Scale the vector uniformly up.
Definition Polar.h:118
AngleOf< T > angle
The angle in degrees clockwise rotation.
Definition Polar.h:25
static const PolarOf zero
A polar vector with zero degrees and distance.
Definition Polar.h:64
static const PolarOf back
A normalized back-oriented vector.
Definition Polar.h:68
static PolarOf Normalize(const PolarOf &v)
Convert the vector to a length of 1.
Definition Polar.cpp:68
static constexpr auto Rad
Short-hand Rad alias for the Radians function.
Definition Polar.h:52
static PolarOf< T > Radians(float distance, float radians)
Create polar vector without using AngleOf type. All given angles are in radians.
Definition Polar.cpp:33
static const PolarOf right
A normalized right-oriented vector.
Definition Polar.h:70
float magnitude() const
The vector length.
Definition Polar.h:87
PolarOf operator+(const PolarOf &v) const
Add a polar vector to this vector.
Definition Polar.cpp:108
static const PolarOf forward
A normalized forward-oriented vector.
Definition Polar.h:66
static const PolarOf left
A normalized left-oriented vector.
Definition Polar.h:72
friend PolarOf operator/(const PolarOf &v, float f)
Scale the vector uniformly down.
Definition Polar.h:130
PolarOf()
A new vector with polar coordinates with zero degrees and distance.
Definition Polar.cpp:6
static PolarOf Rotate(const PolarOf &v, AngleOf< T > a)
Rotate a vector.
Definition Polar.cpp:158
static PolarOf< T > FromVector2(Vector2 v)
Convert a vector from 2D carthesian coordinates to polar coordinates.
Definition Polar.cpp:37
bool operator==(const PolarOf &v) const
Equality test to another vector.
Definition Polar.cpp:63
static constexpr auto Deg
Short-hand Deg alias for the Degrees function.
Definition Polar.h:44
float distance
The distance in meters.
Definition Polar.h:22
static float Distance(const PolarOf &v1, const PolarOf &v2)
The distance between two vectors.
Definition Polar.cpp:151
PolarOf operator-() const
Negate the vector.
Definition Polar.cpp:77
static PolarOf< T > Degrees(float distance, float degrees)
Create polar vector without using AngleOf type. All given angles are in degrees.
Definition Polar.cpp:26
static float Magnitude(const PolarOf &v)
The vector length.
Definition Polar.h:84
PolarOf normalized() const
Convert the vector to a length of a.
Definition Polar.cpp:72
A spherical vector using angles in various representations.
Definition Spherical.h:18
A 2-dimensional vector.
Definition Vector2.h:38