Results 1 to 40 of 42

Thread: [RESOLVED] Plot ellipse through apex and two other points

Hybrid View

  1. #1
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Plot ellipse through apex and two other points

    In the "normalized" form of post #6, a configuration with the line from P1 to P3 perpendicular to the axis from P2 corresponds to P2=(0, 0), P1=(u, v), P3=(u, -v), i.e. u=r, v=-s. Indeed, then us^2 - rv^2 = us^2 - u(-s)^2 = 0, so we divide by 0 to get A, which indicates this configuration is degenerate. The formula above is actually 0/0, so it can still give reasonable results "in the limit", but in any case we lose uniqueness. The two equations from #6 are then

    (u/A-1)^2 + (v/B)^2 = 1
    (u/A-1)^2 + (-v/B)^2 = 1,

    so the second is redundant. We have simply v^2/(1 - (u/A-1)^2) = B^2 for any value of A whatsoever, so there's a whole "ray" (possibly line segment) of solutions (more if you allow hyperbolas), as Logophobic's drawing illustrates. It's somewhat unfortunate that "half the time" there is a unique solution to your problem in post #7, which is a hyperbola, and the "other half" of the time, there is a unique solution, which is an ellipse centered on m (as usual ignoring degenerate cases).

    If you drew the hyperbolas, it would at least be more predictable from a user standpoint. It's clearer "why" the major axis gets arbitrarily large sometimes with hyperbolas added in; otherwise it just feels arbitrary and broken. Oh, you could also give the user control of "m" rather than forcing it to be the midpoint of P1 and P3. The algorithm works fine as-is with m not necessarily this midpoint.
    Last edited by jemidiah; Jan 5th, 2014 at 02:04 AM.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  2. #2

    Thread Starter
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Plot ellipse through apex and two other points

    Thanks for the suggestions. Plotting the hyperbolas would be interesting a geometrical demonstration but I think it would be a distraction for my present purpose. I only want to bend the line P1-P2-P3 into an arc in various ways for graphic purposes. It ought be possible to create asymmetrical elliptical arcs like the one shown in red below, by dragging on P2. The image below was again made by first drawing the ellipse and then dragging the points on to it -- the reverse of the required procedure. But after several tryouts this way, I am convinced that solutions must be possible.

    Name:  Elllipse3Points4.jpg
Views: 2315
Size:  10.7 KB

    For this purpose, I would like to consider abandoning the requirement for P2 to be at the tip of the minor axis (it's fine for the major axis). Visually, the minor vertex turns out not to be a very interesting point anyway on flattish arcs like this. But P2 must remain on the ellipse: the user drags the curve itself, not some remote control point. The ellipse centre c is some point on the line P2-m which is effectively "controlled" by P2. If an extra constraint is needed to get a unique solution, I would like to consider letting P2 be the point on the arc furthest perpendicularly from the line P1P2. It wouldn't surprise me if that raises some more mathematical difficulties. So unless someone is keen to rush in with an answer, I think I ought to take time to think about it myself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width