A 2D Vector class.
More...
#include <vector2.h>
|
double | x |
| The x component of the vector.
|
|
double | y |
| The y component of the vector.
|
|
◆ Vector2()
Axle::Math::Vector2::Vector2 |
( |
double | x, |
|
|
double | y ) |
Construct a new Vector2 object with the given x and y values.
- Parameters
-
x | The x component of the vector |
y | The y component of the vector |
◆ operator!=()
bool Axle::Math::Vector2::operator!= |
( |
const Vector2 & | other | ) |
const |
Operator overload for inequality.
- Parameters
-
other | The other vector to compare |
- Returns
- true If the vectors are not equal
-
false If the vectors are equal
◆ operator*()
Vector2 Axle::Math::Vector2::operator* |
( |
double | scalar | ) |
const |
Operator overload for scalar multiplication.
- Parameters
-
scalar | The scalar to multiply by |
- Returns
- Vector2 The result of the multiplication
◆ operator*=()
Vector2 & Axle::Math::Vector2::operator*= |
( |
double | scalar | ) |
|
Operator overload for scalar multiplication assignment.
- Parameters
-
scalar | The scalar to multiply by |
- Returns
- Vector2& The result of the multiplication
◆ operator+()
Operator overload for addition.
- Parameters
-
other | The other vector to add |
- Returns
- Vector2 The result of the addition
◆ operator+=()
Operator overload for addition assignment.
- Parameters
-
other | The other vector to add |
- Returns
- Vector2& The result of the addition
◆ operator-() [1/2]
Vector2 Axle::Math::Vector2::operator- |
( |
| ) |
const |
Operator overload for negation.
- Returns
- Vector2 The negated vector
◆ operator-() [2/2]
Operator overload for subtraction.
- Parameters
-
other | The other vector to subtract |
- Returns
- Vector2 The result of the subtraction
◆ operator-=()
Operator overload for subtraction assignment.
- Parameters
-
other | The other vector to subtract |
- Returns
- Vector2& The result of the subtraction
◆ operator/()
Vector2 Axle::Math::Vector2::operator/ |
( |
double | scalar | ) |
const |
Operator overload for scalar division.
- Parameters
-
scalar | The scalar to divide by |
- Returns
- Vector2 The result of the division
◆ operator/=()
Vector2 & Axle::Math::Vector2::operator/= |
( |
double | scalar | ) |
|
Operator overload for scalar division assignment.
- Parameters
-
scalar | The scalar to divide by |
- Returns
- Vector2& The result of the division
◆ operator==()
bool Axle::Math::Vector2::operator== |
( |
const Vector2 & | other | ) |
const |
Operator overload for equality.
- Parameters
-
other | The other vector to compare |
- Returns
- true If the vectors are equal
-
false If the vectors are not equal
The documentation for this class was generated from the following files:
- axle/include/vector2.h
- axle/src/math/vector2.cpp