skia2/experimental/Intersection/QuadraticUtilities.h
caryclark@google.com 9e49fb63d3 shape ops work in progress
add copyrights everywhere
start working on quadratic line segments (for quad intersection)

git-svn-id: http://skia.googlecode.com/svn/trunk@5286 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-27 14:11:33 +00:00

29 lines
815 B
C

/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "DataTypes.h"
void dxdy_at_t(const Quadratic& , double t, double& x, double& y);
/* Parameterization form, given A*t*t + 2*B*t*(1-t) + C*(1-t)*(1-t)
*
* a = A - 2*B + C
* b = 2*B - 2*C
* c = C
*/
inline void set_abc(const double* quad, double& a, double& b, double& c) {
a = quad[0]; // a = A
b = 2 * quad[2]; // b = 2*B
c = quad[4]; // c = C
b -= c; // b = 2*B - C
a -= b; // a = A - 2*B + C
b -= c; // b = 2*B - 2*C
}
int quadraticRoots(double A, double B, double C, double t[2]);
void xy_at_t(const Quadratic& , double t, double& x, double& y);