#ifndef MY_QUAD_H
#define MY_QUAD_H

#include <Eigen/Geometry>


class QuadPatch {
public:
	typedef Eigen::Vector<double, 5> Vector5d;
	typedef Eigen::Transform<double, 3, Eigen::Affine> Transform;

private:
	Vector5d _coefficients; // a₀² + a₁xy + a₂y² + a₃x + a₄y + a₅
	Transform _transform;
	Transform _inverse_transform;

public:
	QuadPatch();
	QuadPatch(const Vector5d coefficients, const Transform transform);
    double operator()(double x, double y);
	double operator[](size_t i);
	constexpr Transform &transform() { return _transform; }
	constexpr Transform &inverse_transform() { return _inverse_transform; }
};


#endif