In a project I'm working on the user creates a circle and choose a point on that circle, P=(px,py). For the question's sake, let's assume 开发者_JAVA百科the center of the circle is at (0,0).
After the previous steps, the user can then change the eccentricity of the ellipse (as it was a circle it was actually an ellipse with e=0). While he changes the eccentricity, the ellipse should keep its center to (0,0), and the point P should stay on the ellipse's circumference.
Thanks! Aviad.
If I made no mistake, the half axis of the ellipse are a = sqrt(x²+y²/(1-e²)) and b = a * sqrt(1-e²)
For the numeric eccentricity we have:
I) b = a * sqrt(1-e²)
and the equation for a point on the ellipse is:
II) x²/a² + y²/b² = 1
Substitue I) in II)
x²/a² + y²/(a² * (1-e²)) = 1
1/a² (x² + y²/(1-e²)) = 1
a² = (x² + y²/(1-e²))
a = sqrt(x² + y²/(1-e²))
精彩评论