Inheritance diagram for code::CVector:

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.
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 |
| Vector addition. | |
| 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. | |
| CVector & | operator *= (double f) |
| Scalar multiplicative assignment. | |
| CVector & | operator/= (double f) |
| Scalar divisive assignment. | |
| CVector & | operator+= (const CVector &v) |
| Additive assignment. | |
| CVector & | operator-= (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. | |
Public Attributes | |
| double | x |
| X-coordinate. | |
| double | y |
| Y-coordinate. | |
| double | z |
| Z-coordinate. | |
Friends | |
| CVector | operator- (const CVector &v) |
| Negation operator. | |
| 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.
| 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/ | ( | double | f | ) | const [inline] |
Scalar division.
| CVector& code::CVector::operator/= | ( | double | f | ) | [inline] |
Scalar divisive assignment.
| CVector code::CVector::unit | ( | ) | const |
Return unit vector.
double code::CTriplet::x [inherited] |
X-coordinate.
double code::CTriplet::y [inherited] |
Y-coordinate.
double code::CTriplet::z [inherited] |
Z-coordinate.
1.4.7