Equation for Ellipse

68 Views Asked by At

I'm trying to find an equation that draws an ellipse in the same vein as drawing it with the pin and string method. Basically inputting the $2$ "pin" locations and the max distance between the $2$ pins aka the string length.

From my search, the pin locations would be called foci and the distance between them would be $2\cdot c$ where $$ c=\sqrt(a^2+b^2) $$

and the string length would be $$ \text{String Length} = 2b + 2c $$

The ellipse would not have to be locked to the $x$ or $y$ axis. Long story short, I have $2$ locations (points $A$ and $B$) on a map that I need to draw an ellipse around with the distance from $A$ to $E$ (point on the ellipse) $+$ distance from $B$ to $E = \text{max range}$.

Any help would be greatly appreciated.

1

There are 1 best solutions below

0
On

Here is a way to organise the data:

Suppose the two fixed points are $A=(a, b)$ and $B= (c, d)$.

Let the distance $AB = l$.

Let the string have length $S=l+L$

Using the Euclidean distance between a point $P=(x,y)$ and the two points $A$ and $B$ you want $$\sqrt {(x-a)^2+(y-b)^2}+\sqrt {(x-c)^2+(y-d)^2}=L$$

It will take a little ingenuity to convert this to a more familiar form.