CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Location
    Bangalore, INDIA
    Posts
    20

    formula to get the coordinates of an ellipse

    Hai all,

    In my project in VC++, i am need of getting the coordinates of an ellipse.

    Please help me ,

    With thanks
    arun a.c.

  2. #2
    Join Date
    Dec 2003
    Location
    St. Cugat - Catalunya
    Posts
    441
    sunkingac,
    the formula of an ellipse is (x**2/a**2)+(y**2/b**2)=1 where a is semi-major -radius and b semi-minor-radius, so

    x=a*sqr(1-y**2/b**2)

    but ... what do you need?

    Hope it helps
    Did it help? rate it.

    The best conversation I had was over forty million years ago ... and that was with a coffee machine.

  3. #3
    Join Date
    Dec 2001
    Location
    Greece, Athens
    Posts
    1,015
    Originally posted by DeepButi
    the formula of an ellipse is (x**2/a**2)+(y**2/b**2)=1 where a is semi-major -radius and b semi-minor-radius, so
    x=a*sqr(1-y**2/b**2)
    This will give u half the ellipse, u also need to calculate the negative values of x:
    x=a*sqr(1-y**2/b**2)
    and
    x=-a*sqr(1-y**2/b**2)
    and ofcourse some limitations:
    --> abs(x)<=a
    --> abs(y)<=b
    Regards,
    Theodore
    Theodore
    Personal Web Page (some audio segmentation tools): www.di.uoa.gr/~tyiannak

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

Featured