CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Posts
    1

    DOES ANYONE KNOW how to program an ellipse?

    I'm trying to put an object in motion in an eliptical path on the VB screen. Any help would be greatly appreciated ASAP

    Matt


  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: DOES ANYONE KNOW how to program an ellipse?

    x*x/(a*a) + y*y/(b*b) = 1

    or, y = + and - sqr(b*b*(1-x*x/(a*a))

    vary x from one end of the major diameter to the other end, and calculate the two values of y. And then do whatever you like with the points of the ellipse.

    Note however that for serious applications, this method is not good for reasons of speed and uniformity. It gives you points that are densely located at one region than at the other.

    For better methods of getting the points of an ellipse, refer to the Mid-Point algorithm, available in any fundamental graphics book.


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