Zabamund / wellpathpy

Well deviation import
GNU Lesser General Public License v3.0
78 stars 28 forks source link

resample Is Unstable #38

Open dmbaker opened 3 years ago

dmbaker commented 3 years ago

You are doing the calculations by calculating the center of a the "Sphere." In reality, this is a 2D problem, but in either case you are calculating a radius. When doing robust circle (sphere) calculations, one should explicitly avoid using the radius because in straight hole conditions (parallel vectors) the radius goes to infinity.

You don't need to move the arcs relative to the center (so you don't need to calculate the radius, see above). Just move each survey / arc segment start point to the origin, then do the interpolation.

Also, to calculate omega, just use the tangents you have calculated for each survey station, using the angle method. This way you avoid the straight hole condition issue because you already trap for 0 omega in your SLERP method.

Also, the arc is not undefined when omega is zero. The arc has just degenerated into a line. A line is an arc with an infinite radius.