lsst.geom  16.0-13-g066a532+2
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::geom::LinearTransform Class Referencefinal

A 2D linear coordinate transformation. More...

#include <LinearTransform.h>

Public Types

enum  Parameters { XX = 0, YX = 1, XY = 2, YY = 3 }
 
typedef Eigen::Matrix< double, 4, 1 > ParameterVector
 
typedef Eigen::Matrix< double, 2, 4 > TransformDerivativeMatrix
 
typedef Eigen::Matrix< double, 4, 4 > ProductDerivativeMatrix
 
typedef Eigen::Matrix< double, 2, 2, Eigen::DontAlign > Matrix
 

Public Member Functions

 LinearTransform () noexcept
 Construct an empty (identity) LinearTransform. More...
 
 LinearTransform (Matrix const &matrix) noexcept
 Construct an LinearTransform from an Eigen::Matrix. More...
 
 LinearTransform (LinearTransform const &other) noexcept
 
 LinearTransform (LinearTransform &&other) noexcept
 
 ~LinearTransform () noexcept=default
 
LinearTransform operator* (LinearTransform const &other) const noexcept
 
LinearTransformoperator= (LinearTransform const &other) noexcept
 
LinearTransformoperator= (LinearTransform &&other) noexcept
 
LinearTransformoperator+= (LinearTransform const &other) noexcept
 
LinearTransform operator+ (LinearTransform const &other) noexcept
 
LinearTransformoperator-= (LinearTransform const &other) noexcept
 
LinearTransform operator- (LinearTransform const &other) noexcept
 
ParameterVector const getParameterVector () const noexcept
 Return the transform matrix elements as a parameter vector. More...
 
void setParameterVector (ParameterVector const &vector) noexcept
 Set the transform matrix elements from a parameter vector. More...
 
Matrix const & getMatrix () const noexcept
 
MatrixgetMatrix () noexcept
 
double & operator[] (int i)
 
double const & operator[] (int i) const
 
double computeDeterminant () const noexcept
 Return the determinant of the 2x2 matrix. More...
 
bool isIdentity () const noexcept
 Whether the transform is a no-op. More...
 
Point2D operator() (Point2D const &p) const noexcept
 Transform a Point2D object. More...
 
Extent2D operator() (Extent2D const &p) const noexcept
 Transform a Extent2D object. More...
 
TransformDerivativeMatrix dTransform (Point2D const &input) const noexcept
 Derivative of (*this)(input) with respect to the transform elements (for Point). More...
 
TransformDerivativeMatrix dTransform (Extent2D const &input) const noexcept
 Derivative of (*this)(input) with respect to the transform elements (for Extent);. More...
 
LinearTransform const inverted () const
 Return the inverse transform. More...
 
LinearTransform const invert () const
 Return the inverse transform. More...
 

Static Public Member Functions

static LinearTransform makeScaling (double s) noexcept
 
static LinearTransform makeScaling (double s, double t) noexcept
 
static LinearTransform makeRotation (Angle t) noexcept
 

Detailed Description

A 2D linear coordinate transformation.

The transform is represented by a matrix \( \mathbf{M} \) such that

\[ \left[\begin{array}{ c } x_f \\ y_f \end{array}\right] = \mathbf{M} \left[\begin{array}{ c } x_i \\ y_i \end{array}\right] \]

where \((x_i,y_i)\) are the input coordinates and \((x_f,y_f)\) are the output coordinates.

If \( x_f(x_i,y_i) \) and \( y_f(x_i,y_i) \) are continuous differentiable functions, then

\[ \mathbf{M} = \left[\begin{array}{ c c } \displaystyle\frac{\partial x_f}{\partial x_i} & \displaystyle\frac{\partial x_f}{\partial y_i} \\ \displaystyle\frac{\partial y_f}{\partial x_i} & \displaystyle\frac{\partial y_f}{\partial y_i} \end{array}\right] \]

evaluated at \((x_i,y_i)\).

Definition at line 69 of file LinearTransform.h.

Member Typedef Documentation

◆ Matrix

typedef Eigen::Matrix<double, 2, 2, Eigen::DontAlign> lsst::geom::LinearTransform::Matrix

Definition at line 77 of file LinearTransform.h.

◆ ParameterVector

typedef Eigen::Matrix<double, 4, 1> lsst::geom::LinearTransform::ParameterVector

Definition at line 73 of file LinearTransform.h.

◆ ProductDerivativeMatrix

typedef Eigen::Matrix<double, 4, 4> lsst::geom::LinearTransform::ProductDerivativeMatrix

Definition at line 75 of file LinearTransform.h.

◆ TransformDerivativeMatrix

typedef Eigen::Matrix<double, 2, 4> lsst::geom::LinearTransform::TransformDerivativeMatrix

Definition at line 74 of file LinearTransform.h.

Member Enumeration Documentation

◆ Parameters

Enumerator
XX 
YX 
XY 
YY 

Definition at line 71 of file LinearTransform.h.

Constructor & Destructor Documentation

◆ LinearTransform() [1/4]

lsst::geom::LinearTransform::LinearTransform ( )
inlinenoexcept

Construct an empty (identity) LinearTransform.

Definition at line 80 of file LinearTransform.h.

◆ LinearTransform() [2/4]

lsst::geom::LinearTransform::LinearTransform ( Matrix const &  matrix)
inlineexplicitnoexcept

Construct an LinearTransform from an Eigen::Matrix.

Definition at line 83 of file LinearTransform.h.

◆ LinearTransform() [3/4]

lsst::geom::LinearTransform::LinearTransform ( LinearTransform const &  other)
inlinenoexcept

Definition at line 86 of file LinearTransform.h.

◆ LinearTransform() [4/4]

lsst::geom::LinearTransform::LinearTransform ( LinearTransform &&  other)
inlinenoexcept

Definition at line 87 of file LinearTransform.h.

◆ ~LinearTransform()

lsst::geom::LinearTransform::~LinearTransform ( )
defaultnoexcept

Member Function Documentation

◆ computeDeterminant()

double lsst::geom::LinearTransform::computeDeterminant ( ) const
noexcept

Return the determinant of the 2x2 matrix.

Definition at line 54 of file LinearTransform.cc.

◆ dTransform() [1/2]

LinearTransform::TransformDerivativeMatrix lsst::geom::LinearTransform::dTransform ( Point2D const &  input) const
noexcept

Derivative of (*this)(input) with respect to the transform elements (for Point).

Definition at line 56 of file LinearTransform.cc.

◆ dTransform() [2/2]

TransformDerivativeMatrix lsst::geom::LinearTransform::dTransform ( Extent2D const &  input) const
inlinenoexcept

Derivative of (*this)(input) with respect to the transform elements (for Extent);.

Definition at line 199 of file LinearTransform.h.

◆ getMatrix() [1/2]

Matrix const& lsst::geom::LinearTransform::getMatrix ( ) const
inlinenoexcept

Definition at line 151 of file LinearTransform.h.

◆ getMatrix() [2/2]

Matrix& lsst::geom::LinearTransform::getMatrix ( )
inlinenoexcept

Definition at line 152 of file LinearTransform.h.

◆ getParameterVector()

LinearTransform::ParameterVector const lsst::geom::LinearTransform::getParameterVector ( ) const
noexcept

Return the transform matrix elements as a parameter vector.

The elements will be ordered XX, YX, XY, YY

Definition at line 32 of file LinearTransform.cc.

◆ invert()

LinearTransform const lsst::geom::LinearTransform::invert ( ) const
inline

Return the inverse transform.

Deprecated:
invert is deprecated in favor of inverted
Exceptions
lsst::geom::SingularTransformExceptionif not invertible

Definition at line 166 of file LinearTransform.h.

◆ inverted()

LinearTransform const lsst::geom::LinearTransform::inverted ( ) const

Return the inverse transform.

Deprecated:
invert is deprecated in favor of inverted
Exceptions
lsst::geom::SingularTransformExceptionif not invertible

Definition at line 45 of file LinearTransform.cc.

◆ isIdentity()

bool lsst::geom::LinearTransform::isIdentity ( ) const
inlinenoexcept

Whether the transform is a no-op.

Definition at line 175 of file LinearTransform.h.

◆ makeRotation()

static LinearTransform lsst::geom::LinearTransform::makeRotation ( Angle  t)
inlinestaticnoexcept

Definition at line 102 of file LinearTransform.h.

◆ makeScaling() [1/2]

static LinearTransform lsst::geom::LinearTransform::makeScaling ( double  s)
inlinestaticnoexcept

Definition at line 94 of file LinearTransform.h.

◆ makeScaling() [2/2]

static LinearTransform lsst::geom::LinearTransform::makeScaling ( double  s,
double  t 
)
inlinestaticnoexcept

Definition at line 98 of file LinearTransform.h.

◆ operator()() [1/2]

Point2D lsst::geom::LinearTransform::operator() ( Point2D const &  p) const
inlinenoexcept

Transform a Point2D object.

This operation is equivalent to applying the LinearTransform to an lsst::geom::Extent

Definition at line 183 of file LinearTransform.h.

◆ operator()() [2/2]

Extent2D lsst::geom::LinearTransform::operator() ( Extent2D const &  p) const
inlinenoexcept

Transform a Extent2D object.

This operation is equivalent to applying the LinearTransform to an lsst::geom::Point

Definition at line 191 of file LinearTransform.h.

◆ operator*()

LinearTransform lsst::geom::LinearTransform::operator* ( LinearTransform const &  other) const
inlinenoexcept

Definition at line 90 of file LinearTransform.h.

◆ operator+()

LinearTransform lsst::geom::LinearTransform::operator+ ( LinearTransform const &  other)
inlinenoexcept

Definition at line 121 of file LinearTransform.h.

◆ operator+=()

LinearTransform& lsst::geom::LinearTransform::operator+= ( LinearTransform const &  other)
inlinenoexcept

Definition at line 116 of file LinearTransform.h.

◆ operator-()

LinearTransform lsst::geom::LinearTransform::operator- ( LinearTransform const &  other)
inlinenoexcept

Definition at line 132 of file LinearTransform.h.

◆ operator-=()

LinearTransform& lsst::geom::LinearTransform::operator-= ( LinearTransform const &  other)
inlinenoexcept

Definition at line 127 of file LinearTransform.h.

◆ operator=() [1/2]

LinearTransform& lsst::geom::LinearTransform::operator= ( LinearTransform const &  other)
inlinenoexcept

Definition at line 107 of file LinearTransform.h.

◆ operator=() [2/2]

LinearTransform& lsst::geom::LinearTransform::operator= ( LinearTransform &&  other)
inlinenoexcept

Definition at line 111 of file LinearTransform.h.

◆ operator[]() [1/2]

double& lsst::geom::LinearTransform::operator[] ( int  i)
inline

Definition at line 154 of file LinearTransform.h.

◆ operator[]() [2/2]

double const& lsst::geom::LinearTransform::operator[] ( int  i) const
inline

Definition at line 155 of file LinearTransform.h.

◆ setParameterVector()

void lsst::geom::LinearTransform::setParameterVector ( LinearTransform::ParameterVector const &  vector)
noexcept

Set the transform matrix elements from a parameter vector.

The parameter vector is ordered XX, YX, XY, YY

Definition at line 38 of file LinearTransform.cc.


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