FlightGear next
JSBSim::FGColumnVector3 Class Reference

This class implements a 3 element column vector. More...

#include <FGColumnVector3.h>

Public Member Functions

 FGColumnVector3 (void)
 Default initializer.
 
 FGColumnVector3 (const double X, const double Y, const double Z)
 Initialization by given values.
 
 FGColumnVector3 (const FGColumnVector3 &v)
 Copy constructor.
 
 ~FGColumnVector3 (void)
 Destructor.
 
double operator() (const unsigned int idx) const
 Read access the entries of the vector.
 
double & operator() (const unsigned int idx)
 Write access the entries of the vector.
 
double Entry (const unsigned int idx) const
 Read access the entries of the vector.
 
double & Entry (const unsigned int idx)
 Write access the entries of the vector.
 
std::string Dump (const std::string &delimeter) const
 Prints the contents of the vector.
 
FGColumnVector3operator= (const FGColumnVector3 &b)
 Assignment operator.
 
FGColumnVector3operator= (std::initializer_list< double > lv)
 Assignment operator.
 
bool operator== (const FGColumnVector3 &b) const
 Comparison operator.
 
bool operator!= (const FGColumnVector3 &b) const
 Comparison operator.
 
FGColumnVector3 operator* (const double scalar) const
 Multiplication by a scalar.
 
FGColumnVector3 operator/ (const double scalar) const
 Multiply by 1/scalar.
 
FGColumnVector3 operator* (const FGColumnVector3 &V) const
 Cross product multiplication.
 
FGColumnVector3 operator+ (const FGColumnVector3 &B) const
 Addition operator.
 
FGColumnVector3 operator- (const FGColumnVector3 &B) const
 Subtraction operator.
 
FGColumnVector3operator-= (const FGColumnVector3 &B)
 Subtract an other vector.
 
FGColumnVector3operator+= (const FGColumnVector3 &B)
 Add an other vector.
 
FGColumnVector3operator*= (const double scalar)
 Scale by a scalar.
 
FGColumnVector3operator/= (const double scalar)
 Scale by a 1/scalar.
 
void InitMatrix (void)
 
void InitMatrix (const double a)
 
void InitMatrix (const double a, const double b, const double c)
 
double Magnitude (void) const
 Length of the vector.
 
double Magnitude (const int idx1, const int idx2) const
 Length of the vector in a coordinate axis plane.
 
FGColumnVector3Normalize (void)
 Normalize.
 

Detailed Description

This class implements a 3 element column vector.

Author
Jon S. Berndt, Tony Peden, et. al.

Definition at line 63 of file FGColumnVector3.h.

Constructor & Destructor Documentation

◆ FGColumnVector3() [1/3]

JSBSim::FGColumnVector3::FGColumnVector3 ( void )

Default initializer.

Create a zero vector.

Definition at line 55 of file FGColumnVector3.cpp.

◆ FGColumnVector3() [2/3]

JSBSim::FGColumnVector3::FGColumnVector3 ( const double X,
const double Y,
const double Z )
inline

Initialization by given values.

Parameters
Xvalue of the x-conponent.
Yvalue of the y-conponent.
Zvalue of the z-conponent. Create a vector from the doubles given in the arguments.

Definition at line 75 of file FGColumnVector3.h.

◆ FGColumnVector3() [3/3]

JSBSim::FGColumnVector3::FGColumnVector3 ( const FGColumnVector3 & v)
inline

Copy constructor.

Parameters
vVector which is used for initialization. Create copy of the vector given in the argument.

Definition at line 84 of file FGColumnVector3.h.

◆ ~FGColumnVector3()

JSBSim::FGColumnVector3::~FGColumnVector3 ( void )
inline

Destructor.

Definition at line 91 of file FGColumnVector3.h.

Member Function Documentation

◆ Dump()

string JSBSim::FGColumnVector3::Dump ( const std::string & delimeter) const

Prints the contents of the vector.

Parameters
delimeterthe item separator (tab or comma)
Returns
a string with the delimeter-separated contents of the vector

Definition at line 63 of file FGColumnVector3.cpp.

◆ Entry() [1/2]

double & JSBSim::FGColumnVector3::Entry ( const unsigned int idx)
inline

Write access the entries of the vector.

Parameters
idxthe component index. Return a reference to the vector entry at the given index. Indices are counted starting with 1. This function is just a shortcut for the double& operator()(unsigned int idx) function. It is used internally to access the elements in a more convenient way. Note that the index given in the argument is unchecked.

Definition at line 125 of file FGColumnVector3.h.

◆ Entry() [2/2]

double JSBSim::FGColumnVector3::Entry ( const unsigned int idx) const
inline

Read access the entries of the vector.

Parameters
idxthe component index. Return the value of the matrix entry at the given index. Indices are counted starting with 1. This function is just a shortcut for the double operator()(unsigned int idx) const function. It is used internally to access the elements in a more convenient way. Note that the index given in the argument is unchecked.

Definition at line 115 of file FGColumnVector3.h.

◆ InitMatrix() [1/3]

void JSBSim::FGColumnVector3::InitMatrix ( const double a)
inline

Definition at line 230 of file FGColumnVector3.h.

◆ InitMatrix() [2/3]

void JSBSim::FGColumnVector3::InitMatrix ( const double a,
const double b,
const double c )
inline

