Find a point $P_2$ on an ellipse, whose chord with $P_1$ is a max distance $d$ from its nearest side
I'm not sure if this solution is available in closed form, but after drawing it out I do think there will be two unique solutions always. I unfortunately have no clue where to start.
Given:
- An ellipse with x radius $a$, y radius $b$ and centre point $(0, 0)$
- A point on that ellipse $P_1$
- A distance $d$
Find all points $P_{2j}$ (i.e. find their coordinates) on the ellipse which satisfy the following condition (where $C$ is the chord joining $P_1$ and $P_{2j}$):
- The distance between $C$ and a line which is tangent to the ellipse and parallel to $C$ (on the side of the smaller segment formed by $C$ i.e. the "nearer" side) is equal to $d$
In other words, the maximum distance between $C$, and the nearer side of the ellipse from $C$, must equal $d$.
The diagram I've drawn below is an example of this. $P_{21}$ and $P_{22}$ are the desired points, whereas $P_{23}$ is an example of an invalid point. (The distances are not fully accurate)
The reason I believe the solution is closed, is because as you sweep the point $P_2j$ around the ellipse, the distance (required to be $d$) increases, reaches a turning point, and then decreases.
The parametric equation of the ellipse $\dfrac{x^2}{a^2} + \dfrac{y^2}{b^2} = 1 $ is
$ r = (x, y) = ( a \cos t , b \sin t ) \hspace{20pt} t \in \mathbb{R} $
Now $P_1 = (x_1, y_1) = (a \cos t_1, b \sin t_1 ) $
Suppose $Q = (a \cos s, b \sin s)$ is the point where the tangent is to be drawn.
The unit normal vector at $Q$ is
$n = \dfrac{(b \cos s , a \sin s )}{\sqrt{b^2 \cos^2 s + a^2 \sin^2 s}} $
The distance between the tangent line and the line $P_1 P_2 $ that is parallel to it is
$(P_1 Q) \cdot n = \dfrac{ ab( (\cos s - \cos t_1 ) \cos s + (\sin s - \sin t_1 ) \sin s ) }{\sqrt{b^2 \cos^2 s + a^2 \sin^2 s}} = d $
Simplifying,
$(P_1 Q) \cdot n = \dfrac{ ab( 1 - ( \cos t_1 \cos s + \sin t_1 \sin s )) }{\sqrt{b^2 \cos^2 s + a^2 \sin^2 s}} = d $
Therefore,
$ d {\sqrt{b^2 \cos^2 s + a^2 \sin^2 s}} = a b( 1- ( \cos t_1 \cos s + \sin t_1 \sin s ) ) $
Squaring,
$ d^2 (b^2 \cos^2 s + a^2 \sin^2 s ) = a^2 b^2 ( 1 + \cos^2 t_1 \cos^2 s + \sin^2 t_1 \sin^2 s + \dfrac{1}{2} \sin 2 t_1 \sin 2 s - 2 ( \cos t_1 \cos s + \sin t_1 \sin s ) ) $
After using the identities $\cos^2 s = \frac{1}{2} (1 + \cos 2 s ) $ and $\sin^2 s = \frac{1}{2} (1 - \cos 2 s)$, the last equation becomes of the form
$A \cos s + B \sin s + C \cos 2 s + D \sin 2 s + E = 0 $
where
$A = 2 a^2 b^2 \cos t_1 $
$B = 2 a^2 b^2 \sin t_1$
$C = -\dfrac{1}{2} \left((a b) ^ 2 \cos(2 t_1) - d ^ 2 (b ^ 2 - a ^ 2) \right) $
$D = -\dfrac{1}{2} a^2 b^2 \sin(2 t_1) $
$E = \dfrac{1}{2} d ^ 2 (a ^ 2 + b ^ 2) - \dfrac{3}{2} a ^ 2 b ^ 2$
Which can be solved for $s$, using the substitution $z = \tan \dfrac{s}{2} $ that results in a quartic polynomial equation in $z$.
Once $s$ is found (there will be two solutions), the equation of the line $P_1 P_2 $ is
$ n \cdot ((x, y) - P_1) = 0 $
where $n = ( b \cos s, a \sin s ) $
This line we need to intersect with the ellipse to find $P_2$. This can be done as follows. Since $(x, y)$ is on the ellipse then $P_2 =(x_2, y_2) = (a \cos t_2 , b \sin t_2)$. Substitute this into the equation of the line, you get,
$ (b \cos s , a \sin s ) \cdot ( a (\cos t_2 - \cos t_1) , b (\sin t_2 - \sin t_1) ) = 0 $
Dividing through by $ ab $,
$ \cos s (\cos t_2 - \cos t_1) + \sin s (\sin t_2 - \sin t_1 ) = 0 $
In which $t_1$ and $s$ are known, and the unknown is $t_2$. This equation is of the form
$ \cos(t_2 - s) = \cos(t_1 - s) $
Since $t_2 \ne t_1$ then
$ t_2 - s = - (t_1 - s) $
from which,
$ t_2 = 2 s - t_1 $
and $P_2 = (a \cos t_2, b \sin t_2 ) $
As a numerical example, I've taken the ellipse with $a = 10, b = 5, t_1 = \dfrac{\pi}{3}$ and the distance $d = 3 $. The figure below shows the two solutions.
An afterthought that looks me important (it's why I place it in front of my answer).
In fact your problem deals fundamentally with parallel (or offset) curves of an ellipse at distance $d$, as described here with parametric equations:
$$x=\left(a+\dfrac{bd}{\sqrt{a^2 \sin^2 t+b^2 \cos^2 t}}\right)\cos t, \ \ y=\left(b+\dfrac{ad}{\sqrt{a^2 \sin^2 t+b^2 \cos^2 t}}\right)\sin t$$
to which the two tangents issued from $P_1$ can/should be drawn. Getting the second point(s) $P_2$ (see my figure for notations) looks me accessible for example by using the method giving, for any point $(u,v)$ in the plane the closest point on the ellipse with equation $\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1$.
The big advantage of this point of view is that it gives a global understanding of the question.
Initial answer : Here is a methodology:
- First, a separate result : If the equation of a line $L$ in general (and of any tangent to the ellipse in particular) is written under the form
$$ u x + v y-p=0 \ \ \text{where} \ \ u^2+v^2=1, \tag{1}$$
(sometimes, one takes $u=\cos \theta, \ v=\sin \theta$ but working with angles in this context isn't necessary)
you can interpret $(u,v)$ as a unit normal vector to line $L$ and (the most important here) $p$ as the (shortest) distance of line $L$ from the origin (= the length of the shortest line segment $OH$ where $H$ belongs to the line). Therefore the ellipse's chord parallel to the tangent at distance $d$ from it has the following equation:
$$ u x + v y-(p\color{red}{-d})=0\tag{1'}$$
- Now, how can we obtain the equation of the general tangent to an ellipse. We start from the implicit equation of the ellipse:
$$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1 \tag{1''}$$
Let us extract from (1'') the following cartesian equation of its upper part is
$$y=f(x)=\dfrac{b}{a}\sqrt{a^2-x^2}\tag{2}$$
with $$f'(x)=\dfrac{-bx}{a}\dfrac{1}{\sqrt{a^2-x^2}}\tag{3}$$
- Therefore, the equation of the tangent in point $(x_0,y_0=f(x_0))$ is:
$$y-f(x_0)=f'(x_0)(x-x_0)\tag{4}$$
Caution: in this perspective, $(x_0,y_0)$ aren't thought as the coordinates of $P_1$ (that I will call $(x_1,y_1)$) but the "kind of" midpoint on the future arc $P_1P_2$ where the tangent is to be taken (see figure).
which gives, by reporting (2) and (3) into (4):
$$y-\dfrac{b}{a}\sqrt{a^2-x_0^2}=\dfrac{-bx_0}{a}\dfrac{1}{\sqrt{a^2-x_0^2}}(x-x_0),\tag{4'}$$
$$(cx_0)x+y\sqrt{a^2-x_0^2}-ca^2=0 \ \text{where} \ c:=\frac{b}{a}\tag{4''}$$
then put the resulting equation under the form (1). Caution: obtaining a form $ux+vy+w=0$ isn't enough: you must have a $(u,v)$ with unit norm. If such is not the case, divide the equation by the norm $\sqrt{u^2+v^2}$
-
Then deduce the form (1') of the chord at distance $d$ from the tangent.
-
Express that $P_1(x_1,y_1)$ belongs to this chord by writing:
$$u x_1+ v y_1-(p-d)=0\tag{5}$$
This gives an equation constraining $x_0$ to take a certain value (in fact two values in general).
- Report this/these value(s) in equation (5), then find the (second) point of intersection of (5) with the ellipse by solving the system with (1) and (1'').
Here is a figure obtained with Geogebra: