static void pointFinder(const SkDQuad& q1, const SkDQuad& q2) { for (int index = 0; index < 3; ++index) { double t = q1.nearestT(q2[index]); SkDPoint onQuad = q1.ptAtT(t); SkDebugf("%s t=%1.9g (%1.9g,%1.9g) dist=%1.9g\n", __FUNCTION__, t, onQuad.fX, onQuad.fY, onQuad.distance(q2[index])); double left[3]; left[0] = ((const SkDLine&) q1[0]).isLeft(q2[index]); left[1] = ((const SkDLine&) q1[1]).isLeft(q2[index]); SkDLine diag = {{q1[0], q1[2]}}; left[2] = diag.isLeft(q2[index]); SkDebugf("%s left=(%d, %d, %d) inHull=%s\n", __FUNCTION__, floatSign(left[0]), floatSign(left[1]), floatSign(left[2]), q1.pointInHull(q2[index]) ? "true" : "false"); } SkDebugf("\n"); }
static void pointFinder(const Quadratic& q1, const Quadratic& q2) { for (int index = 0; index < 3; ++index) { double t = nearestT(q1, q2[index]); _Point onQuad; xy_at_t(q1, t, onQuad.x, onQuad.y); SkDebugf("%s t=%1.9g (%1.9g,%1.9g) dist=%1.9g\n", __FUNCTION__, t, onQuad.x, onQuad.y, onQuad.distance(q2[index])); double left[3]; left[0] = is_left((const _Line&) q1[0], q2[index]); left[1] = is_left((const _Line&) q1[1], q2[index]); _Line diag = {q1[0], q1[2]}; left[2] = is_left(diag, q2[index]); SkDebugf("%s left=(%d, %d, %d) inHull=%s\n", __FUNCTION__, floatSign(left[0]), floatSign(left[1]), floatSign(left[2]), point_in_hull(q1, q2[index]) ? "true" : "false"); } SkDebugf("\n"); }