powerbot/RSBot-API — pull request #483 by BTOdell (2012-08-10 00:53:38+00:00)
Title: Improvement to the Area#contains(int,int)

The old implementation used the Polygon class.
The Polygon class follows the definition of insideness.
This means that the top and right borders are not included in the Area.
I believe that the Area class should include all the borders.
If it includes the bottom and left borders, then it should include the top and right borders.
http://gyazo.com/dda6c9d42e505dd54c4e71bd71d49dc9.png?1344558505
That picture demonstrates the difference between the Polygon class and my custom algorithm.
My algorithm is built upon the ray casting algorithm.
The Polygon class uses the ray casting algorithm for its contains method, so my algorithm won't be too much slower than the Polygon implementation.
Please study this algorithm thoroughly and understand why certain things are done before modifying.