blob: 7c91eb5e8b679b7393f00fa6fedc614bfd0c4024 [file] [log] [blame]
caryclark@google.comf47c2172012-03-27 13:45:24 +00001// included by QuadraticParameterization.cpp
2// accesses internal functions to validate parameterized coefficients
3
4#include "Parameterization_Test.h"
5
6bool point_on_parameterized_curve(const Quadratic& quad, const _Point& point) {
caryclark@google.com235f56a2012-09-14 14:19:30 +00007 QuadImplicitForm q(quad);
8 double xx = q.x2() * point.x * point.x;
9 double xy = q.xy() * point.x * point.y;
10 double yy = q.y2() * point.y * point.y;
11 double x = q.x() * point.x;
12 double y = q.y() * point.y;
13 double c = q.c();
caryclark@google.comf47c2172012-03-27 13:45:24 +000014 double sum = xx + xy + yy + x + y + c;
15 return approximately_zero(sum);
16}