Position3D Class Reference
[Spaces]

Represents (x,y,z) in R^3. More...

#include <R3.h>

Inheritance diagram for Position3D:

Acceleration3D Velocity3D

List of all members.

Public Member Functions

 Position3D ()
 Default constructor.
 Position3D (const Decimal &x_in, const Decimal &y_in, const Decimal &z_in)
 x y z constructor.
 Position3D (const vector< Decimal > &v)
 Vector constructor.
 Position3D (Decimal v[3])
 C Vector constructor.
 Position3D (const Angle &phi, const Angle &theta)
 Phi theta constructor (gives the versor in the direction of phi, theta).
 Position3D (const Decimal &ro, const Angle &phi, const Decimal &zita)
 Constructor in cilindrical coordinates.
 Position3D (const Decimal &ro, const Angle &phi, const Angle &theta)
 constructor in spherical coordinates.
 Position3D (const Position &pos, const Decimal &z)
 constructor from Position
 Position3D (const Position3D &p)
 Copy constructor.
Position3Doperator= (const Position3D &rhs)
 Assigment operator =.
Position3D operator- () const
 Unary minus arithmetic operator - */.
Position3Doperator+= (const Position3D &a)
 Compound assignment operator +=.
Position3Doperator-= (const Position3D &a)
 Compound assignment operator -=.
Position3Doperator*= (const Decimal &scalar)
 Compound assignment operator product by a scalar -*.
Position3Doperator/= (const Decimal &scalar)
 Compound assignment operator division by a scalar -/.
Position3D operator+ (const Position3D &other) const
 Binary arithmetic operator + */.
Position3D operator- (const Position3D &other) const
 Binary arithmetic operator - */.
Position3D operator* (const Decimal &scalar) const
 Binary arithmetic operator product by a scalar.
Position3D operator/ (const Decimal &scalar) const
 Binary arithmetic operator division by a scalar.
Position3Doperator*= (const Position3D &pos)
 Compound assignment operator element-wise product.
Position3Doperator/= (const Position3D &pos)
 Compound assignment operator element-wise division.
Position3D operator* (const Position3D &pos) const
 Binary arithmetic operator element-wise scalar.
Position3D operator/ (const Position3D &pos) const
 Binary arithmetic operator element-wise division.
bool operator== (const Position3D &other) const
 Compound operator == */.
bool operator!= (const Position3D &other) const
 Compound operator != */.
bool operator< (const Position3D &other) const
 Compound operator < */ (element wise).
bool operator> (const Position3D &other) const
 Compound operator > */ (element wise).
bool operator<= (const Position3D &other) const
 Compound operator <= */ (element wise).
bool operator>= (const Position3D &other) const
 Compound operator >= */ (element wise).
vector< Decimalvect () const
 Vector conversion.
void vect (vector< Decimal > &) const
 Vector conversion.
void vect (Decimal v[3]) const
 C Vector conversion.
Position3D maximum (const Position3D &p) const
 Maximum with another position.
Position3D minimum (const Position3D &p) const
 Minimum with another position.
Position3D unit () const
 Versor (unit vector).
Decimal x () const
 Gets the coordinate x.
Decimal y () const
 Gets the coordinate y.
Decimal z () const
 Gets the coordinate z.
void setX (const Decimal &val)
 Sets the coordinate x.
void setY (const Decimal &val)
 Sets the coordinate y.
void setZ (const Decimal &val)
 Sets the coordinate z.
Decimal norm () const
 Gets the norm of the position vector.
Decimal squareNorm () const
 Gets the square of the norm of the vector.
Decimal dist (Position3D &p) const
 Euclidean distance between two positions.
Angle azimuth () const
 Gets the azimuth.
Angle zenith () const
 Gets the zenith.
Decimal scalar (const Position3D &p) const
 Scalar product.
Position3D linearMap (Decimal m[3][3]) const
 Linear map.
Position3D satNorm (const Decimal &sat)
 Saturate the norm of the Position3D to the given value.
virtual string print (PrintTypes type=PRINT_TYPE_WITH_UNITS) const
 Prints the values.
bool fromString (const string &s)
string toString () const

Protected Attributes

Decimal _x
Decimal _y
Decimal _z


Detailed Description

Represents (x,y,z) in R^3.

Author:
Paolo Stegagno and Antonio Franchi

Constructor & Destructor Documentation

Position3D::Position3D (  ) 

Default constructor.

Position3D::Position3D ( const Decimal x_in,
const Decimal y_in,
const Decimal z_in 
)

x y z constructor.

Position3D::Position3D ( const vector< Decimal > &  v  ) 

Vector constructor.

Note:
For efficiency no check is done on the size

Position3D::Position3D ( Decimal  v[3]  ) 

C Vector constructor.

Note:
For efficiency no check is done on the size

Position3D::Position3D ( const Angle phi,
const Angle theta 
)

Phi theta constructor (gives the versor in the direction of phi, theta).

Position3D::Position3D ( const Decimal ro,
const Angle phi,
const Decimal zita 
)

Constructor in cilindrical coordinates.

Position3D::Position3D ( const Decimal ro,
const Angle phi,
const Angle theta 
)

