Atmel Software Framework

math::vector4d Class Reference

Ordered 4-tuple implementing Euclidean vector operations.

#include <vector.h>

Public Member Functions

class construction and destruction
 vector4d (scalar x=0, scalar y=0, scalar z=0, scalar w=0)
 
 vector4d (const vector4h &v)
 
class public methods
const scalar dot (const vector4d &v) const
 
void normalize ()
 
const scalar mag () const
 
const vector4d unit () const
 
bool nearlyEquals (const vector4d &v, const scalar &e) const
 
class member operators
scalaroperator() (int i)
 
const scalaroperator() (int i) const
 
scalaroperator[] (int i)
 
const scalaroperator[] (int i) const
 
const vector4doperator+= (const vector4d &v)
 
const vector4doperator-= (const vector4d &v)
 
const vector4doperator*= (const scalar &s)
 
const vector4doperator/= (const scalar &s)
 
const vector4d operator+ (const vector4d &v) const
 
const vector4d operator- (const vector4d &v) const
 
const vector4d operator* (const scalar &s) const
 
const vector4d operator/ (const scalar &s) const
 
bool operator== (const vector4d &v) const
 
bool operator!= (const vector4d &v) const
 

Data Fields

vector element storage
scalar x
 
scalar y
 
scalar z
 
scalar w
 

Friends

class friend operators
const vector4d operator* (const scalar &s, const vector4d &v)
 
const vector4d operator- (const vector4d &u)
 

math::vector4d::vector4d ( scalar  x = 0,
scalar  y = 0,
scalar  z = 0,
scalar  w = 0 
)
inlineexplicit

Referenced by operator*(), and operator/().

math::vector4d::vector4d ( const vector4h v)
inlineexplicit

const scalar math::vector4d::dot ( const vector4d v) const
inline

References w, x, y, and z.

Referenced by mag().

const scalar math::vector4d::mag ( ) const
inline

References dot().

Referenced by normalize(), and unit().

bool math::vector4d::nearlyEquals ( const vector4d v,
const scalar e 
) const
inline

References w, x, y, and z.

void math::vector4d::normalize ( )
inline

References mag().

bool math::vector4d::operator!= ( const vector4d v) const
inline
scalar& math::vector4d::operator() ( int  i)
inline

References i, and x.

Referenced by operator[]().

const scalar& math::vector4d::operator() ( int  i) const
inline

References i, and x.

const vector4d math::vector4d::operator* ( const scalar s) const
inline

References s, and vector4d().

const vector4d& math::vector4d::operator*= ( const scalar s)
inline

References s, w, x, y, and z.

const vector4d math::vector4d::operator+ ( const vector4d v) const
inline
const vector4d& math::vector4d::operator+= ( const vector4d v)
inline

References w, x, y, and z.

const vector4d math::vector4d::operator- ( const vector4d v) const
inline
const vector4d& math::vector4d::operator-= ( const vector4d v)
inline

References w, x, y, and z.

const vector4d math::vector4d::operator/ ( const scalar s) const
inline

References s, and vector4d().

const vector4d& math::vector4d::operator/= ( const scalar s)
inline

References s, w, x, y, and z.

bool math::vector4d::operator== ( const vector4d v) const
inline

References w, x, y, and z.

scalar& math::vector4d::operator[] ( int  i)
inline

References operator()().

const scalar& math::vector4d::operator[] ( int  i) const
inline

References operator()().

const vector4d math::vector4d::unit ( ) const
inline

References mag().

const vector4d operator* ( const scalar s,
const vector4d v 
)
friend
const vector4d operator- ( const vector4d u)
friend