c# - Efficiently remove points with same slope -


in 1 of mine applications dealing graphics objects. using open source gpc library clip/merge 2 shapes. improve accuracy sampling (adding multiple points between 2 edges) existing shapes. before displaying merged shape need remove points between 2 edges.

but not able find efficient algorithm remove points between 2 edges has same slope minimum cpu utilization. points of type

pointf  

i calculating slope using following function

  private float slope(pointf point1, pointf point2)   {      return (point2.y - point1.y) / (point2.x - point1.x);   } 

any pointer on great help.

what algorithm using? can think of going through point , each 3 check wherher middle point on vector (or close to) defined 2 other points. need math operation?


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -