#include <matrix_2d.h>
Public メソッド | |
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 Matrix2D & | reset () |
reset to the identity matrix | |
const Matrix2D & | assign (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. | |
const Matrix2D & | translate (const double &dx, const double &dy) |
moves the coordinate system. | |
const Matrix2D & | scale (const double &sx, const double &sy) |
scales the coordinate system. | |
const Matrix2D & | rotate (const AngleDeg &angle) |
rotates the coordinate system | |
const Matrix2D & | operator *= (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 メソッド | |
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. |
( m11, m12, dx ) ( m21, m22, dy ) ( 0, 0, 1 )
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.
m11 | the horizontal scaling factor. | |
m12 | the vertical shearing factor. | |
m21 | the horizontal shearing factor. | |
m22 | the vertical scaling factor. | |
dx | the horizontal translation factor. | |
dy | the vertical translation factor. |
const Matrix2D& rcsc::Matrix2D::reset | ( | ) | [inline] |
reset to the identity matrix
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.
m11 | the horizontal scaling factor. | |
m12 | the vertical shearing factor. | |
m21 | the horizontal shearing factor. | |
m22 | the vertical scaling factor. | |
dx | the horizontal translation factor. | |
dy | the vertical translation factor. |
static Matrix2D rcsc::Matrix2D::make_translation | ( | const double & | dx, | |
const double & | dy | |||
) | [inline, static] |
create the translation matrix.
dx | the horizontal translation factor. | |
dy | the vertical translation factor. |
static Matrix2D rcsc::Matrix2D::make_scaling | ( | const double & | sx, | |
const double & | sy | |||
) | [inline, static] |
create the scaling matrix.
sx | the horizontal scaling factor. | |
sy | the vertical scaling factor. |
create the rotation matrix.
angle | the rotation angle |
const double& rcsc::Matrix2D::m11 | ( | ) | const [inline] |
get the horizontal scaling factor.
const double& rcsc::Matrix2D::m12 | ( | ) | const [inline] |
get the vertical shearing factor.
const double& rcsc::Matrix2D::m21 | ( | ) | const [inline] |
get the horizontal shearing factor.
const double& rcsc::Matrix2D::m22 | ( | ) | const [inline] |
get the vertical scaling factor.
const double& rcsc::Matrix2D::dx | ( | ) | const [inline] |
get the horizontal translation factor.
const double& rcsc::Matrix2D::dy | ( | ) | const [inline] |
get the vertical translation factor.
double rcsc::Matrix2D::det | ( | ) | const [inline] |
get the matrix's determinant.
bool rcsc::Matrix2D::invertible | ( | ) | const [inline] |
check if this matrix is invertible (is not isingular).
Matrix2D rcsc::Matrix2D::inverted | ( | ) | const |
get the inverted matrix.
const Matrix2D& rcsc::Matrix2D::translate | ( | const double & | dx, | |
const double & | dy | |||
) | [inline] |
moves the coordinate system.
dx | move factor for the x axis. | |
dy | move factor for the y axis. |
const Matrix2D& rcsc::Matrix2D::scale | ( | const double & | sx, | |
const double & | sy | |||
) | [inline] |
scales the coordinate system.
sx | scaling factor for the x axis. | |
sy | scaling factor for the y axis. |
rotates the coordinate system
angle | rotation angle |
multiplied by other matrix
m | left hand side matrix |
create transformed vector from input vector with this matrix
v | input vector |
Vector2D rcsc::Matrix2D::transform | ( | const double & | x, | |
const double & | y | |||
) | const [inline] |
create transformed vector from input coordinates with this matrix
x | input x-coordinates value | |
y | input y-coordinates value |
void rcsc::Matrix2D::transform | ( | Vector2D * | v | ) | const [inline] |
transform input vector with this matrix
v | pointer to the input vector. |
std::ostream& rcsc::Matrix2D::print | ( | std::ostream & | os | ) | const [inline] |
put all elemtns to the output stream
os | reference to the output stream |