simplevectors
0.3.9
Simple vector implementations in C++
|
A minimal 2D vector representation. More...
#include <embed.hpp>
Public Member Functions | |
Vec2D () | |
No-argument constructor. More... | |
Vec2D (const double xOther, const double yOther) | |
Initializes a vector given xy components. More... | |
Vec2D (const Vec2D &other)=default | |
Copy constructor. | |
Vec2D (Vec2D &&) noexcept=default | |
Move constructor. More... | |
Vec2D & | operator= (const Vec2D &other) |
Assignment operator. | |
Vec2D & | operator= (Vec2D &&) noexcept=default |
Move assignment operator. More... | |
virtual | ~Vec2D ()=default |
Destructor. More... | |
Vec2D & | operator+= (const Vec2D &other) |
In-place addtion. More... | |
Vec2D & | operator-= (const Vec2D &other) |
In-place subtraction. More... | |
Vec2D & | operator*= (const double &other) |
In-place scalar multiplication. More... | |
Vec2D & | operator/= (const double &other) |
In-place scalar division. More... | |
Public Attributes | |
double | x |
The x-component of the 2D vector. | |
double | y |
The y-component of the 2D vector. | |
A minimal 2D vector representation.
|
inline |
No-argument constructor.
Initializes a zero vector.
|
inline |
Initializes a vector given xy components.
xOther | The x-component. |
yOther | The y-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.