mod_geo-tp/src/quad_patch.cpp

26 lines
498 B
C++
Raw Normal View History

2021-11-12 17:08:19 +01:00
#include "quad_patch.h"
2021-11-12 20:53:13 +01:00
QuadPatch::QuadPatch() {}
QuadPatch::QuadPatch(const Vector5d coefficients, const Transform transform)
:_coefficients(coefficients),
_transform(transform),
_inverse_transform(transform.inverse()) {
}
double QuadPatch::operator()(double x, double y) {
return _coefficients[0] * x*x
+ _coefficients[1] * x*y
+ _coefficients[2] * y*y
+ _coefficients[3] * x
+ _coefficients[4] * y;
}
double QuadPatch::operator[](size_t i) {
return _coefficients[i];
2021-11-12 17:08:19 +01:00
}