A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: plot an ellipse -- equidistant points!

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    384

    plot an ellipse -- equidistant points!

    I'm really hoping someone can help...

    I need to plot points at an equal distance along the circumfrence of an Ellipse.
    As it turns out, I'm pretty bad at geometry, which doesn't help.

    I can plot the ellipse, but because I'm using sine/cos and incrementing with theta the points are crunched towards the outside of the major radius.
    I've tried a bunch of different approaches- recording lots (5000) of points, then stepping through each to compare actual distance but I'm not getting nearly accurate results this way.
    I've looked at drawing dotted/dashed curves from drawing api/custom classes but no luck.

    If I could affect theta at the same rate the ellipse is plotted I think I'd be ok, but I can't quite grasp it.

    I've read all sorts of impossiblilites about this,and a lot of people having miserable experience with this sort of thing (one guy spent 8 years trying to fit an equal-sided polygon in to an ellipse).

    But- at the end of the day I can go to the Flash IDE and draw an ellipse and stroke it with an equally spaced dotted line! I just need to do this dynamically and record the points...

    Any thoughts?

    nosig\

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Posts
    1,059
    Im curious about this too...I have some leads...but i havent got it to work sucessfully

  3. #3
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Removing any helpful previous posts I mistakenly contributed to these forums.

    See ya FK'ers
    Last edited by NTD; 10-19-2006 at 08:52 AM.

  4. #4
    Senior Member
    Join Date
    Mar 2001
    Posts
    384
    Joran- I've got some leads too, some very complex math involved to do this accurately...too big for flash, especially when I need 1000 points! I have something that may work... I'm gonna try it, I'll let you know when I've got a solution.

    NTD- Thanks for the example. The problem that I'm having is demonstrated exactly in your code- for realistic 3D motion, each step (or point) at the ends of the long radius (x, in your case) are closer together than those in the middle. Here's an example...the first one (bad) is captured from a similar equation, the second is actually just stroked with a dotted line in the flash IDE:





    The method with sine/cos incremented by theta distributes points evenly by angle but not by distance to other points....

    fun!
    nosig\

  5. #5
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Removing any helpful previous posts I mistakenly contributed to these forums.

    See ya FK'ers
    Last edited by NTD; 10-19-2006 at 08:53 AM.

  6. #6
    Senior Member
    Join Date
    Mar 2001
    Posts
    384
    NTD-

    I'm actually not using this for 3D animation around an ellipse, but for placement of clips around an ellipse- this is why it's important to have the points evenly spaced. Rotation only produces equidistant points around the perimeter when you're drawing a circle...
    nosig\

  7. #7
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Removing any helpful previous posts I mistakenly contributed to these forums.

    See ya FK'ers
    Last edited by NTD; 10-19-2006 at 08:53 AM.

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

HTML5 Development Center