|
-
August 29th, 2001, 12:03 PM
#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
-
August 29th, 2001, 07:54 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|