Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


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