# Ellipse generated by a vertex of a sliding square on the $x$ and $y$ axes

A unit square is placed with the bottom left corner at the origin and the top right corner at $$(1,1)$$. The base vertices then slide on the $$x$$ and $$y$$ axes as shown in the animation below. The top right vertex traces a curve. Show that this curve is an ellipse, and find its semi-major and semi-minor axes.

My attempt:

So, obviously, we want to parametrize the coordinates of the top right corner in terms of the rotation angle of the square. Turning the square by an angle $$\theta$$, the coordinates of the base are $$(\cos \theta, 0)$$ and $$(0, \sin \theta)$$, so the coordinates of the top right corner are consequently,

$$P = (\cos \theta, 0) + (\sin \theta, \cos \theta ) = ( \cos \theta + \sin \theta, \cos \theta)$$

This can be written as

$$P = \cos \theta (1, 1) + \sin \theta (1, 0)$$

or more compactly as

$$P = \begin{bmatrix} 1 && 1 \\ 1 && 0 \end{bmatrix} u$$

where $$u = [\cos \theta, \sin \theta ]^T$$

From this last equation, and solving for $$u$$, we get

$$u = \begin{bmatrix} 1 && 1 \\ 1 && 0 \end{bmatrix}^{-1} P = \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} P$$

Now $$u$$ is a unit vector, i.e. $$u^T u = 1$$. Using the expression for $$u$$ in terms of $$P$$ we can write

$$u^T u = 1 = P^T \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix}^T \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} P = P^T \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} P = P^T \begin{bmatrix} 1 && -1 \\ -1 && 2 \end{bmatrix} P$$

Thus, we now have

$$P^T Q P = 1$$

where $$Q =\begin{bmatrix} 1 && -1 \\ -1 && 2 \end{bmatrix}$$

Diagonalize $$Q$$ (i.e. put it in the form $$Q = R D R^T$$ as follows:

1. Define $$\phi = \frac{1}{2} \tan^{-1}\left( \dfrac{2(-1)}{1 - 2} \right) = \frac{1}{2} \tan^{-1}(2)$$

2. It follows that $$\cos(2 \phi) = \dfrac{1}{\sqrt{5}} \Rightarrow \cos(\phi) = \sqrt{ \dfrac{ 1 + \sqrt{5}}{2 \sqrt{5}}} \Rightarrow \sin(\phi) = \sqrt{\dfrac{\sqrt{5} - 1}{2 \sqrt{5}}}$$

3. Step 2. above gives us the rotation matrix $$R$$, namely,

$$R = \begin{bmatrix} \cos(\phi) && - \sin(\phi) \\ \sin(\phi) && \cos(\phi) \end{bmatrix}$$

1. Diagonal elements of $$D$$ are

$$D_{11} = Q_{11} \cos^2(\phi) + Q_{22} \sin^2(\phi) + 2 Q_{12} \sin \phi \cos \phi = \dfrac{3 \sqrt{5} - 5}{2 \sqrt{5}}$$

$$D_{22} = Q_{11} \sin^2(\phi) + Q_{22} \cos^2(\phi) - 2 Q_{12} \sin \phi \cos \phi = \dfrac{5 + 3 \sqrt{5}}{2 \sqrt{5}}$$

Hence, finally, we have the semi-major axis length

$$a = \dfrac{1}{\sqrt{D_{11}}} = \sqrt{ \dfrac{ 2 \sqrt{5} }{3 \sqrt{5} - 5}} = \sqrt{ \dfrac{ 2 \sqrt{5} ( 3 \sqrt{5} + 5 ) }{20}}\\ = \sqrt{\dfrac{3 + \sqrt{5}}{2}} = \sqrt{ 1 + \Phi } = \Phi \approx 1.618$$

and the semi-minor axis length

$$b = \dfrac{1}{\sqrt{D_{22}}} = \sqrt{ \dfrac{ 2 \sqrt{5}}{ 5 + 3\sqrt{5}} } = \sqrt{ \dfrac{ 2 \sqrt{5}( 3 \sqrt{5} - 5 ) }{20} } = \\ \sqrt{ \dfrac{3 - \sqrt{5}}{2} } = \sqrt{ 2 - \Phi } = \sqrt{1 + 1 - \Phi} =\sqrt{1 + \Phi^2 - 2 \Phi } = \Phi - 1 \approx 0.618$$

Where $$\Phi$$ is the golden ratio, $$\Phi = \dfrac{ 1 + \sqrt{5} }{2}$$

• What is your question? Mar 31, 2022 at 10:18
• I am guessing the OP wants us to check the work. Mar 31, 2022 at 11:10
• @Tonyk My question is: Show that the curve traced is an ellipse, and find its semi-major and semi-minor axis. Mar 31, 2022 at 11:11
• This is an example of von Schooten's mechanical construction of an ellipse. mobile.twitter.com/peterliepa/status/1347348494101704706 Apr 7, 2022 at 20:32
• Yes, it is, but I was not aware of that. Thanks for the link. Apr 7, 2022 at 20:52

$$x=\cos t+\sin t, y=\cos t$$ $$(x-y)^2+y^2=1$$ This is second order curve. $$-2 \leq x \leq 2$$, $$-1 \leq y \leq 1$$, then curve is limited, then it is ellipse.
Claim. Minimum and maximum value of $$a\sin t + b\cos t$$ are $$\pm\sqrt{a^2+b^2}$$. It is easy to prove.
$$x_{max}=\sqrt{2}$$, $$x_{min}=-\sqrt{2}$$, $$y_{min}=-1$$, $$y_{max}=1$$ then center is $$\left(\frac{x_{min}+x_{max}}{2};\frac{y_{min}+y_{max}}{2}\right)=(0;0)$$ Distance of ellipse point from center is $$\sqrt{(x-0)^2+(y-0)^2}=\sqrt{x^2+y^2}=\sqrt{1+2\sin t \cos t + \cos^2 t}=\sqrt{\frac{3}{2}+\sin 2t+\frac{1}{2}\cos 2t}$$ Maximum distance is $$a=\sqrt{\frac{3}{2}+\sqrt{1+\frac{1}{4}}}=\sqrt{\frac{3+\sqrt{5}}{2}}=\sqrt{\frac{6+2\sqrt{5}}{4}}=\frac{1+\sqrt{5}}{2}$$ minimum distance is $$b=\sqrt{\frac{3-\sqrt{5}}{2}}=\frac{\sqrt{5}-1}{2}$$