The U4DVector2n class is in charge of implementing a 2D vector representation. The class contains several linear algebra operations such as addition, subtraction, scalar multiplication, dot product, etc.
More...
|
float | x |
| x-component
|
|
float | y |
| y-component
|
|
The U4DVector2n class is in charge of implementing a 2D vector representation. The class contains several linear algebra operations such as addition, subtraction, scalar multiplication, dot product, etc.
◆ dot()
float U4DEngine::U4DVector2n::dot |
( |
const U4DVector2n & |
v | ) |
const |
Method which computes the dot product between two 2D vectors.
- Parameters
-
v | 2D vector to compute dot product with |
- Returns
- Returns the dot product between two 2D vectors
◆ magnitude()
float U4DEngine::U4DVector2n::magnitude |
( |
| ) |
|
Method which computes the magnitude (distance) of the 2D vector.
- Returns
- Returns the magnitude of the 2D vector
◆ operator*() [1/2]
U4DVector2n U4DEngine::U4DVector2n::operator* |
( |
const float |
s | ) |
const |
Method that multiplies a 2D vector by a scalar.
- Parameters
-
s | Scalar value to multiply |
- Returns
- Returns the product of a 2D vector by a scalar
◆ operator*() [2/2]
float U4DEngine::U4DVector2n::operator* |
( |
const U4DVector2n & |
v | ) |
const |
Method which computes the dot product between two 2D vectors.
- Parameters
-
v | 2D vector to compute dot product with |
- Returns
- Returns the dot product between two 2D vectors
◆ operator*=()
void U4DEngine::U4DVector2n::operator*= |
( |
const float |
s | ) |
|
Method that multiplies a 2D vector by a scalar.
- Parameters
-
s | Scalar value to multiply |
- Returns
- Returns the product of a 2D vector by a scalar
◆ operator+()
Method that adds two 2D vectors.
- Parameters
-
- Returns
- Returns the addition of two 2D vectors
◆ operator+=()
void U4DEngine::U4DVector2n::operator+= |
( |
const U4DVector2n & |
v | ) |
|
Method that adds two 2D vectors.
- Parameters
-
- Returns
- Returns the addition of two 2D vectors
◆ operator-()
Method that subtracts two 2D vectors.
- Parameters
-
- Returns
- Returns the difference between two 2D vectors
◆ operator-=()
void U4DEngine::U4DVector2n::operator-= |
( |
const U4DVector2n & |
v | ) |
|
Method that subtracts two 2D vectors.
- Parameters
-
- Returns
- Returns the difference between two 2D vectors
◆ operator/()
U4DVector2n U4DEngine::U4DVector2n::operator/ |
( |
const float |
s | ) |
const |
Method that divides a 2D vector by a scalar.
- Parameters
-
- Returns
- Returns the division of a 2D vector by a scalar
◆ operator/=()
void U4DEngine::U4DVector2n::operator/= |
( |
const float |
s | ) |
|
Method that divides a 2D vector by a scalar.
- Parameters
-
- Returns
- Returns the division of a 2D vector by a scalar
◆ operator=()
Copy constructor for the 2D vector class.
- Parameters
-
- Returns
- Returns a copy of the 2D vector
◆ squareMagnitude()
float U4DEngine::U4DVector2n::squareMagnitude |
( |
| ) |
|
Method which computes the square magnitude of the 2D vector.
- Returns
- Returns the square magnitude of the 2D vector. That is, it does not compute the square root of the magnitude