|
| NumVector () |
|
| NumVector (const NVector< T, N > &rhs) |
|
| NumVector (const T rhs[N]) |
|
T | dot (const NumVector &other) const |
| Inner product. More...
|
|
T | sq () const |
|
T | mag () const |
| The square of the vector, \(\vec r^2 \). More...
|
|
T | distance (const NumVector &rhs) const |
| The magnitude of the vector, \( \left| \vec r \right| \). More...
|
|
NumVector | perpto (const NumVector &other) const |
|
void | normalize () |
| Normalize in place. More...
|
|
NumVector | norm () const |
| Return the normalized version. More...
|
|
| ~NumVector () |
|
template<> |
double | distance (const NumVector< double, 2 > &rhs) const |
|
template<> |
long double | distance (const NumVector< long double, 2 > &rhs) const |
|
template<> |
double | distance (const NumVector< double, 3 > &rhs) const |
|
template<> |
long double | distance (const NumVector< long double, 3 > &rhs) const |
|
template<> |
double | mag () const |
|
template<> |
long double | mag () const |
|
template<> |
double | mag () const |
|
template<> |
long double | mag () const |
|
| NVector () |
|
| NVector (const NVector &rhs) |
|
template<class U > |
| NVector (const NVector< U, N > &rhs) |
|
| NVector (const T locs[N]) |
|
const T & | get (const unsigned int n) const |
|
void | set (const unsigned int n, const T a) |
|
unsigned int | len () const |
|
NVector & | operator+= (const NVector &rhs) |
|
NVector & | operator-= (const NVector &rhs) |
|
template<class U > |
NVector & | operator*= (const U rhs) |
|
template<class U > |
NVector & | operator/= (const U rhs) |
|
NVector | operator- () const |
|
NVector | operator+ (const NVector &rhs) const |
|
NVector | operator- (const NVector &rhs) const |
|
T & | operator[] (const unsigned int i) |
|
const T & | operator[] (const unsigned int i) const |
|
template<class U > |
NVector | operator* (const U rhs) const |
| Multiplication by a scalar. More...
|
|
template<class U > |
NVector | operator/ (const U rhs) const |
| Division by a scalar. More...
|
|
T * | begin () |
|
T * | end () |
|
| ~NVector () |
|
template<class U > |
NVector< T, N > & | operator*= (const U rhs) |
|
template<class U > |
NVector< T, N > & | operator/= (const U rhs) |
|
template<class T, unsigned int N>
class NumVector< T, N >
An N-dimensional physics vector, extending NVector.
This extends addition, subtraction, and multiplication from the type T to the NVector class.
- Template Parameters
-
T | a numerical type, as as float or double. |
N | the number of dimensions. |
template<class T , unsigned int N>
returns the component of this perpendicular to other.
\( \vec r - \frac{\vec r \cdot \vec s}{\vec s^2} \vec s \)
where \( \vec r \) is this vector, and \(\vec s \) is rhs
.
- Parameters
-
other | The other vector, \(\vec s\) |