I need a formula that will locate the tangent point between a circle and a rotated ellipse.
Known:
- Location and size of circle
- Relative y coordinate of ellipse vs circle
- Major/Minor radii of ellipse
- Angle of rotation of ellipse
The only solutions I can come up with are either iterative or utilize the "Solver" function of Excel but what I really need is a formula. The attached sketch shows sample values.
We now can see a right-angled triangle (brown, maroon and red) with height $3$ and angle $80^{\circ}$ (brown). The hypotenuse of this triangle (part of red) is $2.8/\sin (80^{\circ}) \approx 2.843194513$ inches.
As the ratio of the major radii: minor radii is $6:1$. So before rotation and translation the ellipse has equation $y^2+\frac{x^2}{36}=\frac{1}{4}$.
The part of the major radii below the $x$-axis (yellow) has length of $3-\frac {2.8}{\sin (80^{\circ})} \approx 0.1568054867$ inches.
The base of this triangle (maroon) has length $\frac {2.8}{\cos 80^{\circ}}$.
Now for the translation. We want there to be exactly $3-\frac {2.8}{\sin (80^{\circ})}$ inches on the other side. So the new equation (totally disregarding the center) is $y^2+\frac{\left(x-\frac{2.8}{\sin\ 80^{\circ}}\right)^2}{36}=\frac{1}{4}$ or $36y^2+\left(x-\frac{2.8}{\sin\ 80^{\circ}}\right)^2=9$ (you can shift a graph $\alpha$ units to the right by replacing $x$ with $x-\alpha$). Time to make $y$ the subject.
$$36y^2=9-\left(x-\frac{2.8}{\sin\ 80^{\circ}}\right)^2$$
$$y^2=\frac 1{36} \left[ 9-\left(x-\frac{2.8}{\sin\ 80^{\circ}}\right)^2 \right]$$
$$y=\pm \frac {\sqrt {9-\left(x-\frac{2.8}{\sin\ 80^{\circ}}\right)^2}}6$$.
Let $y=f(x)$.
Whenever you rotate a curve $y=f(x)$ by $\theta ^{\circ}$ (measured anticlockwise), the new equation becomes:
Thanks Sen Zen!
Now, for $y=\pm \frac {\sqrt {9-\left(x-\frac{2.8}{\sin\ 80^{\circ}}\right)^2}}6$ is rotated $80^{\circ}$ anticlockwise, it becomes:
$$y \cos 80^{\circ} -x\sin 80^{\circ}=\pm \frac {\sqrt {9-\left(y \sin 80^{\circ} -x\cos 80^{\circ}-\frac{2.8}{\sin\ 80^{\circ}}\right)^2}}6$$.
I will not lie: this is confusing. Let us just simplify it to: $$36(y \sin 10^{\circ} - x \cos 10^{\circ})^2=9-\left(y \cos 10^{\circ}-x \sin 10^{\circ}-\frac {2.8}{\cos 10^{\circ}}\right)^2$$
I have verified that this is correct.
Now comes the simplest, albeit hardest part: translation. It may be wrong but anyway, here goes nothing:
Geogebra converted provides an approximate equation without trigonometric equations but has graphed $36(y \sin 10^{\circ} - x \cos 10^{\circ})^2=9-(y \cos 10^{\circ}-x \sin 10^{\circ}-\frac {2.8}{\cos 10^{\circ}})^2$. The major axis passes through the origin $(0, 0)$ and has gradient $\tan 80^{\circ}$.
$\therefore$ The major axis has equation $y=x\tan 80^{\circ}$ and the centre of the ellipse is $(\frac {2.8}{\sin 10^{\circ}}, 2.8)$.
The circle has equation $(x-a)^2+y^2=\frac 14$. Now here is the tricky part: when two equations intersect at one point, their gradients are equal (we don't yet know $a$). So we have two equations now:
Now we differentiate the equations. Her is the one that I did:
Here is the one that Wolfram Alpha did:
($\frac {\pi}{18} rad=10^{\circ}$)
As the gradients are equal at the point where one is tangent to the other,
I presume it is possible to continue using a completely algebraic approach and find the possible value of $a$ relative to $x$ and $y$ and thus find an accurate value of $a$ but it was not quite possible for me to do it. I have found that $a \approx 0.73$ by trial and error but if you require a more accurate value, by all means go ahead and do it algebraically.
Now that we see that we have to find the (only) point of intersection of the circle and thus by simple substitution, we find all that we require from a different perspective, a bit to the right than before.
Now if we have learned anything, that is how to shift. Now let us switch things back to the original frame of reference, by replacing $x$ with $x+a \approx x+0.73$.
As you asked for only the tangent point, (restating) it is:
My sincere apologies on not being able to include the exact answers. I may have done many unnecessary things and I am sorry if the first image is unclear (especially the brown and maroon). I have taken a very winded tour to the solution and may have made some mistakes. Thanks for taking the time to read it through and I sincerely hope it helps everyone.