11
$\begingroup$

I'm playing around with modeling an archway of a building using a solid modeler, and have come to a problem that exceeds my mathematical ability.

Given an ellipse that has a known major radius, and is tangential to a line of a known length, angle, and offset on the Y-axis, can I find the ellipse's minor axis?

enter image description here

It's been decades since I took a math class. I can handle basic trig, but I can't figure out how to get started on this one.

Edit: Thanks everyone! You can see your solution in the flying buttresses of this (very preliminary) render. render of pseudo-gothic model

$\endgroup$
4
  • 2
    $\begingroup$ There are two tangent locations where this is not well defined: when the tangent is on one end of the major axis (a vertical line in your diagram). $\endgroup$ Commented Oct 27, 2023 at 23:00
  • 1
    $\begingroup$ So far nobody has mentioned it, but normal arches in real architecture are not ellipses... $\endgroup$
    – user21820
    Commented Oct 28, 2023 at 2:40
  • 2
    $\begingroup$ Arches rarely are, but flying buttresses are often elliptical or elliptical sections. See, for example, this paper which I discovered after posting here: sciencedirect.com/science/article/pii/S129620742200005X $\endgroup$ Commented Oct 28, 2023 at 16:16
  • 1
    $\begingroup$ Wow! Cool render :) $\endgroup$ Commented Oct 28, 2023 at 17:10

5 Answers 5

11
$\begingroup$

An ellipse can be considered a squashed circle, so we can convert this ellipse problem to an easier-to-solve circle case by un-squashing in the vertical direction.

Changing notation dramatically for a while ...

Consider an ellipse with major and minor radii $a$ (given) and $b$ (unknown), and let the tangent line meet the $x$- and $y$-axes at $P:=(p,0)$ and $Q:=(0,q)$ (both effectively given); let $R$ complete the "slope triangle" $\triangle PQR$, and let $T$ be the point where line $PQ$ touches the ellipse.

enter image description here

Scaling the figure vertically by a factor of $a/b$ gives the ellipse a "minor radius" of $b \cdot a/b$ (that is, transforms the ellipse into a circle of radius $a$), and gives $\triangle PQR$ a vertical leg of $q\cdot a/b$.

Most-importantly, the modified tangent line meets the ellipse (circle) at $T'$ such that $\triangle OPT'$ is right and has leg $|OT'|=a$; moreover, $\triangle OPT'\sim \triangle PQ'R'$. So, we can write $$\begin{align} \frac{|R'Q'|}{|R'P|} = \frac{|T'P|}{|T'O|} &\quad\to\quad \frac{p}{q\cdot a/b} = \frac{\sqrt{p^2-a^2}}{a} \\[4pt] &\quad\to\quad b^2 = \frac{q^2}{p^2}(p^2-a^2)=q^2-\left(a\cdot\frac{q}{p}\right)^2 \tag{$\star$} \end{align}$$ Done! $\square$


Converting back to OP's notation, we have ...

$$ a\cdot\frac{q}{p} = R_1\tan\theta \qquad q = h + R_1 \tan\theta$$

so that $(\star)$ becomes $$b^2 = (h+R_1\tan\theta)^2-R_1^2\tan^2\theta = h^2+2hR_1\tan\theta$$ which agrees with other answers.

$\endgroup$
1
  • 1
    $\begingroup$ Great Answer. Upvoted. $\endgroup$
    – Quadrics
    Commented Oct 26, 2023 at 18:11
10
$\begingroup$

My approach is via pure, brutalist coordinate geometry, trigonometry, and calculus:

The equation of the ellipse is $(x/R_1)^2 + (y/R_2)^2 = 1$. By implicit differentiation, the tangent to the point $(x, y)$ has derivative \begin{equation*} \frac{\mathrm dy}{\mathrm dx} = -\frac{xR_2^2}{yR_1^2} \end{equation*} Hence if this particular tangent meets the ellipse at $(x_0, y_0)$, then we have \begin{equation*} \tan \theta = \frac{x_0R_2^2}{y_0R_1^2} \end{equation*} since the line has gradient $-\tan \theta$.

The other piece of information we have is that $(x_0, y_0)$ lies on the ellipse - so $(x_0/R_1)^2 + (y_0/R_2)^2 = 1$. This is enough to solve for $x_0$ and $y_0$ if we so wish. Indeed, \begin{equation*} \left(\frac{y_0 R_1 \tan \theta}{R_2^2}\right)^2 + \left(\frac{y_0}{R_2}\right)^2 = 1 \end{equation*} so \begin{equation*} y_0 = \left(\frac{R_1^2 \tan^2 \theta}{R_2^4} + \frac{1}{R_2^2}\right)^{-1/2} = R_2^2(R_1^2 \tan^2 \theta + R_2^2)^{-1/2} \end{equation*} and similarly \begin{equation*} x_0 = R_1^2(R_2^2 \cot^2 \theta + R_1^2)^{-1/2} \end{equation*}

We also know that $(R_1, h)$ lies on the line. Therefore \begin{equation*} (R_1 - x_0)\tan \theta = y_0 - h \end{equation*} so \begin{equation*} (R_1 - R_1^2(R_2^2 \cot^2 \theta + R_1^2)^{-1/2})\tan \theta = R_2^2(R_1^2 \tan^2 \theta + R_2^2)^{-1/2} - h \end{equation*} so \begin{equation*} h + R_1\tan \theta = R_1^2(R_2^2 \cot^2 \theta + R_1^2)^{-1/2}\tan \theta + R_2^2(R_1^2 \tan^2 \theta + R_2^2)^{-1/2} \end{equation*} so \begin{equation*} h + R_1\tan \theta = (R_1^2 \tan^2 \theta + R_2^2)(R_1^2 \tan^2 \theta + R_2^2)^{-1/2} = (R_1^2 \tan^2 \theta + R_2^2)^{1/2} \end{equation*} and hence \begin{equation*} R_2 = ((h + R_1\tan \theta)^2 - R_1^2 \tan^2 \theta)^{1/2} = (h^2 + 2hR_1\tan \theta)^{1/2} \end{equation*}

I've "experimentally verified" the correctness of this solution.

This nice form does seem to suggest there is a nicer approach..

$\endgroup$
1
8
$\begingroup$

With the usual notation, let $B$ have coordinates $(x_1,y_1)$, and respectively denote the major and minor axes of the ellipse by $a$ and $b$. The equation of the tangent at $B$ is $xx_1/a^2+yy_1/b^2=1$, with gradient $$-\frac{b^2x_1}{a^2y_1}=-\tan\theta.$$ Also from the gradient, $(y_1-h)/(a-x_1)=\tan\theta$. Further, since $(a,h)$ lies on the tangent, we additionally get $x_1/a+hy_1/b^2=1$. Thus we have three linear equations in $x_1$ and $y_1$: $$b^2x_1-(a^2\tan\theta)y_1=0,$$ $$(\tan\theta)x_1+y_1=h+a\tan\theta,$$ $$b^2x_1+ahy_1=ab^2.$$ It follows that $$\det\begin{bmatrix} b^2&-a^2\tan\theta&0\\ \tan\theta&1&-h-a\tan\theta\\ b^2&ah&-ab^2\\ \end{bmatrix}=0.$$ After dividing out the (nonzero) factor $ab^2$, this easily simplifies to $$b^2=h^2+2ah\tan\theta.$$

$\endgroup$
4
$\begingroup$

The equation of the ellipse is

$\dfrac{x^2}{a^2} + \dfrac{y^2}{b^2 }= 1 $

where the semi-major axis $a$ is known, and the semi-minor axis $b$ is unknown. This ellipse is to be tangent to the line

$y = - \tan(\theta) (x - a) + h $

Let the tangency point be $(x_1, y_1)$, then

$y_1 = - \tan(\theta) (x_1 - a) + h \hspace{13pt}(1)$

$ \dfrac{x_1^2}{a^2} + \dfrac{y_1^2}{b^2} = 1 \hspace{13pt} (2)$

and finally, comparing the slopes,

$ \tan(\theta) = -\dfrac{ b^2}{a^2} \cdot \dfrac{x_1}{y_1} \hspace{13pt}(3)$

These are the three equations relating the three unknowns $x_1, y_1, b$.

It can be shown, after eliminating $x_1, y_1$ that $b$ satisfies

$ b^4 + b^2 (a^2 \tan^2(\theta) - h^2 - 2 h a \tan(\theta) ) - (a^2 h^2 \tan^2(\theta) + 2 a^3 h \tan^3(\theta) ) = 0 $

which is quadratic in $b^2$.

The discriminant is

$ \Delta = ( a^2 \tan^2(\theta) - h^2 - 2 h a \tan(\theta) )^2 + 4 (a^2 h^2 \tan^2(\theta) + 2 a^3 h \tan^3(\theta) ) $

This equals,

$ \Delta = a^4 \tan^4(\theta) + h^4 + 4 h^2 a^2 \tan^2(\theta) - 2 a^2 h^2 \tan^2(\theta) - 4 a^3 h \tan^3(\theta) + 4 h^3 a \tan(\theta) + 4 a^2 h^2 \tan^2(\theta) + 8 a^3 h \tan^3(\theta) $

It simplifies to,

$ \Delta = a^4 \tan^4(\theta) + h^4 + 6 a^2 h^2 \tan^2(\theta) + 4 h^3 a \tan(\theta) + 4 a^3 h \tan^3(\theta) $

And this just

$ \Delta = ( a \tan(\theta) + h )^4$

Therefore, the value of $b^2 $ is

$ b^2 = \dfrac{1}{2} \bigg(-(a^2 \tan^2(\theta) - h^2 - 2 h a \tan(\theta) ) +\sqrt{\Delta}\bigg) $

And this equals,

$ b^2 = \dfrac{1}{2} \bigg( h^2 + 2 a h \tan(\theta) - a^2 \tan^2(\theta) + (a \tan(\theta) + h)^2 \bigg) $

Simplifying further,

$b^2 = \dfrac{1}{2} \bigg( 2 h^2 + 4 a h \tan(\theta) \bigg) $

And finally,

$\large \boxed{ b^2 = h^2 + 2 a h \tan(\theta) }$

Example:

Suppose $a = 10 , h = 4, \theta = 18^\circ $, substituting these into the above equation, and solving for $b^2 $ using the quadratic equation, gives us

$ b = 6.480245 $

Here's a plot of this ellipse and the line segment.

Ellipse

$\endgroup$
3
$\begingroup$

Using Joachimsthal's notation (see: cut-the-knot, Wilson Stothers), for two points $(x_i, y_i)$ and $(x_j, y_j)$ write

$$s_{ij} = \frac{x_i x_j}{R_1^2} + \frac{y_i y_j}{R_2^2} - 1$$

where the point $(x_i, y_i)$ lies on the ellipse $x^2/R_1^2 + y^2/R_2^2 - 1 = 0$ if and only if $s_{ii} = 0$. If the ellipse had not been centred at the origin then its equation would include not only quadratic $x^2$ and $y^2$ terms but also plain old linear $x$ or $y$: to write $s_{ij}$ I'd just have replaced the $x$ term with the average $(x_i + x_j)/2$ and $y$ with $(y_i + y_j)/2$. And if the ellipse is rotated so an $xy$ term appears, I'd need do a mixture of these "product of $i$ and $j$" and "take the average" approaches to write $s_{ij}$: replace $xy$ by $(x_i y_j + x_j y_i)/2$. Of course, an alternative in such circumstances is to switch to a new coordinate system with origin at the centre and aligned with the ellipse's axes.

The advantage of Joachimsthal's notation is the way it lets us write the tangent equation without having to differentiate! Distinct points $(x_i, y_i)$ and $(x_j, y_j)$ lie on a tangent to the ellipse if $s_{ij}^2 = s_{ii}s_{jj}$. This formula, which may look like a special "trick", works for any non-degenerate conic, so also hyperbolas and parabolas. For why it works, see this question for circles and this one for conics more generally.

In your case the points $i$ and $j$ are $(0, h + R_1 \tan \theta$) and $(R_1, h)$. Therefore we need

$$\left(\frac{h(h + R_1 \tan \theta)}{R_2^2} - 1\right)^2 = \left(\frac{(h + R_1 \tan \theta)^2}{R_2^2} - 1\right)\left(\frac{R_1^2}{R_1^2} + \frac{h^2}{R_2^2} - 1\right)$$

Simplifying fractions and multiplying both sides by $R_2^4$ to clear out the denominators,

$$\left(h(h + R_1 \tan \theta) - R_2^2\right)^2 = h^2 \left((h + R_1 \tan \theta)^2 - R_2^2 \right)$$

This makes everything look worse than it is: if I said we wanted to find $t$ in $(ab - t)^2 = a^2(b^2 - t)$, you'd probably start by saying both sides have an $a^2 b^2$ term that cancels to leave $t^2 - 2abt = -a^2t$. If we want the non-zero solution for $t$ we can just divide by $t$ and get $t - 2ab = -a^2$, or $t = 2ab - a^2 = a(2b - a)$. In other words,

$$R_2^2 = h\left( 2(h + R_1 \tan \theta) - h \right) = h(h + 2R_1 \tan \theta)$$

$\endgroup$
1
  • 1
    $\begingroup$ Very nice! +1 :). I do speak Dutch, but funnily enough I learned most of my maths in English.. zo gaat het leven soms.. $\endgroup$ Commented Oct 28, 2023 at 1:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .