SPH
Public Member Functions | Static Public Member Functions | List of all members
AffineMatrix2 Class Reference

2D affine matrix More...

#include <Point.h>

Inheritance diagram for AffineMatrix2:
OperatorTemplate< AffineMatrix2 >

Public Member Functions

 AffineMatrix2 (const Float scale=1._f, const PlotPoint translation=PlotPoint(0._f, 0._f))
 Creates the matrix given a uniform scaling factor and a translation vector. More...
 
 AffineMatrix2 (const Float xx, const Float yx, const Float xy, const Float yy, const Float tx=0._f, const Float ty=0._f)
 Creates the matrix from individual components. More...
 
Floatoperator() (const Size i, const Size j)
 Returns the given component of the matrix. More...
 
Float operator() (const Size i, const Size j) const
 Returns the given component of the matrix. More...
 
Float get (const Size i, const Size j) const
 Returns the given component of the matrix. More...
 
PlotPoint transformPoint (const PlotPoint &p) const
 Applies the affine transform on given point. More...
 
PlotPoint transformVector (const PlotPoint &p) const
 Applies the transform on given vector. More...
 
AffineMatrix2 inverse () const
 Returns the inverse of the matrix. More...
 
AffineMatrix2 transpose () const
 Returns the transposed matrix. More...
 
bool operator== (const AffineMatrix2 &other) const
 
- Public Member Functions inherited from OperatorTemplate< AffineMatrix2 >
AffineMatrix2 operator+ (const AffineMatrix2 &other) const
 
AffineMatrix2operator-= (const AffineMatrix2 &other)
 
bool operator!= (const AffineMatrix2 &other) const
 
AffineMatrix2 operator* (const Float value) const
 
AffineMatrix2 operator/ (const Float value) const
 
AffineMatrix2operator/= (const Float value)
 

Static Public Member Functions

static AffineMatrix2 rotate (const Float phi)
 Create a rotation matrix. More...
 

Detailed Description

2D affine matrix

Represets a generic linear transform + translation of a point

Definition at line 50 of file Point.h.

Constructor & Destructor Documentation

◆ AffineMatrix2() [1/2]

AffineMatrix2::AffineMatrix2 ( const Float  scale = 1._f,
const PlotPoint  translation = PlotPoint(0._f, 0._f) 
)
inline

Creates the matrix given a uniform scaling factor and a translation vector.

By default, an identity matrix is constructed.

Parameters
scaleScaling factor
translationTranslation vector

Definition at line 60 of file Point.h.

◆ AffineMatrix2() [2/2]

AffineMatrix2::AffineMatrix2 ( const Float  xx,
const Float  yx,
const Float  xy,
const Float  yy,
const Float  tx = 0._f,
const Float  ty = 0._f 
)
inline

Creates the matrix from individual components.

Definition at line 64 of file Point.h.

Member Function Documentation

◆ get()

Float AffineMatrix2::get ( const Size  i,
const Size  j 
) const
inline

Returns the given component of the matrix.

Syntactic sugar.

Definition at line 87 of file Point.h.

◆ inverse()

AffineMatrix2 AffineMatrix2::inverse ( ) const
inline

Returns the inverse of the matrix.

The matrix must be invertible, checked by assert.

Definition at line 107 of file Point.h.

◆ operator()() [1/2]

Float& AffineMatrix2::operator() ( const Size  i,
const Size  j 
)
inline

Returns the given component of the matrix.

Definition at line 73 of file Point.h.

◆ operator()() [2/2]

Float AffineMatrix2::operator() ( const Size  i,
const Size  j 
) const
inline

Returns the given component of the matrix.

Definition at line 79 of file Point.h.

◆ operator==()

bool AffineMatrix2::operator== ( const AffineMatrix2 other) const
inline

Definition at line 143 of file Point.h.

◆ rotate()

static AffineMatrix2 AffineMatrix2::rotate ( const Float  phi)
inlinestatic

Create a rotation matrix.

Definition at line 137 of file Point.h.

◆ transformPoint()

PlotPoint AffineMatrix2::transformPoint ( const PlotPoint p) const
inline

Applies the affine transform on given point.

Definition at line 92 of file Point.h.

◆ transformVector()

PlotPoint AffineMatrix2::transformVector ( const PlotPoint p) const
inline

Applies the transform on given vector.

This does not apply the translation.

Definition at line 100 of file Point.h.

◆ transpose()

AffineMatrix2 AffineMatrix2::transpose ( ) const
inline

Returns the transposed matrix.

The translation component is inverted, so that the transposed orthogonal matrix is equal to its inverse.

Todo:
test

Definition at line 131 of file Point.h.


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