The search for nearest point on an ellipse or ellipsoid follows the description given by Geometric Tools (David Eberly), which also include some pseudo code. The content is CC-BY 4.0. More...

Go to the source code of this file.
Namespaces | |
| namespace | Foam |
| Namespace for OpenFOAM. | |
Functions | |
| defineTypeNameAndDebug (searchableSphere, 0) | |
| addToRunTimeSelectionTable (searchableSurface, searchableSphere, dict) | |
| addNamedToRunTimeSelectionTable (searchableSurface, searchableSphere, dict, sphere) | |
| static vector | getRadius (const word &name, const dictionary &dict) |
| static unsigned | getOctant (const point &p) |
| static void | applyOctant (point &p, unsigned octant) |
| static scalar | vectorMagSqr (const scalar x, const scalar y) |
| static scalar | vectorMagSqr (const scalar x, const scalar y, const scalar z) |
| static scalar | vectorMag (const scalar x, const scalar y) |
| static scalar | vectorMag (const scalar x, const scalar y, const scalar z) |
| static scalar | findRootEllipseDistance (const scalar r0, const scalar z0, const scalar z1, scalar g) |
| static scalar | findRootEllipsoidDistance (const scalar r0, const scalar r1, const scalar z0, const scalar z1, const scalar z2, scalar g) |
| static scalar | distanceToEllipse (const scalar e0, const scalar e1, const scalar y0, const scalar y1, scalar &x0, scalar &x1) |
| static scalar | distanceToEllipsoid (const scalar e0, const scalar e1, const scalar e2, const scalar y0, const scalar y1, const scalar y2, scalar &x0, scalar &x1, scalar &x2) |
Variables | |
| static constexpr int | maxIters = 100 |
| static constexpr scalar | tolCloseness = 1e-3 |
The search for nearest point on an ellipse or ellipsoid follows the description given by Geometric Tools (David Eberly), which also include some pseudo code. The content is CC-BY 4.0.
Original source file searchableSphere.C
https://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf
In the search algorithm, symmetry is exploited and the searching is confined to the first (+x,+y,+z) octant, and the radii are ordered from largest to smallest.
Definition in file searchableSphere.C.