Bézier curves/Intersections: Difference between revisions

Content added Content deleted
(→‎{{header|Modula-2}}: Removed the stop after four intersections (it seems inadvisable, given there might be "near-intersections").)
Line 812: Line 812:
It is possible for points accidentally to be counted twice, for
It is possible for points accidentally to be counted twice, for
instance if they lie right on an interval boundary. We will avoid
instance if they lie right on an interval boundary. We will avoid
that by the VERY CRUDE (but perhaps often satisfactory) mechanism
that by the crude (but likely satisfactory) mechanism of requiring
of requiring a minimum max norm between intersections. *)
a minimum max norm between intersections. *)


MODULE bezierIntersectionsInModula2;
MODULE bezierIntersectionsInModula2;
Line 1,095: Line 1,095:
(* Go through the workload, deferring work as necessary. *)
(* Go through the workload, deferring work as necessary. *)
numIntersections := 0;
numIntersections := 0;
WHILE (numIntersections <> 4) AND (NOT WorkIsDone (workload)) DO
WHILE NOT WorkIsDone (workload) DO
(* The following code recomputes values of the splines
(* The following code recomputes values of the splines
sometimes. You may wish to store such values in the work pile,
sometimes. You may wish to store such values in the work pile,