tags:

views:

60

answers:

1

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 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.

+3  A: 

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²))

Landei
+1, I get the same result.
Jim Lewis
x,y in this answer refer to my px, py, right ? i.e. the point in the original circle?
Aviad Ben Dov
x and y refer to all points on the ellipse, and of course px, py is one of them :-)
Landei
Yeah, I figured that. :) it worked perfectly. Thanks!
Aviad Ben Dov