Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a vector of a fixed arbitrary number of components. More...
#include <omVectorND.h>
Public Member Functions | |
VectorND () | |
Create a vector with all of its elements equal to zero. More... | |
VectorND (T value) | |
Create a new vector with all elements equal to a single value. More... | |
VectorND (const T array[dimension]) | |
Create a vector with elements from the specified array. More... | |
T | getMagnitude () const |
Get the magnitude of the vector. More... | |
T | getMagnitudeSquared () const |
Get the squared magnitude of the vector. More... | |
VectorND | normalize () const |
Return a a normalized version of this vector. More... | |
VectorND | projectOn (const VectorND &v) const |
Project this vector onto another vector. More... | |
T | getDistanceTo (const VectorND &v) const |
Get the distance between the this vector and another. More... | |
T | getDistanceToSquared (const VectorND &v) const |
Get the squared distance between the this vector and another. More... | |
const T * | toArray () const |
Return an array representation of this vector. More... | |
T & | get (Index i) |
Return a reference to the element at the specified index in the vector. More... | |
const T & | get (Index i) const |
Return a const reference to the element at the specified index in the vector. More... | |
T & | operator() (Index i) |
Return a reference to the element at the specified index in the vector. More... | |
const T & | operator() (Index i) const |
Return const a reference to the element at the specified index in the vector. More... | |
T & | operator[] (Index i) |
Return a reference to the element at the specified index in the vector. More... | |
const T & | operator[] (Index i) const |
Return a const reference to the element at the specified index in the vector. More... | |
Size | getSize () const |
Return the dimension of this vector (number of components it has). More... | |
Size | getDimension () const |
Return the dimension of this vector (number of components it has). More... | |
void | set (Index i, T newX) |
Set the element at the specified index in the vector. More... | |
VectorND | operator- () const |
Negate every component of this vector and return the result. More... | |
VectorND | operator+ () const |
'Positivate' every component of this vector, effectively returning a copy. More... | |
VectorND | operator+ (const VectorND &vector) const |
Add a vector to this vector and return the resulting vector. More... | |
VectorND | operator+ (T value) const |
Add a scalar value to each component of this vector and return the resulting vector. More... | |
VectorND | operator- (const VectorND &vector) const |
Subtract a vector from this vector and return the resulting vector. More... | |
VectorND | operator- (T value) const |
Subtract a scalar value from each component of this vector and return the resulting vector. More... | |
VectorND | operator* (const VectorND &vector) const |
Return the result of a component-wise vector multiplication with this vector. More... | |
VectorND | operator* (T value) const |
Multiply a scalar value by each component of this vector and return the resulting vector. More... | |
VectorND | operator/ (T value) const |
Divide each component of this vector by a scalar value and return the resulting vector. More... | |
VectorND & | operator+= (const VectorND &v2) |
VectorND & | operator-= (const VectorND &v2) |
VectorND & | operator+= (const T value) |
VectorND & | operator-= (const T value) |
VectorND & | operator*= (const T value) |
VectorND & | operator/= (const T value) |
data::String | toString () const |
Convert this vector into a human-readable string representation. More... | |
operator data::String () const | |
Convert this vector into a human-readable string representation. More... | |
Static Public Attributes | |
static const VectorND | ZERO |
A constant vector with every component equal to zero. More... | |
A class that represents a vector of a fixed arbitrary number of components.
|
inline |
Create a vector with all of its elements equal to zero.
|
inline |
Create a new vector with all elements equal to a single value.
|
inline |
Create a vector with elements from the specified array.
The array must be of length greater than or equal to the dimension of the vector.
|
inline |
Get the magnitude of the vector.
|
inline |
Get the squared magnitude of the vector.
|
inline |
Return a a normalized version of this vector.
|
inline |
Project this vector onto another vector.
|
inline |
Get the distance between the this vector and another.
|
inline |
Get the squared distance between the this vector and another.
|
inline |
Return an array representation of this vector.
|
inline |
Return a reference to the element at the specified index in the vector.
|
inline |
Return a const reference to the element at the specified index in the vector.
|
inline |
Return a reference to the element at the specified index in the vector.
|
inline |
Return const a reference to the element at the specified index in the vector.
|
inline |
Return a reference to the element at the specified index in the vector.
|
inline |
Return a const reference to the element at the specified index in the vector.
|
inline |
Return the dimension of this vector (number of components it has).
|
inline |
Return the dimension of this vector (number of components it has).
|
inline |
Set the element at the specified index in the vector.
|
inline |
Negate every component of this vector and return the result.
|
inline |
'Positivate' every component of this vector, effectively returning a copy.
|
inline |
Add a vector to this vector and return the resulting vector.
|
inline |
Add a scalar value to each component of this vector and return the resulting vector.
|
inline |
Subtract a vector from this vector and return the resulting vector.
|
inline |
Subtract a scalar value from each component of this vector and return the resulting vector.
|
inline |
Return the result of a component-wise vector multiplication with this vector.
|
inline |
Multiply a scalar value by each component of this vector and return the resulting vector.
|
inline |
Divide each component of this vector by a scalar value and return the resulting vector.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Convert this vector into a human-readable string representation.
|
inline |
Convert this vector into a human-readable string representation.
|
static |
A constant vector with every component equal to zero.