Is an ellipse just a "stretched" circle?
This seems like it would be right, but just wanted to make sure, since it''s more of a "that seems right" instead of something backed by actual equations.
If I have a oval with height 1 and width 2, would that be just like taking a circle and scaling it so that it''s size 2. Or rather, could I do quick collision detection by simply taking the position of an object and finding the X and Y distance from the center of a circle. Then I''d divide the X distance by the scale of the circle (the distance of the left or right side from the center) and do the same with the Y. Then I could just do a simple collision detection against a sphere.
I''m thinking this would work, but just wanted to be sure.
--Vic--
Well, the equation for a circle is:
And the equation for an ellipse is:
A circle is basically a specialized ellipse, where a and b are 1. So technically, an ellipse could be considered a scaled circle.
x2 + y2 = r2
And the equation for an ellipse is:
(x2 / a2) + (y2 / b2) = 1
A circle is basically a specialized ellipse, where a and b are 1. So technically, an ellipse could be considered a scaled circle.
The answer is yes. Technically, if you perform an affine transformation (like scaling on one axis only) on a circle, the result is an ellipse. To intersect something with an ellipse, you can do an affine transformation to make your ellipse a circle and then intersect with the circle. If you need the intersection point, you have to undo the transformation.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement