AMS 345/CSE 355 Computational Geometry Lecture: Geometric Primitives Joe Mitchell Code/figures from [O’Rourke]: Computational Geometry in C: Chap 1
Cross Products c b a
Cross Products Example: ab × ac = [2,1] × [2,2] = (2*2-2*1) = 1 ab × ad = [2,1] × [0,-1] = (2*(-1)-0*1) = -2 c=(2,2) b=(2,1) a d=(0,-1)
Determinant Form
Area of Convex Polygon
Area of Simple Polygon
Point Type
Vertex Structure
NEW and ADD
b c a
Proper Segment Intersection Fact: ab and cd properly intersect if and only if (1) points a and b are on opposite sides of line cd, AND (2) c and d are on opposite sides of line ab
Improper Segment Intersection
Between b c a b c a
Segment Intersection
Diagonalie Test if segment ab, joining vertices a and b, forms a “diagonalie” = an interior or exterior diagonal for P. Check: does the segment ab avoid intersecting all edges of P, except those that share endpoints with ab? a a b a b b
InCone
InCone b a0 a1 a b a a1 a0
Diagonal
Additional Primitives ConvexVertex(a,P) – returns T iff a is a convex vertex of P RaySegIntersectProp RayRayIntersectProp RaySegIntersect, RayRayIntersect SegSegShareEndptOnly SegSegT-Intersect PointInTriangle SegInPolygon Etc, etc
From Practice Midterm
From Practice Midterm