Talk:Point-in-polygon

From aemwiki
Revision as of 13:07, 7 December 2007 by Analytophile (talk | contribs)

Jump to: navigation, search

This algorithm seems to include both a "Ray to infinity" approach and a computation of winding (total net angle) around the point of interest. I do not understand why. The Ray to infinity seems far faster and more than accurate enough. --AEMPhil 08:41, 7 December 2007 (MST)


While it is faster (and therefore preferred away from the element) he ray-to-infinity approach is not consistent with the winding/AEM calculation, i.e., if the ray approach is used to calculate conductivity right along the boundary, we might be considered inside (to the right of a dipole/doublet jump) whereas the AEM solution might consider the same point to be on the left of the dipole/doublet jump. The calculation of head at this point will therefore be erroneous. By locally using the winding approach that is consistent with dipole/doublet jump calculations, we avoid this error. It's a trick I learned the hard way.

Notably, this algorithm can be considerably improved by storing the bounding box of each polygon. It is slowed, however, if the bounding box is recalculated on each call. --Analytophile 2:09, 7 December 2007