x = xa + ta (xb - xa)
y = ya + ta (yb - ya)x = xc + tb (xd - xc)
y = yc + tb (yd - yc)(0 <= t <= 1 )
d = {+,-}( ax1 + by1 + c) / sqrt(a*a+b*b)
Quick_Hull_Top (P; P1, P2): { set of points P, points P1, P2} Find point with maximum d value >= 0 from line (P1, P2) - if no point exists with d > 0, then find one with d=0 that lays between P1 and P2 (ie. its X, Y coordinates are between those of P1 and P2) --> call it Pmax if no such point then add edge (P1, P2) to convex hull else recurse: { Quick_Hull_Top(P; P1, Pmax) Quick_Hull_Top(P; Pmax, P2) }
P1 = (a point with minimum X coord), P2 = (a point with maximum X coord) Quick_Hull_Top(P; P1, P2) Quick_Hull_Bottom(P; P1, P2)
COSC 3P98 Computer Graphics
Brock University
Dept of Computer Science
Copyright © 2021 Brian J. Ross (Except noted figures).
http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/comp_geom/
Last updated: October 18, 2021