constructor in spherical coordinates.

Position3D::Position3D ( const Position pos,
const Decimal z 
)

constructor from Position

Position3D::Position3D ( const Position3D p  ) 

Copy constructor.


Member Function Documentation

Position3D & Position3D::operator= ( const Position3D rhs  ) 

Assigment operator =.

Position3D Position3D::operator- (  )  const

Unary minus arithmetic operator - */.

Position3D & Position3D::operator+= ( const Position3D a  ) 

Compound assignment operator +=.

Position3D & Position3D::operator-= ( const Position3D a  ) 

Compound assignment operator -=.

Position3D & Position3D::operator*= ( const Decimal scalar  ) 

Compound assignment operator product by a scalar -*.

Position3D & Position3D::operator/= ( const Decimal scalar  ) 

Compound assignment operator division by a scalar -/.

Position3D Position3D::operator+ ( const Position3D other  )  const

Binary arithmetic operator + */.

Position3D Position3D::operator- ( const Position3D other  )  const

Binary arithmetic operator - */.

Position3D Position3D::operator* ( const Decimal scalar  )  const

Binary arithmetic operator product by a scalar.

Note:
The scalar must be on the right side of the product.

Position3D Position3D::operator/ ( const Decimal scalar  )  const

Binary arithmetic operator division by a scalar.

Note:
The scalar must be on the right side of the product.

Position3D & Position3D::operator*= ( const Position3D pos  ) 

Compound assignment operator element-wise product.

Position3D & Position3D::operator/= ( const Position3D pos  ) 

Compound assignment operator element-wise division.

Position3D Position3D::operator* ( const Position3D pos  )  const

Binary arithmetic operator element-wise scalar.

Position3D Position3D::operator/ ( const Position3D pos  )  const

Binary arithmetic operator element-wise division.

bool Position3D::operator== ( const Position3D other  )  const

Compound operator == */.

bool Position3D::operator!= ( const Position3D other  )  const

Compound operator != */.

bool Position3D::operator< ( const Position3D other  )  const

Compound operator < */ (element wise).

bool Position3D::operator> ( const Position3D other  )  const

Compound operator > */ (element wise).

bool Position3D::operator<= ( const Position3D other  )  const

Compound operator <= */ (element wise).

bool Position3D::operator>= ( const Position3D other  )  const

Compound operator >= */ (element wise).

vector< Decimal > Position3D::vect (  )  const

Vector conversion.

void Position3D::vect ( vector< Decimal > &  v  )  const

Vector conversion.

void Position3D::vect ( Decimal  v[3]  )  const

C Vector conversion.

Note:
For efficiency no check is done on the size
Parameters:
[out] v a C vector of three elements

Position3D Position3D::maximum ( const Position3D p  )  const

Maximum with another position.

Position3D Position3D::minimum ( const Position3D p  )  const

Minimum with another position.

Position3D Position3D::unit (  )  const

Versor (unit vector).

Decimal Position3D::x ( void   )  const

Gets the coordinate x.

Decimal Position3D::y ( void   )  const

Gets the coordinate y.

Decimal Position3D::z (  )  const

Gets the coordinate z.

void Position3D::setX ( const Decimal val  ) 

Sets the coordinate x.

void Position3D::setY ( const Decimal val  ) 

Sets the coordinate y.

void Position3D::setZ ( const Decimal val  ) 

Sets the coordinate z.

Decimal Position3D::norm (  )  const

Gets the norm of the position vector.

Decimal Position3D::squareNorm (  )  const

Gets the square of the norm of the vector.

Returns:
The square norm of the position vector

Decimal Position3D::dist ( Position3D p  )  const

Euclidean distance between two positions.

Parameters:
[in] p Position3D in respect to which compute the distance
Returns:
The norm of the difference between "this" and another passed Position3D.

Angle Position3D::azimuth (  )  const

Gets the azimuth.

Returns:
the azimuth (phase or anomaly) of the position vector

Angle Position3D::zenith (  )  const

Gets the zenith.

Returns:
the zenith (polar angle or colatitude) of the position vector

Decimal Position3D::scalar ( const Position3D p  )  const

Scalar product.

Returns:
The scalar product between *this and the input Position3D
Parameters:
[in] p The other Position3D.

Position3D Position3D::linearMap ( Decimal  m[3][3]  )  const

Linear map.

Returns:
The position obtained by multiplying a 3*3 matrix and *this
Parameters:
[in] m A 3*3 matrix.

Position3D Position3D::satNorm ( const Decimal sat  ) 

Saturate the norm of the Position3D to the given value.

Parameters:
[in] sat The saturation value (supposed to be positive).

string Position3D::print ( PrintTypes  type = PRINT_TYPE_WITH_UNITS  )  const [virtual]

Prints the values.

Reimplemented in Velocity3D, and Acceleration3D.

bool Position3D::fromString ( const string &  s  ) 

string Position3D::toString (  )  const


Member Data Documentation

Decimal Position3D::_x [protected]

Decimal Position3D::_y [protected]

Decimal Position3D::_z [protected]


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

Generated on Mon Feb 20 07:01:10 2017 for MIP by  doxygen 1.5.6