static AffineTransformation<T, D> scaling(const LinAl::Vector<T, D> &);
static AffineTransformation<T, D> shear(const LinAl::Vector<T, D> &, const LinAl::Vector<T, D> &);
+ AffineTransformation &operator*=(const AffineTransformation &);
+ AffineTransformation &invert();
+
const LinAl::SquareMatrix<T, D+1> &get_matrix() const { return matrix; }
operator const LinAl::SquareMatrix<T, D+1> &() const { return matrix; }
return r;
}
+template<typename T, unsigned D>
+inline AffineTransformation<T, D> &AffineTransformation<T, D>::operator*=(const AffineTransformation<T, D> &other)
+{
+ matrix *= other.get_matrix();
+ return *this;
+}
+
+template<typename T, unsigned D>
+inline AffineTransformation<T, D> operator*(const AffineTransformation<T, D> &at1, const AffineTransformation<T, D> &at2)
+{
+ AffineTransformation<T, D> r = at1;
+ return r *= at2;
+}
+
+template<typename T, unsigned D>
+inline AffineTransformation<T, D> &AffineTransformation<T, D>::invert()
+{
+ matrix.invert();
+ return *this;
+}
+
+template<typename T, unsigned D>
+inline AffineTransformation<T, D> invert(const AffineTransformation<T, D> &at)
+{
+ AffineTransformation<T, D> r = at;
+ return r.invert();
+}
+
template<typename T, unsigned N>
inline LinAl::Vector<T, N+1> augment_vector(const LinAl::Vector<T, N> &v, T s)