[Math] Plotting a skew ellipse

conic sectionsspherical-geometry

I tried to make a geometers sketchpad toolkit for spherical geometry that is more exact (and easier to understand) than the present available one.

but then I soon realised my background is not good enough so I need some help.

so my first (of a lot) of problems.

To plot a great circle

a great circle is an ellipse with:

  • the centre is at the origin (0,0)
  • the length of the semi-major axis is 1 (the ellipse touches the unit circle)
  • the length of the semi-minor axis is $h$ ($0 \le h \le 1 $ )
  • the angle between the (positive) x axis and the major axis of the ellipse is $\alpha $

What are the coordinates as a parametric function of the angle between the point, origin, X axis?

(I need get two functions x = some function (t) and y= some other function (t) where $t$ is the angle x-axis, origin , point on ellipse.

Second problem

Given two points $A (a_x, a_y) $ and $B (b_x, b_y) $ in the unit disk's interior, then there is a unique ellipse that:

  • containins A and B.
  • the semi-major axis is 1,
  • the semi-minor axis is less than 1,
  • the arc of the ellipse from A to B does not meet the major axis.

What is the formula of this ellipse?

More to come but this will help me on my way (any references to books are very welcome)

Best Answer

Part 1: \begin{align} x(t) &= \cos(\alpha) \cos(t) - h\sin(\alpha) \sin(t) \\ y(t) &= \sin(\alpha) \cos(t) + h\cos(\alpha) \sin(t) \end{align}

I don't understand the question for part 2. Are the two point supposed to be on the ellipse? If so, then $h$ and $\alpha$ cannot be determined, because there can multiple ellipses at the origin containing the same two points. (Quick proof: draw a (non-circular) ellipse $E$ at the origin. Rotate it by 30 degrees to get another ellipse $E'$. Now look at $E \cap E'$. It will typically contain four points. If any two of these are called $A$ and $B$, then both $E$ and $E'$ are possible solutions to the "find $h$ and $\alpha$" problem, but the $\alpha$ values for $E$ and $E'$ differ by 30 degrees.

Post-comment remarks

The squared distance from $(x(t), y(t))$ to $(0,0)$ is \begin{align} d(t)^2 &= \left[\cos(\alpha) \cos(t) - h\sin(\alpha) \sin(t)\right]^2 + \left[\sin(\alpha) \cos(t) + h\cos(\alpha) \sin(t)\right]^2 \\ &= \cos^2(\alpha) \cos^2(t) + h^2\sin^2(\alpha) \sin^2(t) - 2h\cos(\alpha) \cos(t)\sin(\alpha) \sin(t) + \sin^2(\alpha) \cos^2(t) + h^2\cos^2(\alpha) \sin^2(t) + 2h\cos(\alpha) \cos(t)\sin(\alpha) \sin(t) \\ &= (\cos^2(\alpha) + \sin^2(\alpha)) \cos^2(t) + h^2(\sin^2(\alpha) + \sin^2(t)) \sin^2(t) \\ &= \cos^2(t) + h^2 \sin^2(t) \end{align} This varies from $1$ (at $t = 0$) to $h^2$ (at $t = \frac{\pi}{2}$). Hence one (semi-) axis has length $1$ and the other has length $h$. If $h < 1$, then the major (semi-)axis will have length $1$.

Note that at $t = 0$, we have $$ \begin{align} x(0) &= \cos(\alpha) \cos(0) - h\sin(\alpha) \sin(0) &= \cos(\alpha) \ y(0) &= \sin(\alpha) \cos(0) + h\cos(\alpha) \sin(0) &= \sin(\alpha) \end{align} which is an angle $\alpha$ from the positive $x$-axis, as required.

It's possible that you still don't believe me, so here's some Matlab code:

function y = ellipseTest()
hList = [0.1, 0.3, 0.7];            % three different eccentricities
alphaList = [20, 50, 130] * pi/180; % three different major-axis angles
t = linspace(0, 2*pi, 100);         % sample values from 0 to 2pi
colorList = ['r', 'g', 'b'];
figure(gcf); 
clf;
hold on

for i = 1:3
   h = hList(i); alpha = alphaList(i); color = colorList(i);

    x = cos(alpha) * cos(t)  - h * sin(alpha) * sin(t);
    y = sin(alpha) * cos(t)  + h * cos(alpha) * sin(t); 
    plot(x, y, color)
end
hold off;
set(gca, 'DataAspectRatio', [1 1 1]);
figure(gcf);

and the resulting figure: enter image description here

I find these pretty compelling.

Note that each pair of ellipses intersects in two points in the first quadrant, so if you picked one of these sets-of-two-points for your part 2 question, you'd find two different ellipses that fit them.