# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CVectorD Class Reference

A 3D vector of double. More...

#include <vectord.h>

List of all members.

Public Methods

Object.
 CVectorD ()
 Constructor wich do nothing. More...

 CVectorD (double _x, double _y, double _z)
 Constructor . More...

 CVectorD (const CVector &v)
 Constructor with a CVector. More...

 CVectorD (const CVectorD &v)
 Copy Constructor. More...

Base Maths.
CVectorD & operator+= (const CVectorD &v)
CVectorD & operator-= (const CVectorD &v)
CVectorD & operator *= (double f)
CVectorD & operator/= (double f)
CVectorD operator+ (const CVectorD &v) const
CVectorD operator- (const CVectorD &v) const
CVectorD operator * (double f) const
CVectorD operator/ (double f) const
CVectorD operator- () const
Advanced Maths.
double operator * (const CVectorD &v) const
 Dot product. More...

CVectorD operator^ (const CVectorD &v) const
 Cross product. More...

double norm () const
 Return the norm of the vector. More...

double sqrnorm () const
 Return the square of the norm of the vector. More...

void normalize ()
 Normalize the vector. More...

CVectorD normed () const
 Return the vector normalized. More...

Misc.
void set (double _x, double _y, double _z)
bool operator== (const CVectorD &v) const
bool operator!= (const CVectorD &v) const
bool isNull () const
void sphericToCartesian (double r, double theta, double phi)
 Setup the vector with spheric coordinates. More...

void cartesianToSpheric (double &r, double &theta, double &phi) const
 Get the sphreic coordinates of the vector. More...

void serial (IStream &f)
CVectorD & operator= (const CVector &v)
 operator CVector () const

Public Attributes

double x
double y
double z

Static Public Attributes

const CVectorD Null
 Null vector (0,0,0). More...

const CVectorD I
 I vector (1,0,0). More...

const CVectorD J
 J vector (0,1,0). More...

const CVectorD K
 K vector (0,0,1). More...


Friends

CVectorD operator * (double f, const CVectorD &v0)


Detailed Description

A 3D vector of double.

Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 44 of file vectord.h.


Constructor & Destructor Documentation

NLMISC::CVectorD::CVectorD   [inline]
 

Constructor wich do nothing.

Definition at line 63 of file vectord.h.

Referenced by cartesianToSpheric, CVectorD, normed, operator *, operator+, operator-, and operator^.

NLMISC::CVectorD::CVectorD double    _x,
double    _y,
double    _z
[inline]
 

Constructor .

Definition at line 65 of file vectord.h.

NLMISC::CVectorD::CVectorD const CVector   v [inline]
 

Constructor with a CVector.

Definition at line 67 of file vectord.h.

NLMISC::CVectorD::CVectorD const CVectorD &    v [inline]
 

Copy Constructor.

Definition at line 69 of file vectord.h.

References CVectorD, r, and v.


Member Function Documentation

void NLMISC::CVectorD::cartesianToSpheric double &    r,
double &    theta,
double &    phi
const [inline]
 

Get the sphreic coordinates of the vector.

See sphericToCartesian() to know coordinates conventions.

See also:
sphericToCartesian()

Definition at line 152 of file vectord_inline.h.

References NLMISC::clamp, CVectorD, norm, normed, r, and v.

bool NLMISC::CVectorD::isNull   const [inline]
 

Definition at line 148 of file vectord_inline.h.

double NLMISC::CVectorD::norm   const [inline]
 

Return the norm of the vector.

Definition at line 115 of file vectord_inline.h.

References x, y, and z.

Referenced by cartesianToSpheric, normalize, and NLPACS::CPrimitiveWorldImage::reaction.

void NLMISC::CVectorD::normalize   [inline]
 

Normalize the vector.

Definition at line 119 of file vectord_inline.h.

References norm.

Referenced by NLAIAGENT::IVector::unit.

CVectorD NLMISC::CVectorD::normed   const [inline]
 

Return the vector normalized.

Definition at line 125 of file vectord_inline.h.

References CVectorD.

Referenced by cartesianToSpheric.

double NLMISC::CVectorD::operator * const CVectorD &    v const [inline]
 

Dot product.

Definition at line 97 of file vectord_inline.h.

References v, x, y, and z.

CVectorD NLMISC::CVectorD::operator * double    f const [inline]
 

Definition at line 75 of file vectord_inline.h.

References CVectorD, x, y, and z.

CVectorD & NLMISC::CVectorD::operator *= double    f [inline]
 

Definition at line 54 of file vectord_inline.h.

References x, y, and z.

NLMISC::CVectorD::operator CVector   const [inline]
 

Definition at line 179 of file vectord_inline.h.

References x, y, and z.

bool NLMISC::CVectorD::operator!= const CVectorD &    v const [inline]
 

Definition at line 144 of file vectord_inline.h.

References v.

CVectorD NLMISC::CVectorD::operator+ const CVectorD &    v const [inline]
 

Definition at line 65 of file vectord_inline.h.

References CVectorD, v, x, y, and z.

CVectorD & NLMISC::CVectorD::operator+= const CVectorD &    v [inline]
 

Definition at line 40 of file vectord_inline.h.

References v, x, y, and z.

CVectorD NLMISC::CVectorD::operator-   const [inline]
 

Definition at line 84 of file vectord_inline.h.

References CVectorD, x, y, and z.

CVectorD NLMISC::CVectorD::operator- const CVectorD &    v const [inline]
 

