1

I have two points $A=(x_a, y_a, z_a)$ and $B =(x_b, y_b, z_b)$ which are the focal points of a 2D ellipse. I also know that $C =(x_c, y_c, z_c)$ lies on the ellipse surface.

My goal is to find a few points (say, 10 points) sampled from the ellipse surface. I prefer it to have some form of uniform sampling, ie, I move along the ellipse surface and pick a point after some gap. (I can opt any other sampling as long as I am traversing through the entire ellipse surface).

Is it even possible to achieve this?

I know the equation of ellipse is $$\frac{(x-x_0)^2}{a^2} + \frac{(y-y_0)^2}{b^2} =1$$

Also, I am thinking I can find the equation of a plane going through $A,B$ and $C$. But, still I am unsure how to proceed. Can someone help me establish a closed form solution.

wanderer
  • 155
  • 3
  • 13

1 Answers1

1

You need an affine transformation to relate the coordinate on the plane of the ellipse to the world coordinates. It is rather straight forward to obtain this transformation. Let $c = \dfrac{1}{2} |AB| $, then local coordinates of $A$ and $B$ are

$ A' = (-c, 0, 0)$

$ B' = (c, 0, 0) $

The coordinate frame has its origin $O'$ at the midpoint of $A$ and $B$:

$O' = \dfrac{1}{2} ( A + B ) $

And it $x'$ unit vector along $AB$, i.e.

$ u_1 = \hat{x}' = \dfrac{B - A}{\| B - A \|} $

The $z'$ axis is along the cross product of $AB$ and $AC$, and this points in a direction that is perpendicular to the plane of the ellipse. So,

$ u_3 = \hat{z}' = \dfrac{ AB \times AC }{\| AB \times AC \| } $

And finally the $ y'$ unit vector is obtained from the cross product of $u_3$ and $u_1$:

$ u_2 = \hat{y}' = u_3 \times u_1 $

Now if the $r$ is the world coordinate of a point in space and $r'$ is its coordinate with respect to the local coordinate frame we just created, then

$ r = O' + R \ r' $

where the $3 \times 3$ rotation matrix $R$ is given by

$ R = [u_1, u_2, u_3] $

Now we can work in the local coordinates, specifically in the $x'y'$ plane, which is the plane of the ellipse. The two foci are $A'$ and $B'$

The local coordinates of the known point $C$ is

$C' = R^T (C - O') $

The ellipse constant length is given by

$ L = 2 a = \| A' C' \| + \| B' C' \| = \| AC \| + \| BC \| $

$a$ is the length of the semi-major axis. The length of the semi-minor axis is given by

$ b^2 = a^2 - c^2 $

Now the equation of our ellipse in local coordinates $x'$ and $y'$ is

$ \dfrac{x'^2}{a^2} + \dfrac{y'^2}{b^2} = 1 $

Points on the ellipse can be parametrized as follows

$ (x', y', z') = ( a \cos t , b \sin t , 0 ) $

Finally, to obtain the world coordinates of the points, we use the affine transformation,

$\begin{equation} \begin{split} \begin{bmatrix} x \\ y \\ z \end{bmatrix} &= O' + R \ \begin{bmatrix} x'\\ y'\\ z'\end{bmatrix} \\ &= O' + [u_1, u_2, u_3] \begin{bmatrix} a \cos t \\ b \sin t \\ 0 \end{bmatrix} \\ &= O' + a \cos t \ u_1 + b \sin t \ u_2 \end{split} \end{equation} $

  • Thanks for the detailed answer. I understand it now clearly. I have a question. I want to extend this ellipse with focal points A and B to an ellipsoid of revolution. In that case what would be the [x y z] coordinates. If it is better to ask as a different question, I can do that. – wanderer Apr 24 '24 at 14:18
  • @wanderer Please check my answer to the exact problem you're interested in solving (ellipsoid of revolution) https://math.stackexchange.com/questions/4857808/in-three-dimensional-space-when-the-sum-of-the-distances-from-an-unknown-point/4857859#4857859 –  Apr 24 '24 at 14:56
  • Thanks. I did understand the solution there. But since it is in quadratic form. I am unable to generate [x y z] explicitly. My aim is to get equations for [x y z] as you have provided in this solution. How can I bring that quadratic matrix form to this form. I will ask a new question. – wanderer Apr 24 '24 at 19:42
  • 1
    I will answer your question in about an hour when I get back home. –  Apr 24 '24 at 20:35
  • @wanderer To answer your question, take the unit vector $X_1$ as defined in my solution (reference in my previous comment), and generate two unit vectors $X_2$ and $X_3$ that are mutually perpendicular to each other, and to $X_1$. Now define the matrix $$R = [X_1, X_2, X_3] $$ i.e. the columns of $R$ are $X_1, X_2,$ and $X_3$ , respectively, and define the vector $$ V(t, s) = \begin{bmatrix} a \cos t \ b \sin t \cos s \ b \sin t \sin s \end{bmatrix}$$. Then points on the surface of the ellipsoid are given by $$ P = R V $$. Note that the parameters now are $t$ and $s$. –  Apr 24 '24 at 22:07
  • Sorry, I forget to add the center, the correct equation is $$ P = C + RV $$ where $C$ is as defined in the referenced work. –  Apr 24 '24 at 22:18