# code::CVector Struct Reference

Inheritance diagram for code::CVector:

List of all members.

## Detailed Description

Representation of a geometric vector in a 3-D cartesian space.

This class may become a template class in the future, but right now it is based on pure doubles so that I can get something running quickly. A geometric vector is distinguished from, but related to, the a geometric point. A geometric point's coordinates transform differently from those of a geometric vector when a change of coordinate system occurs.

Author:
Thomas E. Vaughan
Version:
Id
code_PointVector.h,v 1.19 2009/06/02 20:17:38 lakshman Exp

## Public Member Functions

CVector (double a=0, double b=0, double c=0)
Initialize from argument list; the default is the zero vector.
CVector (const double v[])
Initialize from C-style vector.
CVector operator+ (const CVector &v) const
CVector operator- (const CVector &v) const
Vector subtraction.
double operator * (const CVector &v) const
Dot product.
CVector operator% (const CVector &v) const
Cross product.
CVector operator * (double f) const
Right scalar multiplication.
CVector operator/ (double f) const
Scalar division.
CVectoroperator *= (double f)
Scalar multiplicative assignment.
CVectoroperator/= (double f)
Scalar divisive assignment.
CVectoroperator+= (const CVector &v)
CVectoroperator-= (const CVector &v)
Subtractive assignment.
CVector unit () const
Return unit vector.
double norm () const
Return norm (magnitude) of vector.
double normSquared () const
Return the square of the norm of a vector.
void assign (double ix, double iy, double iz)
operator const double * () const
Convert CTriplet to C-style vector of doubles.

double x
X-coordinate.
double y
Y-coordinate.
double z
Z-coordinate.

## Friends

CVector operator- (const CVector &v)
Negation operator.

## Constructor & Destructor Documentation

 code::CVector::CVector ( double a = `0`, double b = `0`, double c = `0` ) ` [inline]`

Initialize from argument list; the default is the zero vector.

 code::CVector::CVector ( const double v[] ) ` [inline]`

Initialize from C-style vector.

## Member Function Documentation

 void code::CTriplet::assign ( double ix, double iy, double iz ) ` [inline, inherited]`

 double code::CVector::norm ( ) const

Return norm (magnitude) of vector.

 double code::CVector::normSquared ( ) const

Return the square of the norm of a vector.

 CVector code::CVector::operator * ( double f ) const` [inline]`

Right scalar multiplication.

 double code::CVector::operator * ( const CVector & v ) const` [inline]`

Dot product.

 CVector& code::CVector::operator *= ( double f ) ` [inline]`

Scalar multiplicative assignment.

 code::CTriplet::operator const double * ( ) const` [inline, inherited]`

Convert CTriplet to C-style vector of doubles.

 CVector code::CVector::operator% ( const CVector & v ) const` [inline]`

Cross product.

 CVector code::CVector::operator+ ( const CVector & v ) const` [inline]`

 CVector& code::CVector::operator+= ( const CVector & v ) ` [inline]`

 CVector code::CVector::operator- ( const CVector & v ) const` [inline]`

Vector subtraction.

 CVector& code::CVector::operator-= ( const CVector & v ) ` [inline]`

Subtractive assignment.

 CVector code::CVector::operator/ ( double f ) const` [inline]`

Scalar division.

 CVector& code::CVector::operator/= ( double f ) ` [inline]`

Scalar divisive assignment.

 CVector code::CVector::unit ( ) const

Return unit vector.

## Friends And Related Function Documentation

 CVector operator- ( const CVector & v ) ` [friend]`

Negation operator.

## Member Data Documentation

 double code::CTriplet::x` [inherited]`

X-coordinate.

 double code::CTriplet::y` [inherited]`

Y-coordinate.

 double code::CTriplet::z` [inherited]`

Z-coordinate.

Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  1.4.7