Convex Hull Algorithms for Actionscript

Recently I have been playing around with some code that required the use of Convex Hull's but I couldn't find any one who had ported these algorithms to Actionscript. If you don't know about Convex Hull's you can read about them here. I have written the Convex Hull Class to work with a few of the popular algorithms as I was playing around with the pro's and con's of using each including :

  • Graham Scan
  • Melkman
  • Jarvis March
  • BFP
  • An example SWF (AS2.0) using the Class is below (only with the Graham Scan Algorithm are the points draggable). I am surre if this was in AS3 it would run alot faster as most the memory is used in loop sorts

    To download the source click here