# Polygonal Arc Algorithm

This topic is 3302 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, i want to make a Point-in-Polygon test with following algorithm i found on the internet: int pnpoly(int npol, float *xp, float *yp, float x, float y) { int i, j, c = 0; for (i = 0, j = npol-1; i < npol; j = i++) { if ((((yp <= y) && (y < yp[j])) || ((yp[j] <= y) && (y < yp))) && (x < (xp[j] - xp) * (y - yp) / (yp[j] - yp) + xp)) c = !c; } return c; } the problem is: I need a closed polygon arc, but i only have an array with unsorted points. So i need an algorithm for finding the next point in my polygonal arc(in my array) with the smallest angle and shortest distance to my current polygonal arc point. I hope you know what i mean : / It is similar to the Graham-Scan-Algorithmus for finding the convex hull.

1. 1
2. 2
Rutin
15
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633270
• Total Posts
3011156
• ### Who's Online (See full list)

There are no registered users currently online

×