Class DistanceVector
Represents a 3D distance vector. More...
#include <spatial.h>
Inherits the following classes: FixedVector3D
Public Types
| Type | Name |
|---|---|
| typedef FixedVector3D< DistanceVector > | Vec |
Public Types inherited from FixedVector3D
See FixedVector3D
| Type | Name |
|---|---|
| typedef Vector3D< fixed, Derived > | Vec |
Public Types inherited from Vector3D
See Vector3D
| Type | Name |
|---|---|
| typedef Either< Derived, Vector3D< NumericType > > | ClassType |
| typedef Numeric | NumericType |
Public Attributes inherited from Vector3D
See Vector3D
| Type | Name |
|---|---|
| NumericType | X_coord = 0The X-coordinate of the vector. |
| NumericType | Y_coord = 0The Y-coordinate of the vector. |
| NumericType | Z_coord = 0The Z-coordinate of the vector. |
Public Static Attributes inherited from Vector3D
See Vector3D
| Type | Name |
|---|---|
| constexpr Vector3D< Numeric > | Backward = [**Vector3D**](classVector3D.md)<Numeric>(0, -1, 0) |
| constexpr Vector3D< Numeric > | Down = [**Vector3D**](classVector3D.md)<Numeric>(0, 0, -1) |
| constexpr Vector3D< Numeric > | Forward = [**Vector3D**](classVector3D.md)<Numeric>(0, 1, 0) |
| constexpr Vector3D< Numeric > | Left = [**Vector3D**](classVector3D.md)<Numeric>(-1, 0, 0) |
| constexpr Vector3D< Numeric > | Right = [**Vector3D**](classVector3D.md)<Numeric>(1, 0, 0) |
| constexpr Vector3D< Numeric > | Up = [**Vector3D**](classVector3D.md)<Numeric>(0, 0, 1) |
| constexpr NumericType | rad2DegFactor = NumericType(57.2957795131) |
Public Functions
| Type | Name |
|---|---|
| DistanceVector () = default |
|
| DistanceVector (const DistanceVector & other) = default |
|
| constexpr | DistanceVector (fixed x, fixed y, fixed z) |
| DistanceVector (VelocityVector v, ChronoDuration auto interval) Constructs a DistanceVector from aVelocityVector and a time interval. |
Public Functions inherited from FixedVector3D
See FixedVector3D
| Type | Name |
|---|---|
| fixed | angleTo (const VectorCompatible< fixed > auto & other) const |
| Derived | cross (const VectorCompatible< fixed > auto & other) const |
| fixed | dot (const VectorCompatible< fixed > auto & other) const |
| fixed | magnitude () const |
| fixed | magnitudeXY () const |
| fixed | magnitudeXZ () const |
| fixed | magnitudeYZ () const |
| Derived | normalize () const |
| NumericType | pitch () const |
| NumericType | yaw () const |
Public Functions inherited from Vector3D
See Vector3D
| Type | Name |
|---|---|
| constexpr ClassType | FromPolarDegrees (NumericType Pitch, NumericType Yaw, NumericType Radius) |
| constexpr | Vector3D () |
| constexpr | Vector3D (NumericType initial_X_coord, NumericType initial_Y_coord, NumericType initial_Z_coord) |
| NumericType | angleTo (const VectorCompatible< NumericType > auto & other) const Computes the angle to another vector. |
| ClassType | cross (const VectorCompatible< NumericType > auto & other) const Computes the cross product of two vectors. |
| NumericType | dot (const VectorCompatible< NumericType > auto & other) const Computes the dot product of two vectors. |
| NumericType | magnitude () const Computes the magnitude (length) of the vector. |
| NumericType | magnitudeXY () const Computes the magnitude in the XY plane. |
| NumericType | magnitudeXZ () const Computes the magnitude in the XZ plane. |
| NumericType | magnitudeYZ () const Computes the magnitude in the YZ plane. |
| ClassType | normalize () const Computes the normalized vector (unit vector). |
| operator bool () const Checks if the vector is non-zero. |
|
| constexpr ClassType | operator* (const NumericType & scalar) const Multiplies the vector by a scalar. |
| ClassType | operator+ (const VectorCompatible< NumericType > auto & other) const Adds two vectors. |
| ClassType | operator- (const VectorCompatible< NumericType > auto & other) const Subtracts one vector from another. |
| ClassType | operator/ (NumericType scalar) const Divides the vector by a scalar. |
| NumericType | pitch () const Computes the pitch angle of the vector. |
| NumericType | yaw () const Computes the yaw angle of the vector. |
Public Static Functions inherited from FixedVector3D
See FixedVector3D
| Type | Name |
|---|---|
| fixed | integer_sqrt (uint64_t n) |
Detailed Description
This class is used to define a displacement in 3D space.
Public Types Documentation
typedef Vec
using DistanceVector::Vec = FixedVector3D<DistanceVector>;
Public Functions Documentation
function DistanceVector [1/4]
DistanceVector::DistanceVector () = default
function DistanceVector [2/4]
DistanceVector::DistanceVector (
const DistanceVector & other
) = default
function DistanceVector [3/4]
constexpr DistanceVector::DistanceVector (
fixed x,
fixed y,
fixed z
)
function DistanceVector [4/4]
Constructs a DistanceVector from aVelocityVector and a time interval.
inline DistanceVector::DistanceVector (
VelocityVector v,
ChronoDuration auto interval
)
Parameters:
vThe velocity vector.intervalThe time interval.
The documentation for this class was generated from the following file spatial.h