save work in progress
git-svn-id: http://skia.googlecode.com/svn/trunk@3141 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Intersection/LineUtilities.cpp b/experimental/Intersection/LineUtilities.cpp
index 9f782b1..f70352a 100644
--- a/experimental/Intersection/LineUtilities.cpp
+++ b/experimental/Intersection/LineUtilities.cpp
@@ -1,14 +1,15 @@
+#include "CurveIntersection.h"
#include "LineUtilities.h"
bool implicitLine(const _Line& line, double& slope, double& axisIntercept) {
- double lineDx = line[1].x - line[0].x;
- double lineDy = line[1].y - line[0].y;
- bool moreHorizontal = fabs(lineDx) > fabs(lineDy);
+ _Point delta;
+ tangent(line, delta);
+ bool moreHorizontal = fabs(delta.x) > fabs(delta.y);
if (moreHorizontal) {
- slope = lineDy / lineDx;
+ slope = delta.y / delta.x;
axisIntercept = line[0].y - slope * line[0].x;
} else {
- slope = lineDx / lineDy;
+ slope = delta.x / delta.y;
axisIntercept = line[0].x - slope * line[0].y;
}
return moreHorizontal;