2D vector of doubles.
More...
#include <aeongui/Vector2.hpp>
2D vector of doubles.
Provides basic 2D vector arithmetic including addition, subtraction, scalar and component-wise multiplication, division, and transformation by a Matrix2x3.
◆ Vector2()
| AeonGUI::Vector2::Vector2 |
( |
double | aX, |
|
|
double | aY ) |
Construct from X and Y components.
- Parameters
-
| aX | The X component. |
| aY | The Y component. |
◆ GetX()
| double AeonGUI::Vector2::GetX |
( |
| ) |
const |
Get the X component.
- Returns
- The X value.
◆ GetY()
| double AeonGUI::Vector2::GetY |
( |
| ) |
const |
Get the Y component.
- Returns
- The Y value.
◆ Length()
| double AeonGUI::Vector2::Length |
( |
| ) |
const |
Get the length (magnitude) of the vector.
- Returns
- The length.
◆ operator*=() [1/3]
Transform by a Matrix2x3 in-place.
- Parameters
-
| aRight | The matrix to multiply by. |
- Returns
- Reference to this.
◆ operator*=() [2/3]
Component-wise multiply in-place.
- Parameters
-
| aRight | The vector to multiply by. |
- Returns
- Reference to this.
◆ operator*=() [3/3]
| Vector2 & AeonGUI::Vector2::operator*= |
( |
double | aRight | ) |
|
Scalar multiply in-place.
- Parameters
-
| aRight | The scalar to multiply by. |
- Returns
- Reference to this.
◆ operator+=()
Add another vector in-place.
- Parameters
-
- Returns
- Reference to this.
◆ operator-=()
Subtract another vector in-place.
- Parameters
-
| aRight | The vector to subtract. |
- Returns
- Reference to this.
◆ operator/=()
| Vector2 & AeonGUI::Vector2::operator/= |
( |
double | aRight | ) |
|
Scalar divide in-place.
- Parameters
-
| aRight | The scalar to divide by. |
- Returns
- Reference to this.
◆ operator[]() [1/2]
| double & AeonGUI::Vector2::operator[] |
( |
std::size_t | aIndex | ) |
|
Access a component by index.
- Parameters
-
- Returns
- Reference to the component.
◆ operator[]() [2/2]
| const double & AeonGUI::Vector2::operator[] |
( |
std::size_t | aIndex | ) |
const |
Access a component by index (const).
- Parameters
-
- Returns
- Const reference to the component.
◆ SetX()
| void AeonGUI::Vector2::SetX |
( |
double | aX | ) |
|
Set the X component.
- Parameters
-
◆ SetY()
| void AeonGUI::Vector2::SetY |
( |
double | aY | ) |
|
Set the Y component.
- Parameters
-
The documentation for this class was generated from the following files: