Skip to main content
gamedev.net
🔒 Locked

Ellipse, simple!

Started by zohare 2 replies 300+ views
Original Post
zohare
zohare
I have a rectangle and I want to find the equation of the ellipse inside which the rectangle is locked, any ideas?
zohare
ga
ga
Translate the rectangle to (0,0). Then the four corners are (e,f), (-e,f), (-e,-f), (e,-f). These points should be on the ellipse. The equation of the ellipse (at the origin, if its longest radius lies on a coordinate axis) is generally

b^2*x^2 + a^2*y^2 = a^2*b^2

where a and b are the longest and the shortest radiuses of the ellipse. Now you can substitute x with e and y with f. Then fix a value for a or b and calculate the other value (a or b) from the equation and you''ll get your ellipse equation with putting these a and b values into the general ellipse equation. Because you must fix one of the values a and b, there is an infinite
Visit our homepage: www.rarebyte.de.stGA

Topic Locked

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

Sign in to reply to this topic.