Take any line in the plane expressed parametrically as
$p(t)=(x_0,y_0)+t(1,m)=(x_0+t,y_0+tm)$.
Show that the curve given by
$q(t)=\frac{2p(t)}{1+\left|p(t)\right|^2}=\frac{(2 x_0 + 2t, 2 y_0+2tm)}{1+x_0^2+y_0^2+2(x_0+y_0 m)t+(1+m^2)t^2}$ is an ellipse.
I checked that for various values of $x_0,y_0$ and indeed it looks like an ellipse. Strangely, when $x_0=y_0=0$ it is not an ellipse but the original line $p(t)$. Can anybody show how to re-express $q(t)$ in regular ellipse equation?




The primary idea is that an ellipse can be parametrized as
$$\ X(\theta) = a\cos(\theta), \ Y(\theta) = b \sin(\theta), 0\le \theta\le2\pi $$
And we can further rewrite
$$\cos(\theta) = \frac{1-\tan^2(\frac{\theta}2)}{1+\tan^2(\frac{\theta}2)}$$
and
$$\sin(\theta) = \frac{2\tan(\frac{\theta}2)}{1+\tan^2(\frac{\theta}2)}$$
Let us consider, $$\ t = \tan\left(\frac{\theta}2\right) $$
Then, the ellipse can be parameterized in terms of $t$. Our aim will be to recreate the given $Q(t)$ in a similar form.
Also important to note is that a general ellipse in the plane will have its major and minor axes as a pair of intersecting perpendicular straight lines which meet at the center of the ellipse.
The standard equation of an ellipse centered at the origin is given by
$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 $$
Now, if we perceive "x" in the equation as the perpendicular distance of the point $\ (x,y) $ from the y-axis (more appropriately, the minor axis) and "y" as the perpendicular distance of the point from the x-axis (major axis) assuming a > b (vice versa for the opposite case), then we can extend this same definition for a rotated ellipse.
A rotated ellipse will thereby take the form:
$$\frac{D_1^2}{a^2} + \frac{D_2^2}{b^2} = 1$$
Where $ \ D_1 $ and $\ D_2 $ are the perpendicular distance of the point from the minor and major axes, respectively.
Note that the perpendicular distance of a point $\ (X(t),Y(t)) $ from a line $\ y = nx + c $ is given by
$$\ D = \left|\frac{Y - nX - c}{\sqrt(1+n^2)}\right| $$
i.e. $$\ D_1(t), \ D_2(t) $$ should be of the form:
$$\ D_1(t) = \frac{\ Y - n\ X + \ c_1}{\sqrt(1+n^2)} , \ D_2(t) = \frac{\ X + n\ Y + \ c_2}{sqrt(1+n^2)} $$
Now, to proceed, we first simplify $X(t)$.
$$\ X(t) = 2 \frac{ x_0 + t}{1+x_0^2+y_0^2+2(x_0+y_0 m)t+(1+m^2)t^2} $$
$$\ X(t) = \frac{2}{1+m^2} \frac { x_0 + t} {\left[\frac{1+x_0^2+y_0^2}{1+m^2}+\frac{2(x_0+y_0 m)t}{1+m^2}+t^2\right]} $$
Completing the square, we get
$$\ X(t) = \frac{2}{1+m^2} \frac { x_0 + t} {\left[\frac{1+x_0^2+y_0^2}{1+m^2}-(\frac{x_0+y_0 m}{1+m^2})^2+(t+\frac{(x_0+y_0 m}{1+m^2})^2\right]} $$
Simplifying $$ \frac{1+x_0^2+y_0^2}{1+m^2}-\left(\frac{x_0+y_0 m}{1+m^2}\right)^2 $$
$$ = \frac{(1+m^2)+(y_0-mx_0)^2}{(1+m^2)^2} $$
Note that this term is always positive and is a constant independent of t. Let this be equal to $\ B^2 $
Also, let the term $$\frac{x_0+y_0 m}{1+m^2}$$ be equal to $\ A$
Observe that the difference between $\ A$ and $\ x_0$ is equal to
$$m \cdot \frac{y_0-mx_0}{1+m^2} $$
Let the above expression be equal to $\ C$
Using the above three newly defined constants, we can rewrite $\ X(t)$ in a much better form
$$ X(t) = \frac{2}{1+m^2} \cdot \frac{(t+A)-C}{(t+A)^2+B^2} $$
Now we can replace $\ t$ with $\ t+A$ and rewrite again as:
$$\ X(t) = \frac{2}{1+m^2} \cdot \frac{t-C}{t^2+B^2} $$
Doing everything in exactly the same manner for $\ Y(t)$, we get (I can't write it out, my hands are paining already):
$$\ Y(t) = \frac{2m}{1+m^2} \cdot \frac{t+\frac{C}{m^2}}{t^2+B^2} $$
Now, we have to find some $\ n$ such that $\ D_1(t) $ and $\ D_2(t) $ take the desired parametric forms.
Computing $\ D_2(t) $ first, we get :
$$\ D_2(t) = X(t) + nY(t) + c2 $$
$$ = \frac{2}{1+m^2} \cdot \frac{t-C}{t^2+B^2} + \ n \cdot \frac{2m}{1+m^2} \cdot \frac{t+\frac{C}{m^2}}{t^2+B^2} + c2 $$
$$ = \frac{2}{1+m^2}\cdot[\frac{(t-C)+n*m(t+\frac{C}{m^2})}{t^2+B^2} + c2 $$
If we want $\ D_2 $ to be either in the form of sin(2t) or cos(2t), note that either the coefficient of t or the coefficient of the constant must become zero, otherwise if they are non-zero, the expression will end up as a $\frac{at+b}{t^2+1} $ term, which is not in the correct form. We desire either strictly $\frac{at}{t^2+1} $ or $\frac{b(1-t^2)}{1+t^2} $, which can contain only linear multiples of t or constants, but not both.
Simplifying the above expression of $\ D_2 $, we observe that the coefficient of the linear term of t is $\ 1+nm $, while the constant coefficient in the expression is $C \cdot (1 - n/m) $
If you set the former to zero, you will obtain $\ n = -\frac{1}{m}$. If you set the latter to zero, you get $\ n = m $. I am choosing the latter for it simplifies calculations, but one is certainly free to choose the former - you will get the same expression for the ellipse in the end.
And now, here comes the satisfying part, after long algebraic toil.
Consider
$$\ X(t) + m\ Y(t) = \frac{2}{1+m^2} \cdot \frac{t-C}{t^2+B^2} + m \cdot \frac{2m}{1+m^2} \cdot \frac{t+\frac{C}{m^2}}{t^2+B^2} $$
$$ = \frac{2}{1+m^2} \cdot \frac{(t-C) + m^2(t +\frac{C}{m^2})}{t^2+B^2} $$
$$ = \frac{2t}{t^2+B^2} $$
Which is exactly the stuff we're looking for if we replace $\ t$ with $\frac{t}{B} $ in the above expression. Note that the constant we need to add in this case to get an expression that is similar to Bsin(2t) is zero.
(This won't be the case with the next expression to be computed, which is the other axis perpendicular to $\ X + m\ Y $, i.e. $\ Y - m\ X$)
Computing it, we get
$$ \ Y - m\ X = \frac{2m}{1+m^2} \cdot \frac{t+\frac{C}{m^2}}{t^2+B^2} - m \cdot \frac{2}{1+m^2} \cdot \frac{t-C}{t^2+B^2} $$
$$ = \frac{2m}{1+m^2} \cdot \frac{+C +\frac{C}{m^2}}{t^2+B^2} $$
$$ = \frac{2C}{m} \cdot \frac{1}{t^2+B^2} $$
Which, as observed earlier, is not directly in the form of $\ A\cos(2t)$.Thus, we will have to add some constant for the same.
Subtracting $\frac{C}{mB^2} $ on both sides, we get
$$\ Y - m\ X - \frac{C}{mB^2} = \frac{2C}{m} \cdot \frac{1}{t^2+B^2} - \frac{C}{mB^2} $$
$$ = \frac{C}{mB^2} \cdot \frac{B^2-t^2}{B^2+t^2} $$
Which is precisely what we were looking for if we again replace $\ t$ by $\frac {t}{B} $.
Thus, replacing $\ t$ with $\frac{t}{B} $ , we obtain
$$ \ X + m \ Y = \frac{1}{B} \cdot \frac{2t}{t^2+1} = \frac{1}{B} \cdot \sin(2t) $$
and
$$\ Y - m \ X - \frac{C}{mB^2}= \frac{C}{mB^2} \cdot \frac{1-t^2}{1+t^2} = \frac{C}{mB^2} \cdot \cos(2t) $$
We can now find the equation of the required ellipse :
$$ \cos^2(2t) + \sin^2(2t) = 1 $$
$$ \left( \frac{mB^2}{C} \cdot \left(\ y - m\ x - \frac{C}{mB^2}\right) \right)^2 + \left( \ B \cdot \left(\ x + m\ y \right) \right)^2 = 1 $$
is the required equation of the ellipse.
Side note : For $\ x_0$ = 0 and $\ y_0$=0:
$$ C = 0, \ B^2 = \frac{1}{1+m^2} \ and \frac{C} {mB^2} = 0 $$
Cross multiplying both sides of the equation by $\ C^2 $ and putting the above values, we indeed obtain a straight line of slope m passing through the origin, which is what you have observed earlier.