A vector in two dimensions.
More...
#include <Vector2.h>
|
(Note that these are not member functions.)
|
AVO_EXPORT float | abs (const Vector2 &vector) |
| Computes the length of a specified vector. More...
|
|
AVO_EXPORT float | absSq (const Vector2 &vector) |
| Computes the squared length of a specified vector. More...
|
|
AVO_EXPORT float | det (const Vector2 &vector1, const Vector2 &vector2) |
| Computes the determinant of a square matrix with rows consisting of the specified vectors. More...
|
|
AVO_EXPORT Vector2 | normalize (const Vector2 &vector) |
| Computes the normalization of a specified vector. More...
|
|
AVO_EXPORT Vector2 | operator* (float scalar, const Vector2 &vector) |
| Computes the scalar multiplication of the specified vector with the specified scalar value. More...
|
|
AVO_EXPORT std::ostream & | operator<< (std::ostream &stream, const Vector2 &vector) |
| Inserts the specified two-dimensional vector into the specified output stream. More...
|
|
A vector in two dimensions.
◆ Vector2()
AVO::Vector2::Vector2 |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
[in] | x | The x-coordinate of the vector. |
[in] | y | The y-coordinate of the vector. |
◆ getX()
float AVO::Vector2::getX |
( |
| ) |
const |
|
inline |
Returns the x-coordinate of this vector.
- Returns
- The x-coordinate of the vector.
◆ getY()
float AVO::Vector2::getY |
( |
| ) |
const |
|
inline |
Returns the y-coordinate of this vector.
- Returns
- The y-coordinate of the vector.
◆ operator!=()
bool AVO::Vector2::operator!= |
( |
const Vector2 & |
other | ) |
const |
|
inline |
Tests this vector for inequality with the specified vector.
- Parameters
-
[in] | other | The vector with which to test for inequality |
- Returns
- True if the vectors are not equal.
◆ operator*() [1/2]
float AVO::Vector2::operator* |
( |
const Vector2 & |
other | ) |
const |
|
inline |
Computes the dot product of this vector with the specified vector.
- Parameters
-
[in] | other | The vector with which the dot product should be computed. |
- Returns
- The dot product of this vector with a specified vector.
◆ operator*() [2/2]
Vector2 AVO::Vector2::operator* |
( |
float |
scalar | ) |
const |
|
inline |
Computes the scalar multiplication of this vector with the specified scalar value.
- Parameters
-
[in] | scalar | The scalar value with which the scalar multiplication should be computed. |
- Returns
- The scalar multiplication of this vector with a specified scalar value.
◆ operator*=()
Vector2& AVO::Vector2::operator*= |
( |
float |
scalar | ) |
|
|
inline |
Sets the value of this vector to the scalar multiplication of itself with the specified scalar value.
- Parameters
-
[in] | scalar | The scalar value with which the scalar multiplication should be computed. |
- Returns
- A reference to this vector.
◆ operator+()
Computes the vector sum of this vector with the specified vector.
- Parameters
-
[in] | other | The vector with which the vector sum should be computed. |
- Returns
- The vector sum of this vector with a specified vector.
◆ operator+=()
Sets the value of this vector to the vector sum of itself with the specified vector.
- Parameters
-
[in] | other | The vector with which the vector sum should be computed. |
- Returns
- A reference to this vector.
◆ operator-() [1/2]
Vector2 AVO::Vector2::operator- |
( |
| ) |
const |
|
inline |
Computes the negation of this vector.
- Returns
- The negation of this vector.
◆ operator-() [2/2]
Computes the vector difference of this vector with the specified vector.
- Parameters
-
[in] | other | The vector with which the vector difference should be computed. |
- Returns
- The vector difference of this vector with a specified vector.
◆ operator-=()
Sets the value of this vector to the vector difference of itself with the specified vector.
- Parameters
-
[in] | other | The vector with which the vector difference should be computed. |
- Returns
- A reference to this vector.
◆ operator/()
Vector2 AVO::Vector2::operator/ |
( |
float |
scalar | ) |
const |
|
inline |
Computes the scalar division of this vector with the specified scalar value.
- Parameters
-
[in] | scalar | The scalar value with which the scalar division should be computed. |
- Returns
- The scalar division of this vector with a specified scalar value.
◆ operator/=()
Vector2& AVO::Vector2::operator/= |
( |
float |
scalar | ) |
|
|
inline |
Sets the value of this vector to the scalar division of itself with the specified scalar value.
- Parameters
-
[in] | scalar | The scalar value with which the scalar division should be computed. |
- Returns
- A reference to this vector.
◆ operator==()
bool AVO::Vector2::operator== |
( |
const Vector2 & |
other | ) |
const |
|
inline |
Tests this vector for equality with the specified vector.
- Parameters
-
[in] | other | The vector with which to test for equality. |
- Returns
- True if the vectors are equal.
◆ setX()
void AVO::Vector2::setX |
( |
float |
x | ) |
|
|
inline |
Sets the x-coordinate of this vector.
- Parameters
-
[in] | x | The replacement x-coordinate. |
◆ setY()
void AVO::Vector2::setY |
( |
float |
y | ) |
|
|
inline |
Sets the y-coordinate of this vector.
- Parameters
-
[in] | y | The replacement y-coordinate. |
◆ abs()
AVO_EXPORT float abs |
( |
const Vector2 & |
vector | ) |
|
|
related |
Computes the length of a specified vector.
- Parameters
-
[in] | vector | The vector whose length is to be computed. |
- Returns
- The length of the vector.
◆ absSq()
AVO_EXPORT float absSq |
( |
const Vector2 & |
vector | ) |
|
|
related |
Computes the squared length of a specified vector.
- Parameters
-
[in] | vector | The vector whose squared length is to be calculated. |
- Returns
- The squared length of the vector.
◆ det()
AVO_EXPORT float det |
( |
const Vector2 & |
vector1, |
|
|
const Vector2 & |
vector2 |
|
) |
| |
|
related |
Computes the determinant of a square matrix with rows consisting of the specified vectors.
- Parameters
-
[in] | vector1 | The top row of the square matrix. |
[in] | vector2 | The bottom row of the square matrix. |
- Returns
- The determinant of the square matrix.
◆ normalize()
Computes the normalization of a specified vector.
- Parameters
-
[in] | vector | The vector whose normalization is to be calculated. |
- Returns
- The normalization of the vector.
◆ operator*()
Computes the scalar multiplication of the specified vector with the specified scalar value.
- Parameters
-
[in] | scalar | The scalar value with which the scalar multiplication should be computed. |
[in] | vector | The vector with which the scalar multiplication should be computed. |
- Returns
- The scalar multiplication of the vector with the scalar value.
◆ operator<<()
AVO_EXPORT std::ostream & operator<< |
( |
std::ostream & |
stream, |
|
|
const Vector2 & |
vector |
|
) |
| |
|
related |
Inserts the specified two-dimensional vector into the specified output stream.
- Parameters
-
[in,out] | stream | The output stream into which the two-dimensional vector should be inserted. |
[in] | vector | The two-dimensional vector which to insert into the output stream. |
- Returns
- A reference to the output stream.
The documentation for this class was generated from the following file: