LARS
LARS (Light Augmented Reality System) is an open-source framework for light-based interaction and real-time tracking in multi-robot experiments. Inspired by ARK, LARS extends the augmented reality paradigm to robotic collectives by projecting dynamic visual cues and environments onto the arena, enabling new experimental possibilities for collective robotics research, education, and outreach. LARS features integrated tracking, light projection, and modular experiment control with a user-friendly Qt GUI.
Loading...
Searching...
No Matches
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.
const Matrix2Dreset ()
 reset to the identity matrix
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.
const double & m11 () const
 get the horizontal scaling factor.
const double & m12 () const
 get the vertical shearing factor.
const double & m21 () const
 get the horizontal shearing factor.
const double & m22 () const
 get the vertical scaling factor.
const double & dx () const
 get the horizontal translation factor.
const double & dy () const
 get the vertical translation factor.
double det () const
 get the matrix's determinant.
bool invertible () const
 check if this matrix is invertible (is not isingular).
Matrix2D inverted () const
 get the inverted matrix.
Matrix2Dtranslate (const double &dx, const double &dy)
 moves the coordinate system.
Matrix2Dscale (const double &sx, const double &sy)
 scales the coordinate system.
Matrix2Drotate (const AngleDeg &angle)
 rotates the coordinate system
const Matrix2Doperator*= (const Matrix2D &m)
 multiplied by other matrix
Vector2D transform (const Vector2D &v) const
 create transformed vector from input vector with this matrix
Vector2D transform (const double &x, const double &y) const
 create transformed vector from input coordinates with this matrix
void transform (Vector2D *v) const
 transform input vector with this matrix
std::ostream & print (std::ostream &os) const
 put all elemtns to the output stream

Static Public Member Functions

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

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()

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

get the horizontal translation factor.

Returns
the horizontal translation factor value.

◆ dy()

const 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()

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

get the horizontal scaling factor.

Returns
the horizontal scaling factor value.

◆ m12()

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

get the vertical shearing factor.

Returns
the vertical shearing factor value.

◆ m21()

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

get the horizontal shearing factor.

Returns
the horizontal shearing factor value.

◆ m22()

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

get the vertical scaling factor.

Returns
the vertical scaling factor value.

◆ make_rotation()

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

create the rotation matrix.

Parameters
anglethe rotation angle
Returns
new matrix object

◆ make_scaling()

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()

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 files: