Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Vorpy

Member Since 16 Nov 2006
Offline Last Active Feb 19 2011 07:03 PM

#4074298 Determining if a polygon is convex

Posted by Vorpy on 05 October 2007 - 07:28 AM

You're missing the last segment of the polygon, the one that connects the last point to the first point, assuming that the first and last points in the polygon are different and that the polygon is implicitly closed. This case is handled most easily by initializing the first segment to the segment between the first and last points, and then starting the loop with i=0.


PARTNERS