27accef223
Review URL: https://codereview.appspot.com/5576043 git-svn-id: http://skia.googlecode.com/svn/trunk@3087 2bbb7eff-a529-9590-31e7-b0007b416f81
16 lines
646 B
C++
16 lines
646 B
C++
// included by QuadraticParameterization.cpp
|
|
// accesses internal functions to validate parameterized coefficients
|
|
|
|
bool point_on_parameterized_curve(const Quadratic& quad, const _Point& point) {
|
|
double coeffs[coeff_count];
|
|
implicit_coefficients(quad, coeffs);
|
|
double xx = coeffs[ xx_coeff] * point.x * point.x;
|
|
double xy = coeffs[ xy_coeff] * point.x * point.y;
|
|
double yy = coeffs[ yy_coeff] * point.y * point.y;
|
|
double x = coeffs[ x_coeff] * point.x;
|
|
double y = coeffs[ y_coeff] * point.y;
|
|
double c = coeffs[ c_coeff];
|
|
double sum = xx + xy + yy + x + y + c;
|
|
return approximately_zero(sum);
|
|
}
|