# Tangent points on circle that placed on Earth surface

I need help about spherical geometry problem that I need to use it for my project.

I try to calculate $T_1$ and $T_2$ coordinates on $B$ centered small circle on the sphere and $AT_1$ and $AT_2$ circular lines are tangent to that small circle.

Given Earth Angle Coordinates (Longitude (-180,+180) , Latitude (-90,90)) are $A=(x_1, y_1)$ and $B=(x_2,y_2)$ . And the perimeter of circle (r) on the Earth surface is also given.

I want to calculate $T_1$ and $T_2$ angle coordinates.(Please suppose that Earth is perfect sphere) My Strategy to solve the problem:

1. I suggest that Point $A$ is my new North Pole point (0,90). $$B'=(0,90-\alpha)$$

Where $\alpha$ is angle between Point $A$ and point $B$.

$\alpha=|$Shortest distance between $A$ and $B$ on sphere$|/R$

$\alpha$ on unit sphere can be calculated via Spherical_law_of_cosines easily.

1. I need to calculate angle $a$ Thus $$\sin(\alpha)=\frac{x}{R}$$ $$x=R.\sin(\alpha)$$ $$r=a.x$$ $$a=\frac{r}{x}=\frac{r}{R.\sin(\alpha)}$$

1. To find relative coordinates of coordinates $T'_1$ and $T'_2$ are:

$$T'_1=(-a, 90-\alpha)$$ $$T'_2=(a, 90-\alpha)$$

I am not sure to add relative point of A and to get real coordinates because $AB$ circle may not pass point $N$ as shown on first picture above.

• To clarify: You are given two points $A$ and $B$ of known longitude and latitude on a unit sphere, and a radius $r$; you construct the circle $C$ (on the sphere) of radius $r$ and center $B$, and you seek the locations $T_{1}$ and $T_{2}$ of the points on $C$ where the tangent great circle passes through $A$ (i.e., you draw great circles through $A$ and tangent to $C$, and you want the locations of tangency to $C$)? – Andrew D. Hwang May 29 '15 at 13:52
• @user86418 That's right. but please think that it is not a unit sphere .It has radius $R$ – Mathlover May 29 '15 at 16:01

$\DeclareMathOperator{\proj}{proj}$This can be handled easily using vector algebra. Let $A$ and $B$ be the specified points on the unit sphere, viewed as vectors in space, and assume $A \neq \pm B$ and $\cos r < A \cdot B$ ($A$ is outside the circle $C$ of radius $r$ centered at $B$). Let $U_{1}$ be the unit vector orthogonal to $B$ and tangent to the "short" great circle arc from $B$ to $A$, and let $U_{2} = B \times U_{1}$.

Theorem: If $$\theta = \arccos\left[\frac{(A \cdot B)\tan r}{A \cdot U_{1}}\right],$$ then the points $T_{1}$ and $T_{2}$ are $$(\cos r)B + \sin r\bigl((\cos\theta) U_{1} \pm (\sin\theta) U_{2}\bigr).$$

Computational note:

• $U_{1}$ is the second vector obtained from the Gram-Schmidt algorithm on the ordered basis $\{B, A\}$; that is, $$U_{1} = \frac{A - \proj_{B}A}{\|A - \proj_{B}A\|}.$$

Proof of Theorem: Every point on the circle $C$ has the form $$T = (\cos r)B + \sin r\bigl((\cos\theta) U_{1} \pm (\sin\theta) U_{2}\bigr) \tag{1}$$ for some real $\theta$.

If $T$ is an arbitrary point of $C$, let $A' = A - T$ and $B' = B - T$ denote the displacements to $A$ and $B$. The projections of these vectors to the tangent plane at $T$ are $$A'' = A' - (A' \cdot T)T,\qquad B'' = B' - (B' \cdot T)T,$$ and $T$ is a point of tangency if and only if $A'' \perp B''$. Expanding the dot product, using the fact that $T$ is a unit vector $(T \cdot T = 1$) lying on the circle of radius $r$ centered at $B$ ($B \cdot T = \cos r$), gives (omitting most of the algebra) $$0 = A'' \cdot B'' = A' \cdot B' - (A' \cdot T)(B' \cdot T) = A \cdot B - (\cos r)A \cdot T,$$ or $$A \cdot T = \frac{A \cdot B}{\cos r}. \tag{2}$$ Substituting (1) in (2), using the fact that $A \cdot U_{2} = 0$, and solving for $\theta$ gives the value in the theorem. • To modify the formula for a sphere of arbitrary radius $R$, replace $A$, $B$, and $r$ in the formulas for $\theta$ and $T$ by $A/R$, $B/R$, and $r/R$ respectively; then multiply $T$ by $R$ to get the points on the sphere. – Andrew D. Hwang May 29 '15 at 16:13