22 #ifndef LSST_AFW_MATH_POLYNOMIALS_Scaling1d_h_INCLUDED
23 #define LSST_AFW_MATH_POLYNOMIALS_Scaling1d_h_INCLUDED
26 namespace lsst {
namespace geom {
namespace polynomials {
80 return y/_scale - _shift;
84 double getScale() const noexcept {
return _scale; }
87 double getShift() const noexcept {
return _shift; }
97 return Scaling1d(1.0/_scale, -_shift*_scale);
121 return Scaling1d(2.0/(max - min), -0.5*(min + max));
A 1-d affine transform that can be used to map one interval to another.
Scaling1d then(Scaling1d const &second) const noexcept
Compose two transforms.
double applyForward(double x) const noexcept
Apply the transform in the forward direction.
Scaling1d(Scaling1d const &) noexcept=default
Default copy constructor.
Scaling1d(double scale, double shift) noexcept
Construct from the given multiplicative scale and additive shift.
Scaling1d inverted() const noexcept
Invert the transform.
double getShift() const noexcept
Return the additive shift.
double getScale() const noexcept
Return the multiplicative scaling.
Scaling1d(Scaling1d &&) noexcept=default
Default move constructor.
double applyInverse(double y) const noexcept
Apply the inverse of the forward transform;.
Scaling1d makeUnitRangeScaling1d(double min, double max) noexcept
Return a Scaling1d that maps the interval [min, max] to [-1, 1].