Definition at line 70 of file vectord_inline.h.

References CVectorD, v, x, y, and z.

CVectorD & NLMISC::CVectorD::operator-= const CVectorD &    v [inline]
 

Definition at line 47 of file vectord_inline.h.

References v, x, y, and z.

CVectorD NLMISC::CVectorD::operator/ double    f const [inline]
 

Definition at line 80 of file vectord_inline.h.

CVectorD & NLMISC::CVectorD::operator/= double    f [inline]
 

Definition at line 61 of file vectord_inline.h.

CVectorD & NLMISC::CVectorD::operator= const CVector   v [inline]
 

Definition at line 172 of file vectord_inline.h.

References v, x, y, and z.

bool NLMISC::CVectorD::operator== const CVectorD &    v const [inline]
 

Definition at line 140 of file vectord_inline.h.

References v, x, y, and z.

CVectorD NLMISC::CVectorD::operator^ const CVectorD &    v const [inline]
 

Cross product.

compute the cross product *this ^ v.

Definition at line 101 of file vectord_inline.h.

References CVectorD, v, x, y, and z.

void NLMISC::CVectorD::serial IStream   f [inline]
 

Definition at line 183 of file vectord_inline.h.

References x, y, and z.

void NLMISC::CVectorD::set double    _x,
double    _y,
double    _z
[inline]
 

Definition at line 136 of file vectord_inline.h.

References x, y, and z.

Referenced by NLPACS::CPrimitiveWorldImage::reaction.

void NLMISC::CVectorD::sphericToCartesian double    r,
double    theta,
double    phi
[inline]
 

Setup the vector with spheric coordinates.

sphericToCartesian(1,0,0) build the I vector ((1,0,0)). the formula is:
x= r*cos(theta)*cos(phi)
y= r*sin(theta)*cos(phi)
z= r*sin(phi)

See also:
cartesianToSpheric()

Definition at line 166 of file vectord_inline.h.

References r, x, y, and z.

double NLMISC::CVectorD::sqrnorm   const [inline]
 

Return the square of the norm of the vector.

Definition at line 111 of file vectord_inline.h.

References x, y, and z.


Friends And Related Function Documentation

CVectorD operator * double    f,
const CVectorD &    v0
[friend]
 

Definition at line 88 of file vectord_inline.h.


Member Data Documentation

const CVectorD NLMISC::CVectorD::I [static]
 

I vector (1,0,0).

const CVectorD NLMISC::CVectorD::J [static]
 

J vector (0,1,0).

const CVectorD NLMISC::CVectorD::K [static]
 

K vector (0,0,1).

const CVectorD NLMISC::CVectorD::Null [static]
 

Null vector (0,0,0).

double NLMISC::CVectorD::x
 

Definition at line 47 of file vectord.h.

Referenced by NLPACS::CPrimitiveWorldImage::evalCollisionOCoverOC, NLPACS::CPrimitiveWorldImage::evalCollisionPoverOC, NLPACS::CPrimitiveWorldImage::evalCollisionPoverS, NLPACS::CPrimitiveWorldImage::evalCollisionSoverOC, norm, operator *, operator *=, operator CVector, operator+, operator+=, operator-, operator-=, operator=, operator==, operator^, NLPACS::CPrimitiveWorldImage::precalcBB, NLPACS::CPrimitiveWorldImage::precalcPos, NLPACS::CRetrieverInstance::retrievePosition, serial, set, NL3D::CDriverGL::setConstant, NLPACS::CPrimitiveWorldImage::CPosition::setGlobalPosKeepZ, sphericToCartesian, sqrnorm, NLAIAGENT::IVector::squareLength, and NLAIAGENT::IVector::x.

double NLMISC::CVectorD::y
 

Definition at line 47 of file vectord.h.

Referenced by NLPACS::CPrimitiveWorldImage::evalCollisionOCoverOC, NLPACS::CPrimitiveWorldImage::evalCollisionPoverOC, NLPACS::CPrimitiveWorldImage::evalCollisionPoverS, NLPACS::CPrimitiveWorldImage::evalCollisionSoverOC, norm, operator *, operator *=, operator CVector, operator+, operator+=, operator-, operator-=, operator=, operator==, operator^, NLPACS::CPrimitiveWorldImage::precalcBB, NLPACS::CPrimitiveWorldImage::precalcPos, NLPACS::CRetrieverInstance::retrievePosition, serial, set, NL3D::CDriverGL::setConstant, NLPACS::CPrimitiveWorldImage::CPosition::setGlobalPosKeepZ, sphericToCartesian, sqrnorm, NLAIAGENT::IVector::squareLength, and NLAIAGENT::IVector::y.

double NLMISC::CVectorD::z
 

Definition at line 47 of file vectord.h.

Referenced by NLPACS::CPrimitiveWorldImage::evalCollisionOCoverOC, NLPACS::CPrimitiveWorldImage::evalCollisionPoverOC, NLPACS::CPrimitiveWorldImage::evalCollisionPoverS, NLPACS::CPrimitiveWorldImage::evalCollisionSoverOC, norm, operator *, operator *=, operator CVector, operator+, operator+=, operator-, operator-=, operator=, operator==, operator^, NLPACS::CRetrieverInstance::retrievePosition, serial, set, NL3D::CDriverGL::setConstant, NLPACS::CPrimitiveWorldImage::setGlobalPosition, sphericToCartesian, sqrnorm, NLAIAGENT::IVector::squareLength, and NLAIAGENT::IVector::z.


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