#include <R2Arma.h>
Public Member Functions | |
Position2DArma () | |
Default constructor. | |
Position2DArma (const Decimal &x, const Decimal &y) | |
Complete constructor. | |
Position2DArma (const Angle &theta) | |
Angle constructor (gives sin() and cos() of theta). | |
Position2DArma (const Decimal &d, const Angle &theta) | |
Distance angle constructor (gives d*sin(theta) and d*cos(theta)). | |
Position2DArma (const Position2DArma &A) | |
Copy constructor. | |
Position2DArma (const Position &pos) | |
Copy constructor. | |
Position2DArma (const arma::Mat< Decimal > &A) | |
arma::Mat<Decimal> constructor | |
Position2DArma (stringstream &ss) | |
stringstream constructor. | |
Position2DArma & | operator= (const Position &pos) |
Assignment operator with Position. | |
Position2DArma & | operator= (const Position2DArma &rhs) |
Assignment operator with Position2DArma. | |
Position2DArma & | operator= (const arma::Mat< Decimal > &rhs) |
Assignment operator with arma::Mat<Decimal>. | |
bool | operator== (const Position2DArma &other) const |
Operator ==. | |
Position2DArma & | operator+= (const Position2DArma &pos) |
Addition/Assigment binary operator with a Position2DArma. | |
Position2DArma & | operator+= (const Position &pos) |
Addition/Assigment binary operator with a Position. | |
Position2DArma & | operator+= (const arma::Col< Decimal >::fixed< 2 > &pos) |
Addition/Assigment binary operator with a arma::Mat<Decimal>. | |
Position2DArma & | operator+= (const Decimal &scalar) |
Addition/Assigment binary operator with a scalar. | |
Position2DArma | operator- (Position2DArma &other) const |
Binary arithmetic operator element-wise Position2DArma. | |
Position2DArma & | operator-= (const Position2DArma &pos) |
Subtraction/Assigment binary operator with a Position2DArma. | |
Position2DArma & | operator-= (const Decimal &scalar) |
Subtraction/Assigment binary operator with a scalar. | |
Position2DArma & | operator-= (const arma::Col< Decimal >::fixed< 2 > &pos) |
Subtraction/Assigment binary operator with a arma::Mat<Decimal>. | |
Position2DArma | operator+ (Position2DArma &other) const |
Binary arithmetic operator element-wise Position2DArma. | |
Position2DArma & | operator*= (const Position2DArma &pos) |
Compound assignment operator product by a another Position2DArma pos *=. | |
Position2DArma & | operator*= (const Decimal &scalar) |
Compound assignment operator product by a scalar *. | |
Position2DArma & | operator*= (const arma::Mat< Decimal >::fixed< 2, 2 > &mat) |
Compound assignment operator product by a matrix. | |
Position2DArma & | operator*= (const arma::Col< Decimal >::fixed< 2 > &pos) |
Compound assignment operator product by a another Position2DArma pos *=. | |
Position2DArma & | operator*= (const Roto2DArma &mat) |
Compound assignment operator product by a matrix *. | |
Position2DArma & | operator*= (const arma::Mat< Decimal >::fixed< 3, 3 > &mat) |
Compound assignment operator product by a matrix *. | |
Position2DArma | operator* (const arma::Col< Decimal >::fixed< 2 > &pos) const |
Compound assignment operator product by a matrix *. | |
Position2DArma | operator* (Position2DArma &other) const |
Binary arithmetic operator element-wise scalar. | |
Position2DArma & | operator/= (const Position2DArma &pos) |
Compound assignment operator product by a another Position2DArma pos *=. | |
Position2DArma & | operator/= (const Decimal &scalar) |
Compound assignment operator product by a scalar *. | |
Position2DArma & | operator/= (const arma::Col< Decimal >::fixed< 2 > &pos) |
Compound assignment operator product by a scalar /=. | |
Position2DArma | operator/ (Position2DArma &other) const |
Binary arithmetic operator element-wise scalar. | |
Position2DArma | operator/ (const arma::Col< Decimal >::fixed< 2 > &pos) const |
Binary arithmetic operator element-wise scalar. | |
Position2DArma | matrixProd (const arma::Mat< Decimal >::fixed< 2, 2 > &mat) |
Multiply the input matrix with actual element and overwrite it. | |
Position2DArma | matrixHomoProd (const arma::Mat< Decimal >::fixed< 3, 3 > &mat) |
Multiply the input matrix with actual element and overwrite it. | |
Position2DArma | matrixProd (Roto2DArma &mat) |
Multiply the input matrix with actual element and overwrite it. | |
Position2DArma | minimum (const Position2DArma &p) const |
Minimum with another position. | |
Position2DArma | maximum (const Position2DArma &p) const |
Maximum with another position. | |
Decimal | x () const |
Return the x component. | |
Decimal | y () const |
Return the y component. | |
void | setX (const Decimal &p) |
Set the x component. | |
void | setY (const Decimal &p) |
Set the y component. | |
Angle | azimuthAngle () const |
Compute the azimuth angle. | |
Decimal | azimuth () const |
Compute the azimuth angle. | |
Angle | bearing () const |
Anomaly in polar coordinates. | |
Decimal | bearingInv () const |
Inverse Anomaly in polar coordinates. | |
Decimal | scalar (const Position2DArma &p) const |
Scalar product. | |
vector< Decimal > | vectorize () const |
Create a 2-compnents vector from the Position. | |
string | print (int precision=4) const |
Print. | |
Decimal | norm (int p=2) const |
Norm of the vector. | |
Decimal | squareNorm (int p=2) const |
Gets the square of the norm of the vector. | |
Decimal | dist (Position2DArma &other, int p=2) const |
Compute the distance between two Position2DArma. | |
string | exportAsString () const |
Export as formatted string. | |
bool | fromString (const string &s) |
string | toString () const |
Position2DArma::Position2DArma | ( | ) |
Default constructor.
Creates a Position with x=0.0, y=0.0.
Complete constructor.
[in] | &x | x coordinate |
[in] | &y | y coordinate Creates a Position with the specified values. |
Position2DArma::Position2DArma | ( | const Angle & | theta | ) |
Distance angle constructor (gives d*sin(theta) and d*cos(theta)).
&d | Given value for the distance. | |
&theta | Given value for the angle. Creates a Position vector with the specified distance and angle, as [d*sin(theta), d*cos(theta)]. |
Position2DArma::Position2DArma | ( | const Position2DArma & | A | ) |
Position2DArma::Position2DArma | ( | const Position & | pos | ) |
Position2DArma::Position2DArma | ( | const arma::Mat< Decimal > & | A | ) |
arma::Mat<Decimal> constructor
Builds a Position2DArma from the data contained in an arma Matrix of Decimal. The method implicitly assumes that the Matrix is at least (2x1) and no check is done on it. The Position2DArma will be (A(0,0) A(0,1)).
&A | matrix to be copied. |
Position2DArma::Position2DArma | ( | stringstream & | ss | ) |
stringstream constructor.
Builds a Position2DArma from the data contained in a formatted stringstream. Format is "x y" as the one coming from the method exportAsString.
Position2DArma & Position2DArma::operator= | ( | const Position & | pos | ) |
Assignment operator with Position.
Position2DArma & Position2DArma::operator= | ( | const Position2DArma & | rhs | ) |
Assignment operator with Position2DArma.
Position2DArma & Position2DArma::operator= | ( | const arma::Mat< Decimal > & | rhs | ) |
Assignment operator with arma::Mat<Decimal>.
The method implicitly assumes that the Matrix is at least (2x1) and no check is done on it. The Position2DArma will be (A(0,0) A(0,1)).
bool Position2DArma::operator== | ( | const Position2DArma & | other | ) | const |
Operator ==.
Position2DArma & Position2DArma::operator+= | ( | const Position2DArma & | pos | ) |
Addition/Assigment binary operator with a Position2DArma.
Position2DArma & Position2DArma::operator+= | ( | const Position & | pos | ) |
Addition/Assigment binary operator with a Position.
Position2DArma & Position2DArma::operator+= | ( | const arma::Col< Decimal >::fixed< 2 > & | pos | ) |
Addition/Assigment binary operator with a arma::Mat<Decimal>.
The method implicitly assumes that the Matrix is at least (2x1) and no check is done on it. This Position2DArma will be added with (A(0,0) A(0,1)) Position.
Position2DArma & Position2DArma::operator+= | ( | const Decimal & | scalar | ) |
Addition/Assigment binary operator with a scalar.
The method implicitly assumes that the Matrix is at least (2x1) and no check is done on it. This Position2DArma will be added with scalar*(1 1) Position.
Position2DArma Position2DArma::operator- | ( | Position2DArma & | other | ) | const |
Binary arithmetic operator element-wise Position2DArma.
Position2DArma & Position2DArma::operator-= | ( | const Position2DArma & | pos | ) |
Subtraction/Assigment binary operator with a Position2DArma.
Position2DArma & Position2DArma::operator-= | ( | const Decimal & | scalar | ) |
Subtraction/Assigment binary operator with a scalar.
The method implicitly assumes that the Matrix is at least (2x1) and no check is done on it. This Position2DArma will be subtracted of scalar*(1 1) Position.
Position2DArma & Position2DArma::operator-= | ( | const arma::Col< Decimal >::fixed< 2 > & | pos | ) |
Subtraction/Assigment binary operator with a arma::Mat<Decimal>.
The method implicitly assumes that the Matrix is at least (2x1) and no check is done on it. This Position2DArma will be subtracted of (pos(0,0) pos(0,1)) Position.
Position2DArma Position2DArma::operator+ | ( | Position2DArma & | other | ) | const |
Binary arithmetic operator element-wise Position2DArma.
Position2DArma & Position2DArma::operator*= | ( | const Position2DArma & | pos | ) |
Compound assignment operator product by a another Position2DArma pos *=.
Position2DArma & Position2DArma::operator*= | ( | const Decimal & | scalar | ) |
Compound assignment operator product by a scalar *.
Position2DArma & Position2DArma::operator*= | ( | const arma::Mat< Decimal >::fixed< 2, 2 > & | mat | ) |
Compound assignment operator product by a matrix.
Position2DArma & Position2DArma::operator*= | ( | const arma::Col< Decimal >::fixed< 2 > & | pos | ) |
Compound assignment operator product by a another Position2DArma pos *=.
Position2DArma & Position2DArma::operator*= | ( | const Roto2DArma & | mat | ) |
Compound assignment operator product by a matrix *.
Position2DArma & Position2DArma::operator*= | ( | const arma::Mat< Decimal >::fixed< 3, 3 > & | mat | ) |
Compound assignment operator product by a matrix *.
Position2DArma Position2DArma::operator* | ( | const arma::Col< Decimal >::fixed< 2 > & | pos | ) | const |
Compound assignment operator product by a matrix *.
Position2DArma Position2DArma::operator* | ( | Position2DArma & | other | ) | const |
Binary arithmetic operator element-wise scalar.
Position2DArma & Position2DArma::operator/= | ( | const Position2DArma & | pos | ) |
Compound assignment operator product by a another Position2DArma pos *=.
Position2DArma & Position2DArma::operator/= | ( | const Decimal & | scalar | ) |
Compound assignment operator product by a scalar *.
Position2DArma & Position2DArma::operator/= | ( | const arma::Col< Decimal >::fixed< 2 > & | pos | ) |
Compound assignment operator product by a scalar /=.
Position2DArma Position2DArma::operator/ | ( | Position2DArma & | other | ) | const |
Binary arithmetic operator element-wise scalar.
Position2DArma Position2DArma::operator/ | ( | const arma::Col< Decimal >::fixed< 2 > & | pos | ) | const |
Binary arithmetic operator element-wise scalar.
Position2DArma Position2DArma::matrixProd | ( | const arma::Mat< Decimal >::fixed< 2, 2 > & | mat | ) |
Multiply the input matrix with actual element and overwrite it.
[in] | &mat | 2x2 matrix |
Position2DArma Position2DArma::matrixHomoProd | ( | const arma::Mat< Decimal >::fixed< 3, 3 > & | mat | ) |
Multiply the input matrix with actual element and overwrite it.
[in] | &mat | 3x3 matrix in homogeneous coordinate |
Position2DArma Position2DArma::matrixProd | ( | Roto2DArma & | mat | ) |
Multiply the input matrix with actual element and overwrite it.
[in] | &mat | 2x2 matrix |
Position2DArma Position2DArma::minimum | ( | const Position2DArma & | p | ) | const |
Minimum with another position.
Computes the position with the minimum values among the x values and y values of the two positions.
Position2DArma Position2DArma::maximum | ( | const Position2DArma & | p | ) | const |
Maximum with another position.
Computes the position with the maximum values among the x values and y values of the two positions.
Decimal Position2DArma::x | ( | void | ) | const |
Return the x component.
Decimal Position2DArma::y | ( | void | ) | const |
Return the y component.
void Position2DArma::setX | ( | const Decimal & | p | ) |
Set the x component.
&p | Value to be set. |
void Position2DArma::setY | ( | const Decimal & | p | ) |
Set the y component.
&p | Value to be set. |
Angle Position2DArma::azimuthAngle | ( | ) | const |
Compute the azimuth angle.
Decimal Position2DArma::azimuth | ( | ) | const |
Compute the azimuth angle.
Angle Position2DArma::bearing | ( | ) | const |
Anomaly in polar coordinates.
Decimal Position2DArma::bearingInv | ( | ) | const |
Inverse Anomaly in polar coordinates.
Decimal Position2DArma::scalar | ( | const Position2DArma & | p | ) | const |
Scalar product.
[in] | p | The other position. |
vector< Decimal > Position2DArma::vectorize | ( | ) | const |
string Position2DArma::print | ( | int | precision = 4 |
) | const |
Print.
Decimal Position2DArma::norm | ( | int | p = 2 |
) | const |
Norm of the vector.
[in] | p | assigns the order of the norm. |
Decimal Position2DArma::squareNorm | ( | int | p = 2 |
) | const |
Gets the square of the norm of the vector.
[in] | p | assigns the order of the norm. |
Decimal Position2DArma::dist | ( | Position2DArma & | other, | |
int | p = 2 | |||
) | const |
Compute the distance between two Position2DArma.
[in] | other | Other Position2DArm |
[in] | p | Order of the norm |
string Position2DArma::exportAsString | ( | ) | const |
Export as formatted string.
bool Position2DArma::fromString | ( | const string & | s | ) |
string Position2DArma::toString | ( | ) | const |