Lines Matching +full:max +full:- +full:parallel
4 * Use of this source code is governed by a BSD-style license that can be
12 void SkIntersections::cleanUpParallelLines(bool parallel) { in cleanUpParallelLines() argument
16 if (fUsed == 2 && !parallel) { in cleanUpParallelLines()
43 SkDVector aLen = a[1] - a[0]; in intersectRay()
44 SkDVector bLen = b[1] - b[0]; in intersectRay()
49 byLen * axLen - ayLen * bxLen == 0 ( == denom ) in intersectRay()
51 double denom = bLen.fY * aLen.fX - aLen.fY * bLen.fX; in intersectRay()
54 SkDVector ab0 = a[0] - b[0]; in intersectRay()
55 double numerA = ab0.fY * bLen.fX - bLen.fY * ab0.fX; in intersectRay()
56 double numerB = ab0.fY * aLen.fX - aLen.fY * ab0.fX; in intersectRay()
64 ay - ax * ayLen / axLen == by - bx * ayLen / axLen in intersectRay()
65 axLen * (ay - ax * ayLen / axLen) == axLen * (by - bx * ayLen / axLen) in intersectRay()
66 axLen * ay - ax * ayLen == axLen * by - bx * ayLen in intersectRay()
68 if (!AlmostEqualUlps(aLen.fX * a[0].fY - aLen.fY * a[0].fX, in intersectRay()
69 aLen.fX * b[0].fY - aLen.fY * b[0].fX)) { in intersectRay()
99 double axLen = a[1].fX - a[0].fX; in intersect()
100 double ayLen = a[1].fY - a[0].fY; in intersect()
101 double bxLen = b[1].fX - b[0].fX; in intersect()
102 double byLen = b[1].fY - b[0].fY; in intersect()
107 byLen * axLen - ayLen * bxLen == 0 ( == denom ) in intersect()
111 // detect parallel lines the same way here and in SkOpAngle operator < in intersect()
112 // so that non-parallel means they are also sortable in intersect()
116 double ab0y = a[0].fY - b[0].fY; in intersect()
117 double ab0x = a[0].fX - b[0].fX; in intersect()
118 double numerA = ab0y * bxLen - byLen * ab0x; in intersect()
119 double numerB = ab0y * axLen - ayLen * ab0x; in intersect()
120 double denom = axByLen - ayBxLen; in intersect()
127 /* Allow tracking that both sets of end points are near each other -- the lines are entirely in intersect()
128 coincident -- even when the end points are not exactly the same. in intersect()
159 aNearB[iA] = -1; in intersect()
160 bNearA[nearer] = -1; in intersect()
161 nearCount -= 2; in intersect()
185 double max = line[1].fY; in horizontal_coincident() local
186 if (min > max) { in horizontal_coincident()
188 swap(min, max); in horizontal_coincident()
190 if (min > y || max < y) { in horizontal_coincident()
193 if (AlmostEqualUlps(min, max) && max - min < fabs(line[0].fX - line[1].fX)) { in horizontal_coincident()
201 return SkPinT((y - line[0].fY) / (line[1].fY - line[0].fY)); in HorizontalIntercept()
206 fMax = 3; // clean up parallel at the end will limit the result to 2 at the most in horizontal()
220 insert((double) index, flipped ? 1 - t : t, line[index]); in horizontal()
227 double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX); in horizontal()
229 fT[1][0] = (xIntercept - left) / (right - left); in horizontal()
231 // OPTIMIZATION: ? instead of swapping, pass original line, use [1].fX - [0].fX in horizontal()
233 fT[1][index] = 1 - fT[1][index]; in horizontal()
252 insert((double) index, flipped ? 1 - t : t, line[index]); in horizontal()
263 double max = line[1].fX; in vertical_coincident() local
264 if (min > max) { in vertical_coincident()
266 swap(min, max); in vertical_coincident()
268 if (!precisely_between(min, x, max)) { in vertical_coincident()
271 if (AlmostEqualUlps(min, max)) { in vertical_coincident()
279 return SkPinT((x - line[0].fX) / (line[1].fX - line[0].fX)); in VerticalIntercept()
284 fMax = 3; // cleanup parallel lines will bring this back line in vertical()
298 insert((double) index, flipped ? 1 - t : t, line[index]); in vertical()
305 double yIntercept = line[0].fY + fT[0][0] * (line[1].fY - line[0].fY); in vertical()
307 fT[1][0] = (yIntercept - top) / (bottom - top); in vertical()
309 // OPTIMIZATION: instead of swapping, pass original line, use [1].fY - [0].fY in vertical()
311 fT[1][index] = 1 - fT[1][index]; in vertical()
330 insert((double) index, flipped ? 1 - t : t, line[index]); in vertical()