22 #ifndef LSST_GEOM_LINEAR_TRANSFORM_H 23 #define LSST_GEOM_LINEAR_TRANSFORM_H 26 #include "Eigen/Geometry" 77 typedef Eigen::Matrix<double, 2, 2, Eigen::DontAlign>
Matrix;
86 LinearTransform(LinearTransform
const& other) noexcept : _matrix(other._matrix){};
88 ~LinearTransform() noexcept =
default;
90 LinearTransform
operator*(LinearTransform
const& other)
const noexcept {
91 return LinearTransform(getMatrix() * other.getMatrix());
95 return LinearTransform((Matrix() << s, 0.0, 0.0, s).finished());
98 static LinearTransform
makeScaling(
double s,
double t) noexcept {
99 return LinearTransform((Matrix() << s, 0.0, 0.0, t).finished());
103 return LinearTransform(Matrix(Eigen::Rotation2D<double>(t.asRadians())));
107 LinearTransform&
operator=(LinearTransform
const& other) noexcept {
108 _matrix = other._matrix;
111 LinearTransform&
operator=(LinearTransform&& other) noexcept {
116 LinearTransform&
operator+=(LinearTransform
const& other) noexcept {
117 _matrix += other._matrix;
121 LinearTransform
operator+(LinearTransform
const& other) noexcept {
122 LinearTransform tmp(*
this);
127 LinearTransform&
operator-=(LinearTransform
const& other) noexcept {
128 _matrix -= other._matrix;
132 LinearTransform
operator-(LinearTransform
const& other) noexcept {
133 LinearTransform tmp(*
this);
143 ParameterVector
const getParameterVector()
const noexcept;
149 void setParameterVector(ParameterVector
const& vector) noexcept;
151 Matrix
const&
getMatrix() const noexcept {
return _matrix; }
155 double const&
operator[](
int i)
const {
return const_cast<Matrix&
>(_matrix)(i % 2, i / 2); }
162 LinearTransform
const invert()
const;
167 double computeDeterminant()
const noexcept;
170 bool isIdentity() const noexcept {
return getMatrix().isIdentity(); }
191 TransformDerivativeMatrix dTransform(
Point2D const& input)
const noexcept;
195 return dTransform(
Point2D(input));
207 #endif // !LSST_GEOM_LINEAR_TRANSFORM_H
Relationship invert(Relationship r)
A class representing an angle.
Point< double, 2 > Point2D
std::ostream & operator<<(std::ostream &os, lsst::geom::AffineTransform const &transform)
Extent< double, 2 > Extent2D
#define LSST_EXCEPTION_TYPE(t, b, c)