Atmel Software Framework

math::vector4h Class Reference

Augmented 3-dimensional vector / homogeneous vector / projected point.

#include <vector.h>

Public Member Functions

class construction and destruction
 vector4h (scalar x=0, scalar y=0, scalar z=0, scalar w=1)
 
 vector4h (const vector3d &v)
 
class public methods
const scalar dot (const vector4h &v) const
 
const vector4h cross (const vector4h &v) const
 
void normalize ()
 
const scalar mag () const
 
const vector4h unit () const
 
bool nearlyEquals (const vector4h &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 vector4hoperator+= (const vector4h &v)
 
const vector4hoperator-= (const vector4h &v)
 
const vector4hoperator*= (const scalar &s)
 
const vector4hoperator/= (const scalar &s)
 
const vector4h operator+ (const vector4h &v) const
 
const vector4h operator- (const vector4h &v) const
 
const vector4h operator* (const scalar &s) const
 
const vector4h operator/ (const scalar &s) const
 
bool operator== (const vector4h &v) const
 
bool operator!= (const vector4h &v) const
 

Data Fields

homogeneous vector element storage
scalar x
 
scalar y
 
scalar z
 
scalar w
 

Friends

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

math::vector4h::vector4h ( scalar  x = 0,
scalar  y = 0,
scalar  z = 0,
scalar  w = 1 
)
inlineexplicit
math::vector4h::vector4h ( const vector3d v)
inlineexplicit

const vector4h math::vector4h::cross ( const vector4h v) const
inline

References math::det(), vector4h(), x, y, and z.

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

References x, y, and z.

Referenced by mag().

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

References dot().

Referenced by normalize(), and unit().

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

References x, y, and z.

void math::vector4h::normalize ( )
inline

References mag().

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

References i, and x.

Referenced by operator[]().

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

References i, and x.

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

References vector4h(), x, y, and z.

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

References s, x, y, and z.

const vector4h math::vector4h::operator+ ( const vector4h v) const
inline

References vector4h(), x, y, and z.

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

References x, y, and z.

const vector4h math::vector4h::operator- ( const vector4h v) const
inline

References vector4h(), x, y, and z.

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

References x, y, and z.

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

References vector4h(), x, y, and z.

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

References s, x, y, and z.

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

References x, y, and z.

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

References operator()().

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

References operator()().

const vector4h math::vector4h::unit ( ) const
inline

References mag().

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

scalar math::vector4h::w