- My line segment has one end touching the ellipse
- The other end of the line segment can be outside or inside the ellipse not on the ellipse
- The ellipse centre is in the origin
- Line Eqn, $y = mx + c$
- Ellipse Equation, $x^2/a^2+y^2/b^2=1$
- How to find whether the line segment and ellipse are perpendicular(Normal to each other at
the point of intersection)?
[Math] How to check the line segment is normal to ellipse
geometry
Related Solutions
Parameterize the ellipse as $(a \cos \bullet, b \sin \bullet)$. Take points $P := ( a \cos p, b \sin p)$ and $Q := (a \cos q, b \sin q)$ on the ellipse, with midpoint $M := (P+Q)/2$.
If $|PQ| = 2k$, then
$$a^2 (\cos p - \cos q)^2 + b^2 (\sin p - \sin q)^2 = 4k^2$$
The coordinates of $M$ are $$\begin{eqnarray*}x &=& \frac{a}{2}(\cos p + \cos q)\\ y &=& \frac{b}{2}(\sin p + \sin q) \end{eqnarray*}$$
Eliminating $\cos q$ and $\sin q$ (say, via the method of resultants) from these coordinate expressions based on the $k^2$ equation gives (barring transcription errors) the following implicit formulas for $x$ and $y$:
$$\begin{eqnarray*} 0 = x^4 ( a^2 - b^2 )^2 &-& 2 x^3 a ( a^2 - b^2 )( 2 a^2 - b^2 ) \\ &+& x^2 a^2 \left( a^2 b^2 - 2 ( a^2 - b^2 ) k^2 + (a^2-b^2)(6a^2-b^2)\cos^2 p \right) \\ &-& 2 x a^3 \cos p \left( a^2 b^2 + 2 a^2 ( a^2 - b^2 ) \cos^2 p - k^2 ( 2 a^2 - b^2 )\right) \\ &+& a^4 \left( a^2 \cos^2 p - k^2 \right)\left( b^2 - k^2 + ( a^2 - b^2 )\cos^2 p \right) \\ 0 = y^4 ( a^2 - b^2 )^2 &-& 2 y^3 b ( a^2 - b^2 )( a^2 - 2b^2 ) \\ &+& y^2 b^2 \left( a^2 b^2 + 2 ( a^2 - b^2 ) k^2 + (a^2-b^2)(a^2-6b^2)\sin^2 p \right) \\ &+& 2 y b^3 \sin p \left( a^2 b^2 - 2 b^2 ( a^2 - b^2)\sin^2 p + k^2 ( a^2 - 2 b^2 )\right) \\ &+& b^4 \left( b^2 \sin^2 p - k^2 \right)\left( a^2 - k^2 - ( a^2 - b^2 )\sin^2 p \right) \end{eqnarray*}$$
Eliminating the trigonometric quantities from these equations yields a monster polynomial in $x$ and $y$. Assuming that the 12-thousand-term factor is extraneous, we get this implicit formula for the midpoint curve:
$$ b^6 x^4 + a^6 y^4 + x^2 y^2 a^2 b^2 (a^2 + b^2 ) - a^2 b^4 x^2( b^2 - k^2 ) - a^4 b^2 y^2( a^2 - k^2) = 0 $$
This certainly does not appear to be the template for an ellipse.
Here's the polar form, with $x = r \cos\theta$ and $y = r\sin\theta$, after factoring-out (and ignoring) an $r^2$ that gives an extraneous origin-point:
$$ r^2 = \frac{a^2 b^2 \left( a^2( a^2 - k^2 )\sin^2\theta + b^2( b^2 - k^2 )\cos^2\theta \right)}{\left(a^2\sin^2\theta+b^2\cos^2\theta\right)\left(a^4\sin^2\theta+b^4\cos^2\theta\right)}=\frac{a^2b^2}{a^2\sin^2\theta+b^2\cos^2\theta}-\frac{a^2b^2k^2}{a^4\sin^2\theta+b^4\cos^2\theta} $$
(In the second equality, note that the first term is the formula for the original ellipse, whereas the second term could be considered the formula for an ellipse with semi-major axis $ak/b$ and semi-minor axis $bk/a$; the major-minor ratio of this auxiliary ellipse is the square of that of the original.)
We can see here that the curve is defined when $r^2 \geq 0$, so that we must have $$ k^2 \leq \frac{a^4 \sin^2\theta + b^4 \cos^2\theta}{a^2\sin^2\theta+b^2\cos^2\theta} $$
Observe that the special case $a = b \neq 0$ (with $k\leq a$) reduces to a circle: $$ x^2 + y^2 = a^2 - k^2 \hspace{1in} r^2 = a^2 - k^2 $$
... while the special case $k=0$ reduces to the original ellipse: $$ b^2 x^2 + a^2 y^2 = a^2 b^2 \hspace{1in} r^2 = \frac{a^2 b^2}{a^2 \sin^2\theta + b^2 \cos^2\theta} $$
Here's an image of various curves for the ellipse with $a = 5$ and $b = 2$, where $k$ takes values from $0$ (matching the ellipse) to $5$ (just the origin) in increments of $0.5$. The fattest "figure-8" touching the origin is for $k = 2 = b$.
Note. (I should make an animation to illustrate this.) Imagine $P$ is at $(5,0)$ and $Q$ is somewhere counter-clockwise around the ellipse, making a chord of length $2k = 2b$. As $P$ moves counter-clockwise itself, it pushes $Q$ further left, until $Q$ reaches $(-5,0)$, with $P$ somewhat to the left of the minor axis. Eventually, we expect $Q$ to wind up to the right of $P$, but this can't happen in a continuous way with $P$ traveling ever-counter-clockwise: the $PQ$ chord would need to pass through being vertical, but the only vertical chord of length $2b$ is the minor axis, whereas $P$ has already passed that axis. On the other hand, if we think of $Q$ as dragging $P$ behind it, then as $Q$ rounds the left bend, we find that it ends up pushing $P$ back a bit until the chord aligns with the minor axis in a continuous way (putting $M$ at the center, and pinching off a lobe of our figure-8). This is all well and good, but as $Q$ continues counter-clockwise, it tugs $P$ to the right; as $Q$ rounds the right bend, we find that it's pushing $P$ in the manner that $P$ was pushing $Q$ in the first scenario. Thus, we can't continuously plot the midpoint curve in this case by moving either endpoint of the chord in single direction around the ellipse. It would appear that the same can be said for any $k$ that causes its curve to bend inward at the left and right ends (as is already happening with $k=1$ in the figure); I wonder what the threshold on $k$ is for this phenomenon. (It should be easy enough to figure out: find the smallest $k$ such that the curve has a vertical tangent line at a point with $y\neq 0$.)
Edit. Let's tackle the bend threshold.
Differentiating the curve equation gives this differential relation: $$ \begin{eqnarray*} 0 &=& b^2 x \left( 2 b^4 x^2 + a^2 ( a^2 + b^2 ) y^2 - a^2 b^2 ( b^2 - k^2 ) \right) \; \mathrm{d}x \\ &+& a^2 y \left( 2 a^4 y^2 + b^2 ( a^2 + b^2 ) x^2 - a^2 b^2 ( a^2 - k^2 ) \right) \; \mathrm{d}y \end{eqnarray*} $$ We'll have a vertical tangent line when $\mathrm{d}x = 0$. We're interested in the cases where $y \neq 0$, so we consider $2 a^4 y^2 + b^2 ( a^2 + b^2 ) x^2 - a^2 b^2 ( a^2 - k^2 ) = 0$. Using this to eliminate $x$ from the curve equation gives the following possibilities for $y$: $$ (1)\qquad y^2 = -\frac{b^2(a+k)(ak+b^2)}{a(a^2-b^2)} \hspace{1in} (2) \qquad y^2=\frac{b^2(a-k)(ak-b^2)}{a(a^2-b^2)} $$ The possibilities in (1) are no possibilities at all, since (with $a > b$) the right-hand side is always negative; in (2), clearly requiring $a>k$, we find that the right-hand side becomes non-negative ---hence, that we get our additional vertical tangents--- once $k$ becomes larger than $b^2/a$, the length of the ellipse's semi-latus rectum! (In the figure, that's $2^2/5 = 0.8$, consistent with the visible bend for the $k=1$ curve and lack of bend in the $k=0.5$ curve.)
(By the way, when $k=b^2/a$, the "auxiliary ellipse" ---mentioned after the polar representation of the curve equation--- has semi-major axis $b$.)
So, what we've learned here is that a latus-rectum-length (or shorter, but not longer) chord can be pushed continuously in one direction around the circumference of an ellipse. (Of course, the latus-rectum-length chord will go vertical when it aligns with an actual latus rectum; that is, at each of the ellipse's foci.) Neat!
I suspect that we'd get similar results for hyperbolas and parabolas. I also suspect that this is a known property of conics, which means it might have a cleaner derivation than the one I've given here.
Let's say that each horizontal cross-section of the cylinder (a circle) has a radius of $r$. That means that on any slice of the cylinder, we have a circle of the form
$$x_c^2+y_c^2=r^2 \text{(Eqn.1)}$$
Now let's write the equation of the line as if we were looking at the whole thing from above (i.e. ignoring it in the z-direction and writing $y_l$ as a function of $x_l$). It would have an apparent equation of the form $$y_l=mx_l+b \text{(Eqn 2)}$$ Now, if the line crosses the circle at at least one point, then $y_c=y_l$ and $x_c=x_l$. We substitute $y_l$ into $\text {Eqn 1}$ and $x_l$ into $\text {Eqn 1}$, making it
$$x_l^2+(mx_l+b)^2=r^2 \text{(Eqn.3)}$$ Now we can solve for $x_l$. We can plug that into $\text {Eqn 2}$ to find $y_l$, and because we know $y_c=y_l$ and $x_c=x_l$, we can solve for the other variables. If we know the location of $A$ and $B$, we can then find the position of that point in 3-dimensional space.
Best Answer
Here is an interesting geometric property of ellipses (and similarly for other conic sections).
The application to your special case is this:
Draw two lines from the point $P$ on the ellipse to the foci $F_1$ and $F_2$.
The internal angle bisector of these lines (i.e. angle bisector of $\angle F_1PF_2$) is the normal to the ellipse.
The external angle bisector is the tangent line to the ellipse at $P$.