simplevectors
0.3.9
Simple vector implementations in C++
|
A minimal 3D vector representation. More...
#include <embed.hpp>
Public Member Functions | |
Vec3D () | |
No-argument constructor. More... | |
Vec3D (const double xOther, const double yOther, const double zOther) | |
Initializes a vector given xyz components. More... | |
Vec3D (const Vec3D &other)=default | |
Copy constructor. | |
Vec3D (Vec3D &&) noexcept=default | |
Move constructor. More... | |
Vec3D & | operator= (const Vec3D &other) |
Assignment operator. | |
Vec3D & | operator= (Vec3D &&) noexcept=default |
Move assignment operator. More... | |
virtual | ~Vec3D ()=default |
Destructor. More... | |
Vec3D & | operator+= (const Vec3D &other) |
In-place addtion. More... | |
Vec3D & | operator-= (const Vec3D &other) |
In-place subtraction. More... | |
Vec3D & | operator*= (const double &other) |
In-place scalar multiplication. More... | |
Vec3D & | operator/= (const double &other) |
In-place scalar division. More... | |
Public Attributes | |
double | x |
The x-component of the 3D vector. | |
double | y |
The y-component of the 3D vector. | |
double | z |
The z-component of the 3D vector. | |
A minimal 3D vector representation.
|
inline |
No-argument constructor.
Initializes a zero vector.
|
inline |
Initializes a vector given xyz components.
xOther | The x-component. |
yOther | The y-component. |
zOther | The z-component. |
|
defaultnoexcept |
Move constructor.
Uses C++ default move constructor.
|
virtualdefault |
Destructor.
Uses C++ default destructor.
|
inline |
In-place scalar multiplication.
Performs scalar multiplication on the current object.
other | The number to multiply by. |
In-place addtion.
Adds another vector object to current vector.
other | The other object to add. |
In-place subtraction.
Subtracts another vector object from current vector.
other | The other object to subtract. |
|
inline |
In-place scalar division.
Performs scalar division on the current object.
other | The number to divide by. |
Move assignment operator.
Uses C++ default move assignment operator.