Bézier curves/Intersections: Difference between revisions

Content added Content deleted
(→‎{{header|Scheme}}: Scheme predicates should have ? in their names.)
Line 3,971: Line 3,971:
(else (compare-to-tol-inf-norm))))
(else (compare-to-tol-inf-norm))))


(define (flat-enough portion norm rtol atol)
(define (flat-enough? portion norm rtol atol)
;; Is the portion flat enough or small enough to be treated as
;; Is the portion flat enough or small enough to be treated as
;; if it were a line segment?
;; if it were a line segment?
Line 4,124: Line 4,124:
(endpt1@ qportion)))
(endpt1@ qportion)))
(loop workload params)
(loop workload params)
(if (flat-enough pportion norm rtol atol)
(if (flat-enough? pportion norm rtol atol)
(if (flat-enough qportion norm rtol atol)
(if (flat-enough? qportion norm rtol atol)
(let-values
(let-values
(((tp tq)
(((tp tq)
Line 4,149: Line 4,149:
. ,workload)
. ,workload)
params)))
params)))
(if (flat-enough qportion norm rtol atol)
(if (flat-enough? qportion norm rtol atol)
(let-values (((pport1 pport2)
(let-values (((pport1 pport2)
(bisect-portion pportion)))
(bisect-portion pportion)))