Skip to main content
GameDev.net gamedev.net
🔒 Locked

easy Elipse()

Started by GravtyKlz Feb 28, 2003 at 9:15 PM 1 replies 250+ views
Original Post
GravtyKlz
GravtyKlz
Is there an easy way or some equation to use in order to find the right coorinates for Elipse? Thanks
ToohrVyk
ToohrVyk
The "right" coordinates? Well, an ellipse is defined as :

E = { (x, y) | x²/a²+ y²/b² = c } (unless I''m mistaken) where a is the width and b is the height of the ellipse.

It can also be defined in polar coordinates as

E = { (a, r) | r = p / ( 1 + e * cos (a - a°) ) where p is a scaling value and e is the excentricity of the ellipse. a° is the tilt of the ellipse from the a = 0 line.

we also clearly have

a = p / ( 1 + e ) + p / ( 1 - e )

Can''t remember what b is equal to. Someone?

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more
smart_idiot
smart_idiot
If it only needed to be parallel with the x or y axis, you could cheat using some trig:

x = cos(angle)*width*0.5;
y = sin(angle)*height*0.5;
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.