Given two circles arbitrarily positioned and oriented in $\mathbb{R}^3$, how can I find the nearest points on each circle?

53 Views Asked by At

Suppose the first circle has centre and normal $\mathbf{c}_0, \mathbf{n}_0 \!\in\!\mathbb{R}^3$ and radius $r_0\!\in\!\mathbb{R}$. Likewise, $\mathbf{c}_1, \mathbf{n}_1,$ and $r_1$ for the second circle. Further, \begin{align*} \mathbf{n}_i(\theta_i, \phi_i) = \begin{bmatrix} \cos\theta_i\sin\phi_i\\ \sin\theta_i\sin\phi_i\\ \cos\phi_i \end{bmatrix}\ \ \text{for}\ \ i\!\in\{0,1\} \end{align*} Additionally, thanks to the prompt responses on my last post, I have the following vectors that are orthonormal to $\mathbf{n}_i$: \begin{align*} \mathbf{u}_i(\theta_i, \phi_i) = \begin{bmatrix} \sin\theta_i\\ -\cos\theta_i\\ 0 \end{bmatrix}\ \ \text{and} \ \ \ \mathbf{v}_i(\theta_i, \phi_i) = \begin{bmatrix} \cos\theta_i\cos\phi_i\\ \sin\theta_i\cos\phi_i\\ -\sin\phi_i \end{bmatrix} \end{align*} Can anyone advise me on how I can compute the nearest points $\mathbf{x}_i$ on each circle ($\textit{i.e.}$ $|\mathbf{x}_1-\mathbf{x}_0|$ is the minimum distance between the circles)? Can the points $\mathbf{x}_i$ be expressed analytically as a function of $\mathbf{c}_i, \theta_i, \phi_i$, and $r_i$ alone? Or can this problem only be solved via a numerical minimisation procedure?

1

There are 1 best solutions below

4
On

For a single circle first with radius $r$, if $\mathbf{n}$ is your normal vector, you can use this to find vectors $\mathbf{u}_1,\mathbf{u}_2$ that form an orthonormal basis of the plane containing the circle. Then, with $\mathbf{c}$ the center of the circle, you can parametrize the circle by $\mathbf{c} + (r\text{cos }\theta)\mathbf{u}_1 + (r\text{sin }\theta)\mathbf{u}_2$. This yields a function $P : [0,2\pi] \rightarrow \mathbb{R}^3$.

Doing this with both circles, you get functions $P_1$ and $P_2$. Now if $\mathbf{v}$ and $\mathbf{w}$ are any two points in $\mathbb{R}^3$ (in particular, one on each circle) you can compute the square of the distance between them: $$d(\mathbf{v},\mathbf{w})^2 = \sum (v_i - w_i)^2$$ Using the parametrizations, you can get a function $f:[0,2\pi]\times [0,2\pi] \rightarrow \mathbb{R}$ given by $f(\theta_1,\theta_2) = d(P_1(\theta_1),P_2(\theta_2))^2$.

$f$ is a function in two variables and if $(\alpha,\beta)$ is a minimum of it, then $P_1(\alpha)$ and $P_2(\beta)$ are a pair of nearest points on your cirles. Can you compute these minima using some calculus, the formula for $d(\mathbf{v},\mathbf{w})^2$ and the parametrizations $P_1$ and $P_2$?