Bézier curves/Intersections: Difference between revisions

m
(→‎{{header|Phix}}: A second Phix implementation)
Line 3,155:
end function
 
function segmentparameterssegment_parameters (sequence a0, a1, b0, b1)
-- Return the respective [0,1] parameters of line segments (a0,a1)
-- and (b0,b1), for their intersection point. If there are not two
Line 3,212:
if flat_enough (qportion, tol) then
atom tp, tq
{tp, tq} = segmentparameterssegment_parameters (pportion[ENDPT0],
pportion[ENDPT1],
qportion[ENDPT0],
qportion[ENDPT1])
if 0 <= tp then
tp = (1 - tp) * pportion[T0] + tp * pportion[T1]
1,448

edits