Definition at line 231 of file FGColumnVector3.h.

◆ InitMatrix() [3/3]

void JSBSim::FGColumnVector3::InitMatrix ( void )
inline

Definition at line 229 of file FGColumnVector3.h.

◆ Magnitude() [1/2]

double JSBSim::FGColumnVector3::Magnitude ( const int idx1,
const int idx2 ) const

Length of the vector in a coordinate axis plane.

Compute and return the euclidean norm of this vector projected into the coordinate axis plane idx1-idx2.

Definition at line 128 of file FGColumnVector3.cpp.

◆ Magnitude() [2/2]

double JSBSim::FGColumnVector3::Magnitude ( void ) const

Length of the vector.

Compute and return the euclidean norm of this vector.

Definition at line 109 of file FGColumnVector3.cpp.

◆ Normalize()

FGColumnVector3 & JSBSim::FGColumnVector3::Normalize ( void )

Normalize.

Normalize the vector to have the Magnitude() == 1.0. If the vector is equal to zero it is left untouched.

Definition at line 116 of file FGColumnVector3.cpp.

◆ operator!=()

bool JSBSim::FGColumnVector3::operator!= ( const FGColumnVector3 & b) const
inline

Comparison operator.

Parameters
bother vector. Returns false if both vectors are exactly the same.

Definition at line 163 of file FGColumnVector3.h.

◆ operator()() [1/2]

double & JSBSim::FGColumnVector3::operator() ( const unsigned int idx)
inline

Write access the entries of the vector.

Parameters
idxthe component index. Return a reference to the vector entry at the given index. Indices are counted starting with 1. Note that the index given in the argument is unchecked.

Definition at line 105 of file FGColumnVector3.h.

◆ operator()() [2/2]

double JSBSim::FGColumnVector3::operator() ( const unsigned int idx) const
inline

Read access the entries of the vector.

Parameters
idxthe component index. Return the value of the matrix entry at the given index. Indices are counted starting with 1. Note that the index given in the argument is unchecked.

Definition at line 98 of file FGColumnVector3.h.

◆ operator*() [1/2]

FGColumnVector3 JSBSim::FGColumnVector3::operator* ( const double scalar) const
inline

Multiplication by a scalar.

Parameters
scalarscalar value to multiply the vector with.
Returns
The resulting vector from the multiplication with that scalar. Multiply the vector with the scalar given in the argument.

Definition at line 169 of file FGColumnVector3.h.

◆ operator*() [2/2]

FGColumnVector3 JSBSim::FGColumnVector3::operator* ( const FGColumnVector3 & V) const
inline

Cross product multiplication.

Parameters
Vvector to multiply with.
Returns
The resulting vector from the cross product multiplication. Compute and return the cross product of the current vector with the given argument.

Definition at line 184 of file FGColumnVector3.h.

◆ operator*=()

FGColumnVector3 & JSBSim::FGColumnVector3::operator*= ( const double scalar)
inline

Scale by a scalar.

Definition at line 219 of file FGColumnVector3.h.

◆ operator+()

FGColumnVector3 JSBSim::FGColumnVector3::operator+ ( const FGColumnVector3 & B) const
inline

Addition operator.

Definition at line 191 of file FGColumnVector3.h.

◆ operator+=()

FGColumnVector3 & JSBSim::FGColumnVector3::operator+= ( const FGColumnVector3 & B)
inline

Add an other vector.

Definition at line 211 of file FGColumnVector3.h.

◆ operator-()

FGColumnVector3 JSBSim::FGColumnVector3::operator- ( const FGColumnVector3 & B) const
inline

Subtraction operator.

Definition at line 197 of file FGColumnVector3.h.

◆ operator-=()

FGColumnVector3 & JSBSim::FGColumnVector3::operator-= ( const FGColumnVector3 & B)
inline

Subtract an other vector.

Definition at line 203 of file FGColumnVector3.h.

◆ operator/()

FGColumnVector3 JSBSim::FGColumnVector3::operator/ ( const double scalar) const

Multiply by 1/scalar.

Parameters
scalarscalar value to devide the vector through.
Returns
The resulting vector from the division through that scalar. Multiply the vector with the 1/scalar given in the argument.

Definition at line 82 of file FGColumnVector3.cpp.

◆ operator/=()

FGColumnVector3 & JSBSim::FGColumnVector3::operator/= ( const double scalar)

Scale by a 1/scalar.

Definition at line 95 of file FGColumnVector3.cpp.

◆ operator=() [1/2]

FGColumnVector3 & JSBSim::FGColumnVector3::operator= ( const FGColumnVector3 & b)
inline

Assignment operator.

Parameters
bsource vector. Copy the content of the vector given in the argument into *this.

Definition at line 135 of file FGColumnVector3.h.

◆ operator=() [2/2]

FGColumnVector3 & JSBSim::FGColumnVector3::operator= ( std::initializer_list< double > lv)
inline

Assignment operator.

Parameters
lvinitializer list of at most 3 values (i.e. {x, y, Z}) Copy the content of the list into *this.

Definition at line 145 of file FGColumnVector3.h.

◆ operator==()

bool JSBSim::FGColumnVector3::operator== ( const FGColumnVector3 & b) const
inline

Comparison operator.

Parameters
bother vector. Returns true if both vectors are exactly the same.

Definition at line 156 of file FGColumnVector3.h.


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