11namespace LinearAlgebra {
14template <
typename T>
class PolarOf;
54 constexpr static auto Rad =
Radians;
185using namespace Passer::LinearAlgebra;
An angle in various representations.
Definition Angle.h:21
A polar vector using an angle in various representations.
Definition Polar.h:18
A spherical vector using angles in various representations.
Definition Spherical.h:18
static SphericalOf< T > RotateHorizontal(const SphericalOf< T > &v, AngleOf< T > angle)
Rotate a spherical vector horizontally.
Definition Spherical.cpp:279
static const SphericalOf< T > down
A normalized down-oriented vector.
Definition Spherical.h:82
static const SphericalOf< T > up
A normalized up-oriented vector.
Definition Spherical.h:80
static const SphericalOf< T > back
A normalized back-oriented vector.
Definition Spherical.h:74
SphericalOf< T > operator-() const
Negate the vector.
Definition Spherical.cpp:129
static const SphericalOf< T > forward
A normalized forward-oriented vector.
Definition Spherical.h:72
static SphericalOf< T > Degrees(float distance, float horizontal, float vertical)
Create spherical vector without using AngleOf type. All given angles are in degrees.
Definition Spherical.cpp:37
static SphericalOf< T > Rotate(const SphericalOf &v, AngleOf< T > horizontalAngle, AngleOf< T > verticalAngle)
Rotate a spherical vector.
Definition Spherical.cpp:270
static AngleOf< T > AngleBetween(const SphericalOf< T > &v1, const SphericalOf< T > &v2)
Calculate the unsigned angle between two spherical vectors.
Definition Spherical.cpp:239
static SphericalOf< T > Radians(float distance, float horizontal, float vertical)
Create sperical vector without using the AngleOf type. All given angles are in radians.
Definition Spherical.cpp:46
static SphericalOf< T > FromPolar(PolarOf< T > v)
Create a Spherical coordinate from a Polar coordinate.
Definition Spherical.cpp:53
DirectionOf< T > direction
The angle in the horizontal plane in degrees, clockwise rotation.
Definition Spherical.h:29
Vector3 ToVector3() const
Convert the spherical coordinate to a Vector3 coordinate.
Definition Spherical.cpp:84
friend SphericalOf< T > operator*(const SphericalOf< T > &v, float f)
Scale the vector uniformly up.
Definition Spherical.h:111
static SphericalOf< T > FromVector3(Vector3 v)
Create a Spherical coordinate from a Vector3 coordinate.
Definition Spherical.cpp:60
SphericalOf< T > operator+(const SphericalOf< T > &v) const
Add a spherical vector to this vector.
Definition Spherical.cpp:152
float distance
The distance in meters.
Definition Spherical.h:22
static const SphericalOf< T > zero
A spherical vector with zero degree angles and distance.
Definition Spherical.h:70
friend SphericalOf< T > operator/(const SphericalOf< T > &v, float f)
Scale the vector uniformly down.
Definition Spherical.h:123
static float DistanceBetween(const SphericalOf< T > &v1, const SphericalOf< T > &v2)
Calculate the distance between two spherical coordinates.
Definition Spherical.cpp:228
static AngleOf< T > SignedAngleBetween(const SphericalOf< T > &v1, const SphericalOf< T > &v2, const SphericalOf< T > &axis)
Calculate the signed angle between two spherical vectors.
Definition Spherical.cpp:259
static SphericalOf< T > RotateVertical(const SphericalOf< T > &v, AngleOf< T > angle)
Rotate a spherical vector vertically.
Definition Spherical.cpp:286
static const SphericalOf< T > right
A normalized right-oriented vector.
Definition Spherical.h:76
SphericalOf< T > operator-(const SphericalOf< T > &v) const
Subtract a spherical vector from this vector.
SphericalOf< T > WithDistance(float distance)
Update the distance component of the spherical coordinate.
Definition Spherical.cpp:124
static const SphericalOf< T > left
A normalized left-oriented vector.
Definition Spherical.h:78
static constexpr auto Deg
Short-hand Deg alias for the Degrees function.
Definition Spherical.h:44
A 3-dimensional vector.
Definition Vector3.h:42