Here is a testsheet to compare different algorithms with different data sets. I included Alan's second approach and Stuart's algorithm and hope I moved them over correctly. I also added one where I count how often a point is orbited by the polygon. This number should be zero for points outside the polygon. The algorithm seems to work pretty well also with non well behaved polygons, but still would need some work as some vertices are counted as in and some as out. The same goes for points lying on a polygon side. This is sure not an issue for the problem under discussion here, though.
Here is my second try. It seems that omitting the polygon sides which contain the point to be checked from building the angle sum and adding a tolerance to copy with roundoff error does the job. Now all points of the polygon (vertices and sides) are considered being inside.
EDIT: Only exception seems to be the point of intersection of the self crossing "infinity" (dataset 4).
It is nice to see that this problem has generated discussion.
The situation for which I need this inside/outside -test, was illustrated in the last section of the attachment in my original question (, but not very clearly, my apologizes for that...)
In principle, from a CPT (Cone penetration test) which is used for soil investigations, we get a large number of
sleeve resistance values fs and tip resistance values qt. Typical CPT test result is shown in attachment.
With these two values, the soil type can be defined using the charts presented in the second attached picture.
The main issue is to find, that in which area each fs/qt - qt -point hit.
My intention was that after this issue with one polygon is solved, I'll make a program that checks all the areas and defines in which area each point has hit. From those evaluations soil layers could be defined for all depths.
Translate
Windchill Satisfaction Survey
Help shape the future of Windchill. Take our 5-minute survey and share your feedback.