Re: [TML] looking for equation
Rob O'Connor 19 Oct 2015 23:53 UTC
Leonard Erickson wrote:
> I need to draw several sizes of ellipse, all with the same
> focal points but different major axis sizes.
>
> Call the distance bettween the foci D.
>
>
> So the foci would be on the X-axis at -0.5D and +0.5D.
> And the major axis would be expressed in terms of D.
This looks tricky.
I think you will need to specify a radius/axis to avoid bad tautologies
e.g. "D = D"
First thoughts:
Distance between foci, D, is twice the distance from the centre of the
ellipse to a focal point:
= 2.sqrt(a^2 - b^2),
where a and b are the major and minor radii.
So
(D/2)^2 = a^2 - b^2
a = sqrt((D/2)^2 - b^2)
Alternately:
If the foci are at (-c,0) and (c,0), then D = 2c.
The Cartesian equation for an ellipse can be written as:
(x^2/a^2) + (y^2/(a^2 - c^2)) = 1
Now all points on the ellipse must satisfy:
sqrt((x+c)^2 + y^2) + sqrt((x-c)^2 + y^2) = 2a, where
(x,y) is a point on the ellipse
2a = major axis
The above equation looks hard to plot.
The polar equation for an ellipse with centre at the origin is:
r(theta) = ab/sqrt((b.cos(theta)^2 + a.sin(theta)^2))
Back substitute for 'a' into this equation to get r(theta) for 'D':
r(theta) = b.sqrt((D/2)^2 - b^2)/sqrt((b.cos(theta)^2 + sqrt((D/2)^2 -
b^2).sin(theta)^2))
'b' needs to be specified.
Plot r(theta) for 0 <= theta <= 2.pi, with appropriate transformations
to cartesian co-ordinates.
Alternately:
You will need to specify a, the major radius.
Rearranging the cartesian equation above,
abs(y) = sqrt((a^2 - c^2).(1 - (x^2/a^2)))
or, substituting b = sqrt(a^2 - c^2) into the polar equation above
r(theta) = a.sqrt(a^2 - c^2)/sqrt((sqrt(a^2 - c^2).cos(theta)^2 +
a.sin(theta)^2))
Messy.
Rob O'Connor