Microchip® Advanced Software Framework

math::vector3d Class Reference

Ordered 3-tuple implementing Euclidean vector operations.

#include <vector.h>

Public Member Functions

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

Data Fields

vector element storage
scalar x
 
scalar y
 
scalar z
 

Friends

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

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

class construction and destruction

Referenced by cross(), operator*(), operator+(), operator-(), and operator/().

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

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

Referenced by math::plane::plane().

const scalar math::vector3d::dot ( const vector3d v) const
inline
const scalar math::vector3d::mag ( ) const
inline

References dot().

Referenced by math::plane::distanceToPlane(), normalize(), and unit().

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

References x, y, and z.

void math::vector3d::normalize ( )
inline

References mag().

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

References x.

Referenced by operator[]().

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

References x.

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

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

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

References x, y, and z.

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

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

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

References x, y, and z.

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

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

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

References x, y, and z.

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

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

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

References x, y, and z.

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

References x, y, and z.

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

References operator()().

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

References operator()().

const vector3d math::vector3d::unit ( ) const
inline

References mag().

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