modm API documentation
modm::Vector< T, 3 > Class Template Reference

Class for handling common vector operations (3D) More...

#include <modm/math/geometry/vector3.hpp>

Public Member Functions

template<typename U >
 Vector (const U *array)
 
 Vector (T inVal)
 
 Vector (T inX, T inY, T inZ)
 
 Vector (const Vector< T, 1 > &inX, const T &inY, const T &inZ)
 
 Vector (const T &inX, const Vector< T, 1 > &inY, const T &inZ)
 
 Vector (const T &inX, const T &inY, const Vector< T, 1 > &inZ)
 
 Vector (const Vector< T, 1 > &inX, const T &inY, const Vector< T, 1 > &inZ)
 
 Vector (const Vector< T, 1 > &inX, const Vector< T, 1 > &inY, const T &inZ)
 
 Vector (const T &inX, const Vector< T, 1 > &inY, const Vector< T, 1 > &inZ)
 
 Vector (const Vector< T, 1 > &inX, const Vector< T, 1 > &inY, const Vector< T, 1 > &inZ)
 
 Vector (const Vector< T, 2 > &inXY, const T &inZ)
 
 Vector (const T &inX, const Vector< T, 2 > &inYZ)
 
 Vector (const Vector< T, 2 > &inXY, const Vector< T, 1 > &inZ)
 
 Vector (const Vector< T, 1 > &inX, const Vector< T, 2 > &inYZ)
 
template<typename U >
 Vector (const Vector< U, 3 > &rhs)
 
 Vector (const Matrix< T, 3, 1 > &rhs)
 
void set (const T &x, const T &y, const T &z)
 
void setX (const T &value)
 
void setY (const T &value)
 
void setZ (const T &value)
 
const T & getX () const
 
const T & getY () const
 
const T & getZ () const
 
Vectoroperator= (const Matrix< T, 3, 1 > &rhs)
 
bool operator== (const Vector &rhs) const
 
bool operator!= (const Vector &rhs) const
 
bool operator< (const Vector &rhs) const
 
bool operator<= (const Vector &rhs) const
 
bool operator> (const Vector &rhs) const
 
bool operator>= (const Vector &rhs) const
 
const T & operator[] (uint8_t index) const
 
T & operator[] (uint8_t index)
 
T * ptr ()
 
const T * ptr () const
 
Vector operator- () const
 
Vector operator+ (const Vector &rhs) const
 
Vector operator- (const Vector &rhs) const
 
operator* (const Vector &rhs) const
 
Vector operator^ (const Vector &rhs) const
 
Vector operator* (const T &rhs) const
 
Vector operator/ (const T &rhs) const
 
Vectoroperator+= (const Vector &rhs)
 
Vectoroperator-= (const Vector &rhs)
 
Vectoroperator*= (const T &rhs)
 
Vectoroperator/= (const T &rhs)
 
float getLength () const
 
float getLengthSquared () const
 
Vector scaled (float newLength) const
 
void scale (float newLength)
 
Vector normalized () const
 
void normalize ()
 
Matrix< T, 3, 1 > & asMatrix ()
 
const Matrix< T, 3, 1 > & asMatrix () const
 
Matrix< T, 1, 3 > & asTransposedMatrix ()
 
const Matrix< T, 1, 3 > & asTransposedMatrix () const
 
bool hasNan () const
 
bool hasInf () const
 

Public Attributes

x
 
y
 
z
 

Detailed Description

template<typename T>
class modm::Vector< T, 3 >

Class for handling common vector operations (3D)

  • : addition of points

: different of points

  • : dot product or scalar multiplication / : scalar division ^ : cross product (determinant)

Adapted from the implementation of Gaspard Petit (gaspardpetit@gmail.com).

See also
<a href"http://www-etud.iro.umontreal.ca/~petitg/cpp/point.html">Homepage
Author
Niklas Hauser

The documentation for this class was generated from the following file: