[Math] Formula for ellipse formed from projecting a tilted circle onto the xy plane

conic sectionsprojective-spacetrigonometry

A circle is drawn in the center of a piece of paper. The piece of paper is placed on a table and a camera is positioned directly overtop to look at the circle.

A piece of glass is placed between the camera and the piece of paper and is parallel to the piece of paper. A cartesian plane is drawn onto the piece of glass with point (x1, y1) marking the center of the circle on the paper below.

A point on the circumference of the circle is chosen and its (x,y) coordinate on the piece of glass is marked.

The paper is then tilted about the line y=x1 (the horizontal line through the center of the circle).

Note that as the paper is tilted the camera will observe an ellipse on the piece of glass: the projection of the circle onto the piece of glass, and the center point of the ellipse will still be (x1, y1).

However, this is magic paper: as the paper tilts the circle drawn on the piece of paper grows or shrinks such that the projection of the circle onto the piece of glass always intersects the point (x, y).

What is the formula that describes the projected ellipse on the piece of glass given the tilt angle theta, the point (x, y), the circle’s center coordinates (x1, y1)? Note that we do not know the radius of the original circle.

The motivation for this question is that I am working on an mobile application that renders a map onto the screen. The user's current location is marked with a blue dot. I want the blue dot to be placed near the bottom-left corner of the screen. But the dot itself cannot be moved: I must instead specify the latitude/longitude to be used as the center of the map and I need to calculate the map center to use in order to locate the blue dot at the desired location.

When the phone is rotated then the map needs to rotate about the blue dot (not about the center of the map). The math to figure this out is easy if the "camera" is looking at the map head-on (tilt=0) as I just need to trace the circumference of the circle centered at the center of the map that goes through the desired (x,y) position of the blue dot; however, if the map is tilted then I need to instead trace the circumference of the ellipse passing through the blue dot, the ellipse formed by projecting a circle lying on the plane of the ground onto the screen, and I can't seem to figure out the formula for this ellipse.

Best Answer

To make things a little bit simpler, let us assume that the centre of the circle corresponds with the origin of the cartesian reference frame. Then the circle is characterised by $$ \frac{x^2}{R^2} + \frac{y^2}{R^2} = 1 $$ where $R$ is its radius of the circle and since the point $(x_p,y_p)$ lies on the circle we have $R = \sqrt{x_p^2 + y_p^2}$.

Rotating the circle about the line $y=0$ will result in a projected ellipse with a long axis $R$ that is along the $x$-direction and a shortened axis of length $R \cos\theta$ in the $y$-direction. The projected ellipse is therefore characterised by $$ \frac{x^2}{R^2} + \frac{y^2}{R^2 \cos^2\theta} = 1 $$ This projected ellipse will in general not pass through the point $(x_p,y_p)$ anymore and we therefore make an isotropic expansion of the ellipse by a factor $f\geq1$. This gives for the scaled ellipse the curve $$ \frac{x^2}{f^2 R^2} + \frac{y^2}{f^2 R^2 \cos^2\theta} = 1 $$ Since this has to pass again through the point $(x_p,y_p)$ this gives a simple equation $$ \frac{x_p^2}{f^2 R^2} + \frac{y_p^2}{f^2 R^2 \cos^2\theta} = 1 $$ which we can easily solve for the scaling factor $f$ and find $$ f^2 = \frac{x_p^2 \cos^2\theta + y_p^2}{R^2 \cos^2 \theta} $$ which can be inserted back into the characterisation we obtained for the scaled ellipse and gives the final answer $$ \frac{x^2 \cos^2\theta}{x_p^2 \cos^2\theta + y_p^2} + \frac{y^2}{x_p^2 \cos^2\theta + y_p^2} = 1 $$ The correctness can easily be confirmed by checking that it is an ellipse that passes through the point $(x_p,y_p)$ and of which the ratio of the long and short axis is indeed $\frac{1}{\cos\theta}$. For an arbitrary centre $(x_o,y_o)$ of the circle this would result in $$ \frac{(x-x_o)^2 \cos^2\theta}{(x_p-x_o)^2 \cos^2\theta + (y_p-y_o)^2} + \frac{(y-y_o)^2}{(x_p-x_o)^2 \cos^2\theta + (y_p-y_o)^2} = 1 $$