lsst.afw  14.0-35-g29d3a87a7
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::geom::LinearTransform Class Reference

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

Static Public Member Functions

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

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 71 of file LinearTransform.h.

Member Typedef Documentation

◆ Matrix

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

Definition at line 79 of file LinearTransform.h.

◆ ParameterVector

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

Definition at line 75 of file LinearTransform.h.

◆ ProductDerivativeMatrix

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

Definition at line 77 of file LinearTransform.h.

◆ TransformDerivativeMatrix

Definition at line 76 of file LinearTransform.h.

Member Enumeration Documentation

◆ Parameters

Enumerator
XX 
YX 
XY 
YY 

Definition at line 73 of file LinearTransform.h.

Constructor & Destructor Documentation

◆ LinearTransform() [1/2]

lsst::afw::geom::LinearTransform::LinearTransform ( )
inline

Construct an empty (identity) LinearTransform.

Definition at line 82 of file LinearTransform.h.

◆ LinearTransform() [2/2]

lsst::afw::geom::LinearTransform::LinearTransform ( Matrix const &  matrix)
inlineexplicit

Construct an LinearTransform from an Eigen::Matrix.

Definition at line 85 of file LinearTransform.h.

Member Function Documentation

◆ computeDeterminant()

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

Return the determinant of the 2x2 matrix.

◆ dTransform() [1/2]

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

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

◆ dTransform() [2/2]

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

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

Definition at line 186 of file LinearTransform.h.

◆ getMatrix() [1/2]

Matrix const& lsst::afw::geom::LinearTransform::getMatrix ( ) const
inline

Definition at line 143 of file LinearTransform.h.

◆ getMatrix() [2/2]

Matrix& lsst::afw::geom::LinearTransform::getMatrix ( )
inline

Definition at line 144 of file LinearTransform.h.

◆ getParameterVector()

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

Return the transform matrix elements as a parameter vector.

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

◆ invert()

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

Return the inverse transform.

Exceptions
lsst::afw::geom::SingularTransformException

◆ isIdentity()

bool lsst::afw::geom::LinearTransform::isIdentity ( ) const
inline

Whether the transform is a no-op.

Definition at line 162 of file LinearTransform.h.

◆ makeRotation()

static LinearTransform lsst::afw::geom::LinearTransform::makeRotation ( Angle  t)
inlinestatic

Definition at line 99 of file LinearTransform.h.

◆ makeScaling() [1/2]

static LinearTransform lsst::afw::geom::LinearTransform::makeScaling ( double  s)
inlinestatic

Definition at line 91 of file LinearTransform.h.

◆ makeScaling() [2/2]

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

Definition at line 95 of file LinearTransform.h.

◆ operator()() [1/2]

Point2D lsst::afw::geom::LinearTransform::operator() ( Point2D const &  p) const
inline

Transform a Point2D object.

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

Definition at line 170 of file LinearTransform.h.

◆ operator()() [2/2]

Extent2D lsst::afw::geom::LinearTransform::operator() ( Extent2D const &  p) const
inline

Transform a Extent2D object.

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

Definition at line 178 of file LinearTransform.h.

◆ operator*()

LinearTransform lsst::afw::geom::LinearTransform::operator* ( LinearTransform const &  other) const
inline

Definition at line 87 of file LinearTransform.h.

◆ operator+()

LinearTransform lsst::afw::geom::LinearTransform::operator+ ( LinearTransform const &  other)
inline

Definition at line 113 of file LinearTransform.h.

◆ operator+=()

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

Definition at line 108 of file LinearTransform.h.

◆ operator-()

LinearTransform lsst::afw::geom::LinearTransform::operator- ( LinearTransform const &  other)
inline

Definition at line 124 of file LinearTransform.h.

◆ operator-=()

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

Definition at line 119 of file LinearTransform.h.

◆ operator=()

LinearTransform& lsst::afw::geom::LinearTransform::operator= ( LinearTransform const &  other)
inline

Definition at line 103 of file LinearTransform.h.

◆ operator[]() [1/2]

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

Definition at line 146 of file LinearTransform.h.

◆ operator[]() [2/2]

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

Definition at line 147 of file LinearTransform.h.

◆ setParameterVector()

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

Set the transform matrix elements from a parameter vector.

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


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