LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Static Public Member Functions | List of all members
rcsc::Matrix2D Class Reference

2D translation matrix class More...

#include <matrix_2d.h>

Public Member Functions

 Matrix2D ()
 create an identity matrix
 
 Matrix2D (const double m11, const double m12, const double m21, const double m22, const double dx, const double dy)
 create a matrix with all elements. More...
 
const Matrix2Dreset ()
 reset to the identity matrix More...
 
const Matrix2Dassign (const double m11, const double m12, const double m21, const double m22, const double dx, const double dy)
 set a matrix element with the specified values. More...
 
double m11 () const
 get the horizontal scaling factor. More...
 
double m12 () const
 get the vertical shearing factor. More...
 
double m21 () const
 get the horizontal shearing factor. More...
 
double m22 () const
 get the vertical scaling factor. More...
 
double dx () const
 get the horizontal translation factor. More...
 
double dy () const
 get the vertical translation factor. More...
 
double det () const
 get the matrix's determinant. More...
 
bool invertible () const
 check if this matrix is invertible (is not isingular). More...
 
Matrix2D inverted () const
 get the inverted matrix. More...
 
Matrix2Dtranslate (const double dx, const double dy)
 moves the coordinate system. More...
 
Matrix2Dscale (const double sx, const double sy)
 scales the coordinate system. More...
 
Matrix2Drotate (const AngleDeg &angle)
 rotates the coordinate system More...
 
const Matrix2Doperator*= (const Matrix2D &m)
 multiplied by other matrix More...
 
Vector2D transform (const Vector2D &v) const
 create transformed vector from input vector with this matrix More...
 
Vector2D transform (const double x, const double y) const
 create transformed vector from input coordinates with this matrix More...
 
void transform (Vector2D *v) const
 transform input vector with this matrix More...
 
std::ostream & print (std::ostream &os) const
 put all elemtns to the output stream More...
 

Static Public Member Functions

static Matrix2D make_translation (const double dx, const double dy)
 create the translation matrix. More...
 
static Matrix2D make_scaling (const double sx, const double sy)
 create the scaling matrix. More...
 
static Matrix2D make_rotation (const AngleDeg &angle)
 create the rotation matrix. More...
 

Detailed Description

2D translation matrix class

( m11, m12, dx ) ( m21, m22, dy ) ( 0, 0, 1 )

Constructor & Destructor Documentation

◆ Matrix2D()

rcsc::Matrix2D::Matrix2D ( const double  m11,
const double  m12,
const double  m21,
const double  m22,
const double  dx,
const double  dy 
)
inline

create a matrix with all elements.

Parameters
m11the horizontal scaling factor.
m12the vertical shearing factor.
m21the horizontal shearing factor.
m22the vertical scaling factor.
dxthe horizontal translation factor.
dythe vertical translation factor.

Member Function Documentation

◆ assign()

const Matrix2D & rcsc::Matrix2D::assign ( const double  m11,
const double  m12,
const double  m21,
const double  m22,
const double  dx,
const double  dy 
)
inline

set a matrix element with the specified values.

Parameters
m11the horizontal scaling factor.
m12the vertical shearing factor.
m21the horizontal shearing factor.
m22the vertical scaling factor.
dxthe horizontal translation factor.
dythe vertical translation factor.
Returns
const reference to itself

◆ det()

double rcsc::Matrix2D::det ( ) const
inline

get the matrix's determinant.

Returns
the determinant value.

◆ dx()

double rcsc::Matrix2D::dx ( ) const
inline

get the horizontal translation factor.

Returns
the horizontal translation factor value.

◆ dy()

double rcsc::Matrix2D::dy ( ) const
inline

get the vertical translation factor.

Returns
the vertical translation factor value.

◆ inverted()

Matrix2D rcsc::Matrix2D::inverted ( ) const

get the inverted matrix.

Returns
the invverted matrix object.

◆ invertible()

bool rcsc::Matrix2D::invertible ( ) const
inline

check if this matrix is invertible (is not isingular).

Returns
true if this matirix is invertibale.

◆ m11()

double rcsc::Matrix2D::m11 ( ) const
inline

get the horizontal scaling factor.

Returns
the horizontal scaling factor value.

◆ m12()

double rcsc::Matrix2D::m12 ( ) const
inline

get the vertical shearing factor.

Returns
the vertical shearing factor value.

◆ m21()

double rcsc::Matrix2D::m21 ( ) const
inline

get the horizontal shearing factor.

Returns
the horizontal shearing factor value.

◆ m22()

double rcsc::Matrix2D::m22 ( ) const
inline

get the vertical scaling factor.

Returns
the vertical scaling factor value.

◆ make_rotation()

static Matrix2D rcsc::Matrix2D::make_rotation ( const AngleDeg angle)
inlinestatic

create the rotation matrix.

Parameters
anglethe rotation angle
Returns
new matrix object

◆ make_scaling()

static Matrix2D rcsc::Matrix2D::make_scaling ( const double  sx,
const double  sy 
)
inlinestatic

create the scaling matrix.

Parameters
sxthe horizontal scaling factor.
sythe vertical scaling factor.
Returns
new matrix object

◆ make_translation()

static Matrix2D rcsc::Matrix2D::make_translation ( const double  dx,
const double  dy 
)
inlinestatic

create the translation matrix.

Parameters
dxthe horizontal translation factor.
dythe vertical translation factor.
Returns
new matrix object

◆ operator*=()

const Matrix2D & rcsc::Matrix2D::operator*= ( const Matrix2D m)
inline

multiplied by other matrix

Parameters
mleft hand side matrix
Returns
const reference to itself

◆ print()

std::ostream & rcsc::Matrix2D::print ( std::ostream &  os) const
inline

put all elemtns to the output stream

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ reset()

const Matrix2D & rcsc::Matrix2D::reset ( )
inline

reset to the identity matrix

Returns
const reference to itself

◆ rotate()

Matrix2D & rcsc::Matrix2D::rotate ( const AngleDeg angle)

rotates the coordinate system

Parameters
anglerotation angle
Returns
const reference to itself

same as: this = make_rotation(angle) * this

◆ scale()

Matrix2D & rcsc::Matrix2D::scale ( const double  sx,
const double  sy 
)
inline

scales the coordinate system.

Parameters
sxscaling factor for the x axis.
syscaling factor for the y axis.
Returns
const reference to itself.

same as: this = make_scaling(sx,sy) * this

◆ transform() [1/3]

Vector2D rcsc::Matrix2D::transform ( const double  x,
const double  y 
) const
inline

create transformed vector from input coordinates with this matrix

Parameters
xinput x-coordinates value
yinput y-coordinates value
Returns
mapped vector object

◆ transform() [2/3]

Vector2D rcsc::Matrix2D::transform ( const Vector2D v) const
inline

create transformed vector from input vector with this matrix

Parameters
vinput vector
Returns
mapped vector object

◆ transform() [3/3]

void rcsc::Matrix2D::transform ( Vector2D v) const
inline

transform input vector with this matrix

Parameters
vpointer to the input vector.

◆ translate()

Matrix2D & rcsc::Matrix2D::translate ( const double  dx,
const double  dy 
)
inline

moves the coordinate system.

Parameters
dxmove factor for the x axis.
dymove factor for the y axis.
Returns
const reference to itself.

same as: this = make_translation(dx,dy) * this


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