¡@

Home 

2014/10/15 ¤U¤È 10:12:48

iphone Programming Glossary: poly2

Objective-C check if subviews of rotated UIViews intersect?

http://stackoverflow.com/questions/15710853/objective-c-check-if-subviews-of-rotated-uiviews-intersect

so I hope that there are not too many errors. BOOL convexPolygon CGPoint poly1 count int count1 intersectsWith CGPoint poly2 count int count2 tests if 2 convex polygons intersect. Both polygons are given as a CGPoint array of the vertices. BOOL.. minproj proj minp minproj maxp maxproj BOOL convexPolygon CGPoint poly1 count int count1 intersectsWith CGPoint poly2 count int count2 for int i 0 i count1 i Perpendicular vector for one edge of poly1 CGPoint p1 poly1 i CGPoint p2 poly1.. p1 poly1 i CGPoint p2 poly1 i 1 count1 CGPoint perp CGPointMake p2.y p1.y p2.x p1.x Projection intervals of poly1 poly2 onto perpendicular vector CGFloat minp1 maxp1 minp2 maxp2 self projectionOfPolygon poly1 count count1 onto perp min minp1..