41#include "FGColumnVector3.h"
57 data[0] = data[1] = data[2] = 0.0;
66 buffer << std::setprecision(16) << data[0] << delimiter;
67 buffer << std::setprecision(16) << data[1] << delimiter;
68 buffer << std::setprecision(16) << data[2];
76 os << col(1) <<
" , " << col(2) <<
" , " << col(3);
87 cerr <<
"Attempt to divide by zero in method \
88 FGColumnVector3::operator/(const double scalar), \
89 object " << data[0] <<
" , " << data[1] <<
" , " << data[2] << endl;
100 cerr <<
"Attempt to divide by zero in method \
101 FGColumnVector3::operator/=(const double scalar), \
102 object " << data[0] <<
" , " << data[1] <<
" , " << data[2] << endl;
111 return sqrt( data[0]*data[0] + data[1]*data[1] + data[2]*data[2] );
129 return sqrt( data[idx1-1]*data[idx1-1] + data[idx2-1]*data[idx2-1] );
This class implements a 3 element column vector.
FGColumnVector3 operator*(const double scalar) const
Multiplication by a scalar.
FGColumnVector3 & operator/=(const double scalar)
Scale by a 1/scalar.
FGColumnVector3 & operator*=(const double scalar)
Scale by a scalar.
double Magnitude(void) const
Length of the vector.
FGColumnVector3 operator/(const double scalar) const
Multiply by 1/scalar.
std::string Dump(const std::string &delimeter) const
Prints the contents of the vector.
FGColumnVector3(void)
Default initializer.
FGColumnVector3 & Normalize(void)
Normalize.