1 Clazz.declarePackage ("jssun.awt.geom");
2 Clazz.load (null, "jssun.awt.geom.Curve", ["java.lang.Double", "$.InternalError", "java.awt.geom.IllegalPathStateException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 Clazz.instantialize (this, arguments);
6 }, jssun.awt.geom, "Curve");
7 c$.insertMove = Clazz.defineMethod (c$, "insertMove",
8 function (curves, x, y) {
9 curves.add ( new jssun.awt.geom.Order0 (x, y));
10 }, "java.util.Vector,~N,~N");
11 c$.insertLine = Clazz.defineMethod (c$, "insertLine",
12 function (curves, x0, y0, x1, y1) {
14 curves.add ( new jssun.awt.geom.Order1 (x0, y0, x1, y1, 1));
16 curves.add ( new jssun.awt.geom.Order1 (x1, y1, x0, y0, -1));
18 }}, "java.util.Vector,~N,~N,~N,~N");
19 c$.insertQuad = Clazz.defineMethod (c$, "insertQuad",
20 function (curves, x0, y0, coords) {
23 jssun.awt.geom.Order2.insert (curves, coords, coords[2], y1, coords[0], coords[1], x0, y0, -1);
24 } else if (y0 == y1 && y0 == coords[1]) {
27 jssun.awt.geom.Order2.insert (curves, coords, x0, y0, coords[0], coords[1], coords[2], y1, 1);
28 }}, "java.util.Vector,~N,~N,~A");
29 c$.insertCubic = Clazz.defineMethod (c$, "insertCubic",
30 function (curves, x0, y0, coords) {
33 jssun.awt.geom.Order3.insert (curves, coords, coords[4], y1, coords[2], coords[3], coords[0], coords[1], x0, y0, -1);
34 } else if (y0 == y1 && y0 == coords[1] && y0 == coords[3]) {
37 jssun.awt.geom.Order3.insert (curves, coords, x0, y0, coords[0], coords[1], coords[2], coords[3], coords[4], y1, 1);
38 }}, "java.util.Vector,~N,~N,~A");
39 c$.pointCrossingsForPath = Clazz.defineMethod (c$, "pointCrossingsForPath",
40 function (pi, px, py) {
43 }var coords = Clazz.newDoubleArray (6, 0);
44 if (pi.currentSegment (coords) != 0) {
45 throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition");
54 while (!pi.isDone ()) {
55 switch (pi.currentSegment (coords)) {
58 crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy);
59 }movx = curx = coords[0];
60 movy = cury = coords[1];
65 crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, endx, endy);
72 crossings += jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, curx, cury, coords[0], coords[1], endx, endy, 0);
79 crossings += jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0);
85 crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy);
93 crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy);
95 }, "java.awt.geom.PathIterator,~N,~N");
96 c$.pointCrossingsForLine = Clazz.defineMethod (c$, "pointCrossingsForLine",
97 function (px, py, x0, y0, x1, y1) {
98 if (py < y0 && py < y1) return 0;
99 if (py >= y0 && py >= y1) return 0;
100 if (px >= x0 && px >= x1) return 0;
101 if (px < x0 && px < x1) return (y0 < y1) ? 1 : -1;
102 var xintercept = x0 + (py - y0) * (x1 - x0) / (y1 - y0);
103 if (px >= xintercept) return 0;
104 return (y0 < y1) ? 1 : -1;
105 }, "~N,~N,~N,~N,~N,~N");
106 c$.pointCrossingsForQuad = Clazz.defineMethod (c$, "pointCrossingsForQuad",
107 function (px, py, x0, y0, xc, yc, x1, y1, level) {
108 if (py < y0 && py < yc && py < y1) return 0;
109 if (py >= y0 && py >= yc && py >= y1) return 0;
110 if (px >= x0 && px >= xc && px >= x1) return 0;
111 if (px < x0 && px < xc && px < x1) {
113 if (py < y1) return 1;
115 if (py >= y1) return -1;
117 }if (level > 52) return jssun.awt.geom.Curve.pointCrossingsForLine (px, py, x0, y0, x1, y1);
118 var x0c = (x0 + xc) / 2;
119 var y0c = (y0 + yc) / 2;
120 var xc1 = (xc + x1) / 2;
121 var yc1 = (yc + y1) / 2;
122 xc = (x0c + xc1) / 2;
123 yc = (y0c + yc1) / 2;
124 if (Double.isNaN (xc) || Double.isNaN (yc)) {
126 }return (jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, x0, y0, x0c, y0c, xc, yc, level + 1) + jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, xc, yc, xc1, yc1, x1, y1, level + 1));
127 }, "~N,~N,~N,~N,~N,~N,~N,~N,~N");
128 c$.pointCrossingsForCubic = Clazz.defineMethod (c$, "pointCrossingsForCubic",
129 function (px, py, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) {
130 if (py < y0 && py < yc0 && py < yc1 && py < y1) return 0;
131 if (py >= y0 && py >= yc0 && py >= yc1 && py >= y1) return 0;
132 if (px >= x0 && px >= xc0 && px >= xc1 && px >= x1) return 0;
133 if (px < x0 && px < xc0 && px < xc1 && px < x1) {
135 if (py < y1) return 1;
137 if (py >= y1) return -1;
139 }if (level > 52) return jssun.awt.geom.Curve.pointCrossingsForLine (px, py, x0, y0, x1, y1);
140 var xmid = (xc0 + xc1) / 2;
141 var ymid = (yc0 + yc1) / 2;
142 xc0 = (x0 + xc0) / 2;
143 yc0 = (y0 + yc0) / 2;
144 xc1 = (xc1 + x1) / 2;
145 yc1 = (yc1 + y1) / 2;
146 var xc0m = (xc0 + xmid) / 2;
147 var yc0m = (yc0 + ymid) / 2;
148 var xmc1 = (xmid + xc1) / 2;
149 var ymc1 = (ymid + yc1) / 2;
150 xmid = (xc0m + xmc1) / 2;
151 ymid = (yc0m + ymc1) / 2;
152 if (Double.isNaN (xmid) || Double.isNaN (ymid)) {
154 }return (jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1) + jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1));
155 }, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N");
156 c$.rectCrossingsForPath = Clazz.defineMethod (c$, "rectCrossingsForPath",
157 function (pi, rxmin, rymin, rxmax, rymax) {
158 if (rxmax <= rxmin || rymax <= rymin) {
162 }var coords = Clazz.newDoubleArray (6, 0);
163 if (pi.currentSegment (coords) != 0) {
164 throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition");
172 curx = movx = coords[0];
173 cury = movy = coords[1];
175 while (crossings != -2147483648 && !pi.isDone ()) {
176 switch (pi.currentSegment (coords)) {
178 if (curx != movx || cury != movy) {
179 crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy);
180 }movx = curx = coords[0];
181 movy = cury = coords[1];
186 crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, endx, endy);
193 crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], endx, endy, 0);
200 crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0);
205 if (curx != movx || cury != movy) {
206 crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy);
213 if (crossings != -2147483648 && (curx != movx || cury != movy)) {
214 crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy);
216 }, "java.awt.geom.PathIterator,~N,~N,~N,~N");
217 c$.rectCrossingsForLine = Clazz.defineMethod (c$, "rectCrossingsForLine",
218 function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1) {
219 if (y0 >= rymax && y1 >= rymax) return crossings;
220 if (y0 <= rymin && y1 <= rymin) return crossings;
221 if (x0 <= rxmin && x1 <= rxmin) return crossings;
222 if (x0 >= rxmax && x1 >= rxmax) {
224 if (y0 <= rymin) crossings++;
225 if (y1 >= rymax) crossings++;
226 } else if (y1 < y0) {
227 if (y1 <= rymin) crossings--;
228 if (y0 >= rymax) crossings--;
230 }if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) {
234 xi0 += ((rymin - y0) * (x1 - x0) / (y1 - y0));
235 } else if (y0 > rymax) {
236 xi0 += ((rymax - y0) * (x1 - x0) / (y1 - y0));
239 xi1 += ((rymin - y1) * (x0 - x1) / (y0 - y1));
240 } else if (y1 > rymax) {
241 xi1 += ((rymax - y1) * (x0 - x1) / (y0 - y1));
242 }if (xi0 <= rxmin && xi1 <= rxmin) return crossings;
243 if (xi0 >= rxmax && xi1 >= rxmax) {
245 if (y0 <= rymin) crossings++;
246 if (y1 >= rymax) crossings++;
247 } else if (y1 < y0) {
248 if (y1 <= rymin) crossings--;
249 if (y0 >= rymax) crossings--;
252 }, "~N,~N,~N,~N,~N,~N,~N,~N,~N");
253 c$.rectCrossingsForQuad = Clazz.defineMethod (c$, "rectCrossingsForQuad",
254 function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc, yc, x1, y1, level) {
255 if (y0 >= rymax && yc >= rymax && y1 >= rymax) return crossings;
256 if (y0 <= rymin && yc <= rymin && y1 <= rymin) return crossings;
257 if (x0 <= rxmin && xc <= rxmin && x1 <= rxmin) return crossings;
258 if (x0 >= rxmax && xc >= rxmax && x1 >= rxmax) {
260 if (y0 <= rymin && y1 > rymin) crossings++;
261 if (y0 < rymax && y1 >= rymax) crossings++;
262 } else if (y1 < y0) {
263 if (y1 <= rymin && y0 > rymin) crossings--;
264 if (y1 < rymax && y0 >= rymax) crossings--;
266 }if ((x0 < rxmax && x0 > rxmin && y0 < rymax && y0 > rymin) || (x1 < rxmax && x1 > rxmin && y1 < rymax && y1 > rymin)) {
269 return jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1);
270 }var x0c = (x0 + xc) / 2;
271 var y0c = (y0 + yc) / 2;
272 var xc1 = (xc + x1) / 2;
273 var yc1 = (yc + y1) / 2;
274 xc = (x0c + xc1) / 2;
275 yc = (y0c + yc1) / 2;
276 if (Double.isNaN (xc) || Double.isNaN (yc)) {
278 }crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x0c, y0c, xc, yc, level + 1);
279 if (crossings != -2147483648) {
280 crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, xc, yc, xc1, yc1, x1, y1, level + 1);
282 }, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N");
283 c$.rectCrossingsForCubic = Clazz.defineMethod (c$, "rectCrossingsForCubic",
284 function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) {
285 if (y0 >= rymax && yc0 >= rymax && yc1 >= rymax && y1 >= rymax) {
287 }if (y0 <= rymin && yc0 <= rymin && yc1 <= rymin && y1 <= rymin) {
289 }if (x0 <= rxmin && xc0 <= rxmin && xc1 <= rxmin && x1 <= rxmin) {
291 }if (x0 >= rxmax && xc0 >= rxmax && xc1 >= rxmax && x1 >= rxmax) {
293 if (y0 <= rymin && y1 > rymin) crossings++;
294 if (y0 < rymax && y1 >= rymax) crossings++;
295 } else if (y1 < y0) {
296 if (y1 <= rymin && y0 > rymin) crossings--;
297 if (y1 < rymax && y0 >= rymax) crossings--;
299 }if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) {
302 return jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1);
303 }var xmid = (xc0 + xc1) / 2;
304 var ymid = (yc0 + yc1) / 2;
305 xc0 = (x0 + xc0) / 2;
306 yc0 = (y0 + yc0) / 2;
307 xc1 = (xc1 + x1) / 2;
308 yc1 = (yc1 + y1) / 2;
309 var xc0m = (xc0 + xmid) / 2;
310 var yc0m = (yc0 + ymid) / 2;
311 var xmc1 = (xmid + xc1) / 2;
312 var ymc1 = (ymid + yc1) / 2;
313 xmid = (xc0m + xmc1) / 2;
314 ymid = (yc0m + ymc1) / 2;
315 if (Double.isNaN (xmid) || Double.isNaN (ymid)) {
317 }crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1);
318 if (crossings != -2147483648) {
319 crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1);
321 }, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N");
322 Clazz.makeConstructor (c$,
323 function (direction) {
324 this.direction = direction;
326 Clazz.defineMethod (c$, "getDirection",
328 return this.direction;
330 Clazz.defineMethod (c$, "getWithDirection",
331 function (direction) {
332 return (this.direction == direction ? this : this.getReversedCurve ());
334 c$.round = Clazz.defineMethod (c$, "round",
338 c$.orderof = Clazz.defineMethod (c$, "orderof",
346 c$.signeddiffbits = Clazz.defineMethod (c$, "signeddiffbits",
348 return (Double.doubleToLongBits (y1) - Double.doubleToLongBits (y2));
350 c$.diffbits = Clazz.defineMethod (c$, "diffbits",
352 return Math.abs (Double.doubleToLongBits (y1) - Double.doubleToLongBits (y2));
354 c$.prev = Clazz.defineMethod (c$, "prev",
356 return Double.longBitsToDouble (Double.doubleToLongBits (v) - 1);
358 c$.next = Clazz.defineMethod (c$, "next",
360 return Double.longBitsToDouble (Double.doubleToLongBits (v) + 1);
362 Clazz.overrideMethod (c$, "toString",
364 return ("Curve[" + this.getOrder () + ", " + ("(" + jssun.awt.geom.Curve.round (this.getX0 ()) + ", " + jssun.awt.geom.Curve.round (this.getY0 ()) + "), ") + this.controlPointString () + ("(" + jssun.awt.geom.Curve.round (this.getX1 ()) + ", " + jssun.awt.geom.Curve.round (this.getY1 ()) + "), ") + (this.direction == 1 ? "D" : "U") + "]");
366 Clazz.defineMethod (c$, "controlPointString",
370 Clazz.defineMethod (c$, "crossingsFor",
372 if (y >= this.getYTop () && y < this.getYBot ()) {
373 if (x < this.getXMax () && (x < this.getXMin () || x < this.XforY (y))) {
377 Clazz.defineMethod (c$, "accumulateCrossings",
379 var xhi = c.getXHi ();
380 if (this.getXMin () >= xhi) {
382 }var xlo = c.getXLo ();
383 var ylo = c.getYLo ();
384 var yhi = c.getYHi ();
385 var y0 = this.getYTop ();
386 var y1 = this.getYBot ();
395 tstart = this.TforY (ylo);
403 tend = this.TforY (yhi);
410 var x = this.XforT (tstart);
412 if (hitHi || x > xlo) {
419 }if (tstart >= tend) {
421 }tstart = this.nextVertical (tstart, tend);
424 c.record (ystart, yend, this.direction);
426 }, "jssun.awt.geom.Crossings");
427 Clazz.defineMethod (c$, "getSubCurve",
428 function (ystart, yend) {
429 return this.getSubCurve (ystart, yend, this.direction);
431 Clazz.defineMethod (c$, "compareTo",
432 function (that, yrange) {
435 y1 = Math.min (Math.min (y1, this.getYBot ()), that.getYBot ());
436 if (y1 <= yrange[0]) {
437 System.err.println ("this == " + this);
438 System.err.println ("that == " + that);
439 System.out.println ("target range = " + yrange[0] + "=>" + yrange[1]);
440 throw new InternalError ("backstepping from " + yrange[0] + " to " + y1);
442 if (this.getXMax () <= that.getXMin ()) {
443 if (this.getXMin () == that.getXMax ()) {
446 }if (this.getXMin () >= that.getXMax ()) {
448 }var s0 = this.TforY (y0);
449 var ys0 = this.YforT (s0);
451 s0 = this.refineTforY (s0, ys0, y0);
452 ys0 = this.YforT (s0);
453 }var s1 = this.TforY (y1);
454 if (this.YforT (s1) < y0) {
455 s1 = this.refineTforY (s1, this.YforT (s1), y0);
456 }var t0 = that.TforY (y0);
457 var yt0 = that.YforT (t0);
459 t0 = that.refineTforY (t0, yt0, y0);
460 yt0 = that.YforT (t0);
461 }var t1 = that.TforY (y1);
462 if (that.YforT (t1) < y0) {
463 t1 = that.refineTforY (t1, that.YforT (t1), y0);
464 }var xs0 = this.XforT (s0);
465 var xt0 = that.XforT (t0);
466 var scale = Math.max (Math.abs (y0), Math.abs (y1));
467 var ymin = Math.max (scale * 1E-14, 1E-300);
468 if (this.fairlyClose (xs0, xt0)) {
470 var maxbump = Math.min (ymin * 1E13, (y1 - y0) * .1);
473 if (this.fairlyClose (this.XforY (y), that.XforY (y))) {
474 if ((bump *= 2) > maxbump) {
483 }if (this.fairlyClose (this.XforY (newy), that.XforY (newy))) {
494 System.out.println ("ymin = " + ymin);
495 }while (s0 < s1 && t0 < t1) {
496 var sh = this.nextVertical (s0, s1);
497 var xsh = this.XforT (sh);
498 var ysh = this.YforT (sh);
499 var th = that.nextVertical (t0, t1);
500 var xth = that.XforT (th);
501 var yth = that.YforT (th);
503 if (this.findIntersect (that, yrange, ymin, 0, 0, s0, xs0, ys0, sh, xsh, ysh, t0, xt0, yt0, th, xth, yth)) {
506 System.err.println ("Error: " + t);
507 System.err.println ("y range was " + yrange[0] + "=>" + yrange[1]);
508 System.err.println ("s y range is " + ys0 + "=>" + ysh);
509 System.err.println ("t y range is " + yt0 + "=>" + yth);
510 System.err.println ("ymin is " + ymin);
514 if (ysh > yrange[0]) {
515 if (ysh < yrange[1]) {
522 if (yth > yrange[0]) {
523 if (yth < yrange[1]) {
530 var ymid = (yrange[0] + yrange[1]) / 2;
531 return jssun.awt.geom.Curve.orderof (this.XforY (ymid), that.XforY (ymid));
532 }, "jssun.awt.geom.Curve,~A");
533 Clazz.defineMethod (c$, "findIntersect",
534 function (that, yrange, ymin, slevel, tlevel, s0, xs0, ys0, s1, xs1, ys1, t0, xt0, yt0, t1, xt1, yt1) {
535 if (ys0 > yt1 || yt0 > ys1) {
537 }if (Math.min (xs0, xs1) > Math.max (xt0, xt1) || Math.max (xs0, xs1) < Math.min (xt0, xt1)) {
539 }if (s1 - s0 > 0.001) {
540 var s = (s0 + s1) / 2;
541 var xs = this.XforT (s);
542 var ys = this.YforT (s);
543 if (s == s0 || s == s1) {
544 System.out.println ("s0 = " + s0);
545 System.out.println ("s1 = " + s1);
546 throw new InternalError ("no s progress!");
547 }if (t1 - t0 > 0.001) {
548 var t = (t0 + t1) / 2;
549 var xt = that.XforT (t);
550 var yt = that.YforT (t);
551 if (t == t0 || t == t1) {
552 System.out.println ("t0 = " + t0);
553 System.out.println ("t1 = " + t1);
554 throw new InternalError ("no t progress!");
555 }if (ys >= yt0 && yt >= ys0) {
556 if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s0, xs0, ys0, s, xs, ys, t0, xt0, yt0, t, xt, yt)) {
559 if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s0, xs0, ys0, s, xs, ys, t, xt, yt, t1, xt1, yt1)) {
562 if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s, xs, ys, s1, xs1, ys1, t0, xt0, yt0, t, xt, yt)) {
564 }}if (ys1 >= yt && yt1 >= ys) {
565 if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s, xs, ys, s1, xs1, ys1, t, xt, yt, t1, xt1, yt1)) {
569 if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel, s0, xs0, ys0, s, xs, ys, t0, xt0, yt0, t1, xt1, yt1)) {
572 if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel, s, xs, ys, s1, xs1, ys1, t0, xt0, yt0, t1, xt1, yt1)) {
574 }}}} else if (t1 - t0 > 0.001) {
575 var t = (t0 + t1) / 2;
576 var xt = that.XforT (t);
577 var yt = that.YforT (t);
578 if (t == t0 || t == t1) {
579 System.out.println ("t0 = " + t0);
580 System.out.println ("t1 = " + t1);
581 throw new InternalError ("no t progress!");
583 if (this.findIntersect (that, yrange, ymin, slevel, tlevel + 1, s0, xs0, ys0, s1, xs1, ys1, t0, xt0, yt0, t, xt, yt)) {
586 if (this.findIntersect (that, yrange, ymin, slevel, tlevel + 1, s0, xs0, ys0, s1, xs1, ys1, t, xt, yt, t1, xt1, yt1)) {
595 var det = xnm * ylk - ynm * xlk;
597 var detinv = 1 / det;
598 var s = (xnm * ymk - ynm * xmk) * detinv;
599 var t = (xlk * ymk - ylk * xmk) * detinv;
600 if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
601 s = s0 + s * (s1 - s0);
602 t = t0 + t * (t1 - t0);
603 if (s < 0 || s > 1 || t < 0 || t > 1) {
604 System.out.println ("Uh oh!");
605 }var y = (this.YforT (s) + that.YforT (t)) / 2;
606 if (y <= yrange[1] && y > yrange[0]) {
610 }, "jssun.awt.geom.Curve,~A,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N");
611 Clazz.defineMethod (c$, "refineTforY",
612 function (t0, yt0, y0) {
615 var th = (t0 + t1) / 2;
616 if (th == t0 || th == t1) {
618 }var y = this.YforT (th);
628 Clazz.defineMethod (c$, "fairlyClose",
630 return (Math.abs (v1 - v2) < Math.max (Math.abs (v1), Math.abs (v2)) * 1E-10);
632 Clazz.defineStatics (c$,
635 "RECT_INTERSECTS", 0x80000000,