### Matlab: Point on ellipsoidal surface

(German) This post is focussing on the solution of calculating a point of an ellipsoidal surface in dependency of to angles like in spherical coordinates.

Mode of operation: This function calculates the closest point on an ellipsoidal surface from an point outside or inside the body in respect to its center. It needs the mesh data of the ellipsoidal body X, Y, Z and the point, where the point with direct connection to the center should be found on the surface. The output parameters are [point, phi, the] = PointOnSurfaceAnalytic(X, Y, Z, x, y, z); the surface point and the angles phi and theta of the ellipsoidal equations. It can be downloaded here.

To derive the formula we start with the ellipsoidal equation:

xa+yb+zc2=1

If we consider 𝝋 to be between the x and y axis and

𝝑 be between the y and z axis it leads to:

y=x tan 𝝋

z=y tan 𝝑

Substitute this in the ellipsoidal equation one gets: ya tan 𝝋+yb+y tan 𝝑c2=1

solve this for y gives:

y=11a tan 𝝋+1b+tan 𝝑c2

so one can calculate x, …

Mode of operation: This function calculates the closest point on an ellipsoidal surface from an point outside or inside the body in respect to its center. It needs the mesh data of the ellipsoidal body X, Y, Z and the point, where the point with direct connection to the center should be found on the surface. The output parameters are [point, phi, the] = PointOnSurfaceAnalytic(X, Y, Z, x, y, z); the surface point and the angles phi and theta of the ellipsoidal equations. It can be downloaded here.

To derive the formula we start with the ellipsoidal equation:

xa+yb+zc2=1

If we consider 𝝋 to be between the x and y axis and

𝝑 be between the y and z axis it leads to:

y=x tan 𝝋

z=y tan 𝝑

Substitute this in the ellipsoidal equation one gets: ya tan 𝝋+yb+y tan 𝝑c2=1

solve this for y gives:

y=11a tan 𝝋+1b+tan 𝝑c2

so one can calculate x, …