skia2/experimental/Intersection/QuadraticParameterization_TestUtility.cpp
caryclark@google.com 235f56a92f shape ops work in progress
add quartic solution for intersecting quadratics

git-svn-id: http://skia.googlecode.com/svn/trunk@5541 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-09-14 14:19:30 +00:00

17 lines
570 B
C++

// included by QuadraticParameterization.cpp
// accesses internal functions to validate parameterized coefficients
#include "Parameterization_Test.h"
bool point_on_parameterized_curve(const Quadratic& quad, const _Point& point) {
QuadImplicitForm q(quad);
double xx = q.x2() * point.x * point.x;
double xy = q.xy() * point.x * point.y;
double yy = q.y2() * point.y * point.y;
double x = q.x() * point.x;
double y = q.y() * point.y;
double c = q.c();
double sum = xx + xy + yy + x + y + c;
return approximately_zero(sum);
}