Ellipse as a locus: sum of distances to two foci
A locus is the set of points that satisfy a geometric condition. An ellipse is a classic example:
it is the set of all points \(P(x,y)\) whose distances to two fixed points (the foci) have a constant sum.
If the foci are \(F_1(x_1,y_1)\) and \(F_2(x_2,y_2)\), and the constant is \(S\), then the ellipse locus is defined by
\[
PF_1 + PF_2 = S.
\]
This definition is exactly the “string ellipse” construction: pin a string of length \(S\) around two nails placed at the foci.
Keep the string taut with a pencil tip; as the pencil moves, it traces the ellipse.
There is an important feasibility condition. Let \(d\) be the distance between the foci:
\[
d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}.
\]
For any point \(P\), the triangle inequality gives \(PF_1+PF_2 \ge d\). Therefore a real ellipse exists only when \(S>d\).
If \(S=d\), the “ellipse” degenerates into the line segment between the foci (the set of points where equality holds).
If \(S
When \(S>d\), the standard ellipse parameters are
\[
S = 2a,\quad d=2c,\quad \text{so } a=\frac S2,\; c=\frac d2.
\]
The center \(C(h,k)\) of the ellipse is the midpoint of the foci:
\[
C(h,k)=\left(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2}\right).
\]
The semi-minor axis \(b\) is found from
\[
a^2=b^2+c^2 \quad\Rightarrow\quad b=\sqrt{a^2-c^2}.
\]
Geometrically, \(a\) controls the ellipse “length” along the major axis (the line through the foci), while \(b\) controls its “width”.
If the major axis is aligned with the coordinate axes, you get a familiar equation such as
\[
\frac{(x-h)^2}{a^2}+\frac{(y-k)^2}{b^2}=1
\quad\text{or}\quad
\frac{(x-h)^2}{b^2}+\frac{(y-k)^2}{a^2}=1,
\]
depending on whether the major axis is horizontal or vertical. In the general case, the ellipse can be rotated.
A clean way to express a rotated ellipse is to use an aligned coordinate system: take a unit vector \(\mathbf u\) pointing from \(F_1\) to \(F_2\),
and \(\mathbf v\) perpendicular to \(\mathbf u\). For a point \(P\), measure coordinates
\(x'=(P-C)\cdot \mathbf u\) and \(y'=(P-C)\cdot \mathbf v\). Then the ellipse equation is simply
\[
\frac{x'^2}{a^2}+\frac{y'^2}{b^2}=1,
\]
which the calculator can also expand into a general quadratic form \(Ax^2+Bxy+Cy^2+Dx+Ey+F=0\).