35#ifndef FGCOLUMNVECTOR3_H
36#define FGCOLUMNVECTOR3_H
45#include "JSBSim_API.h"
100 double operator()(
const unsigned int idx)
const {
return data[idx-1]; }
107 double&
operator()(
const unsigned int idx) {
return data[idx-1]; }
117 double Entry(
const unsigned int idx)
const {
return data[idx-1]; }
127 double&
Entry(
const unsigned int idx) {
return data[idx-1]; }
132 std::string Dump(
const std::string& delimeter)
const;
159 return data[0] == b.data[0] && data[1] == b.data[1] && data[2] == b.data[2];
172 return FGColumnVector3(scalar*data[0], scalar*data[1], scalar*data[2]);
188 data[2] * V.data[0] - data[0] * V.data[2],
189 data[0] * V.data[1] - data[1] * V.data[0] );
195 data[2] + B.data[2] );
201 data[2] - B.data[2] );
206 data[0] -= B.data[0];
207 data[1] -= B.data[1];
208 data[2] -= B.data[2];
214 data[0] += B.data[0];
215 data[1] += B.data[1];
216 data[2] += B.data[2];
231 void InitMatrix(
void) { data[0] = data[1] = data[2] = 0.0; }
232 void InitMatrix(
const double a) { data[0] = data[1] = data[2] = a; }
233 void InitMatrix(
const double a,
const double b,
const double c) {
234 data[0]=a; data[1]=b; data[2]=c;
239 double Magnitude(
void)
const;
244 double Magnitude(
const int idx1,
const int idx2)
const;
249 FGColumnVector3& Normalize(
void);
258inline double DotProduct(
const FGColumnVector3& v1,
const FGColumnVector3& v2) {
259 return v1(1)*v2(1) + v1(2)*v2(2) + v1(3)*v2(3);
267inline FGColumnVector3 operator*(
double scalar,
const FGColumnVector3& A) {
276JSBSIM_API std::ostream& operator<<(std::ostream& os,
const FGColumnVector3& col);
This class implements a 3 element column vector.
FGColumnVector3 operator*(const double scalar) const
Multiplication by a scalar.
FGColumnVector3 operator+(const FGColumnVector3 &B) const
Addition operator.
FGColumnVector3 operator-(const FGColumnVector3 &B) const
Subtraction operator.
FGColumnVector3 & operator*=(const double scalar)
Scale by a scalar.
FGColumnVector3 & operator+=(const FGColumnVector3 &B)
Add an other vector.
bool operator==(const FGColumnVector3 &b) const
Comparison operator.
FGColumnVector3 operator*(const FGColumnVector3 &V) const
Cross product multiplication.
double & operator()(const unsigned int idx)
Write access the entries of the vector.
FGColumnVector3 & operator=(const FGColumnVector3 &b)
Assignment operator.
FGColumnVector3 & operator-=(const FGColumnVector3 &B)
Subtract an other vector.
double & Entry(const unsigned int idx)
Write access the entries of the vector.
FGColumnVector3 & operator=(std::initializer_list< double > lv)
Assignment operator.
bool operator!=(const FGColumnVector3 &b) const
Comparison operator.
double Entry(const unsigned int idx) const
Read access the entries of the vector.
FGColumnVector3(const FGColumnVector3 &v)
Copy constructor.
~FGColumnVector3(void)
Destructor.
FGColumnVector3(const double X, const double Y, const double Z)
Initialization by given values.
double operator()(const unsigned int idx) const
Read access the entries of the vector.