A late response on this problem...

Quote Originally Posted by Greeny View Post
In geometry, the term for what you want to do is 'clipping'
Try a search for 'polygon clipping'
It seems like a simple task but is made difficult by lots of tricky edge cases.
If you can code in c++ or c# or Delphi i can recommend Angus Johnsons excellent freeware 'Clipper' http://www.angusj.com/delphi/clipper.php
Cheers
First of all thanks a lot Greeny for pointing me in the right direction!

For a programmer it was a 5 minutes job. The solution was simpler than the clipper library (certainly included in the library as well), it is called ray casting algorithm.
Here are code examples.


Quote Originally Posted by magicniner View Post
I don't think you realise just how complex a mathematical problem what you're asking for constitutes
Nick, I'm sorry to tell you that this complex mathematical problem is done by a computer in less than a second, by comparing 50k points against a 12 points defined polygon.