caryclark@google.com | f47c217 | 2012-03-27 13:45:24 +0000 | [diff] [blame] | 1 | // included by QuadraticParameterization.cpp |
| 2 | // accesses internal functions to validate parameterized coefficients |
| 3 | |
| 4 | #include "Parameterization_Test.h" |
| 5 | |
| 6 | bool point_on_parameterized_curve(const Quadratic& quad, const _Point& point) { |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 7 | 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.com | f47c217 | 2012-03-27 13:45:24 +0000 | [diff] [blame] | 14 | double sum = xx + xy + yy + x + y + c; |
| 15 | return approximately_zero(sum); |
| 16 | } |