circle circle intersection + cordinates + 3d + normal plane

2.6k Views Asked by At

good day. Actually I'm stuck with this problem

I want to get the 2 points (vertex coordinates) in a 3d circle circle intersection circle circle intersection

actually I know a lot of data,

Circle 1 center  c1c = (-0.23103,-0.12451,1.78538)
Circle 2 center  c2c = (0.56227,1.38846, 2.82537)

Circle 1 radius*  c1r = 2
Circle 2 radius*  c2r = 2

Circle 1 point  c1p** = (-1.40115, -0.58086, 3.34184)
Circle 2 point  c2p** = (1.87197,   2.8998,  2.82537)

Circles plane normal***  Cn = (-0.7073, 0.6130, -0.3520)

*in this case both circles have the same radius, but this can change in other problems.

** Both additional points, each by his circle, are given randomly.

**** I calc the Circles plane normal Cn using the fourth points that I have (c1c, c2c, c1p,c2p).

Actually I'm trying to apply the math from http://paulbourke.net/geometry/circlesphere/ "Intersection of two circles" but that is only for 2D and I need for 3D; and for more that tried to calculate the Z axis not achieved.

Paul Bourke intersection of two circles

two years a go I ask some similar question that I solve using some advices and this triangle idea: Z coordinates of 3rd point (vertex) of a right triangle given all data in 3D , but today I don't have any data of new point, BUT I have the normal.

I get two posibble solutions:

the first one may be is all that I need, BUT mathematics is beyond me pitifully. The second one is conected with a software called Geometric Tools Engine and I can't get the math or the logic behind that solution.

can you help me with a clear and specific solution?, understanding that I am not a mathematician

thank you.

3

There are 3 best solutions below

2
On BEST ANSWER

Define two unit vectors $v$ and $w$ as follows: $$ v={C_{2C}-C_{1C}\over|C_{2C}-C_{1C}|}, \quad w=C_n\times v. $$ You already know how to compute $a$ and $h$, so intersection points are given by: $$ C_{1C}+av\pm hw. $$

0
On

Let's assume you know the centers of the circles, $$\begin{array}{c} \vec{c}_1 = ( x_1 , y_1 , z_1 ) \\ \vec{c}_2 = ( x_2 , y_2 , z_2 ) \end{array}$$ their radiuses $R_1$ and $R_2$, respectively, and the unit normal of the plane the circles lie in, $$\hat{n} = ( x_n , y_n , z_n )$$

If you instead have a third point $\vec{p} = ( x_3 , y_3 , z_3 )$ (in addition to the centers), that you know is on the plane of the circles, and not collinear with the centers, you can calculate the plane unit normal using $$\vec{n} = \left ( \vec{c}_1 - \vec{p} \right ) \times \left ( \vec{c}_2 - \vec{p} \right ), \qquad \hat{n} = \frac{\vec{n}}{\lVert\vec{n}\rVert}$$

If $\vec{p}$ is collinear with the centers, then you'll just get $\vec{n} = 0$. Numerically, you should check that $\vec{n}\cdot\vec{n}$ is not too small, before trying to scale it to unit length.

We can use the two points and the unit normal to construct the unit vectors that represent the problem in planar coordinates. We can choose the first circle to be at origin $(0 , 0)$, and the second circle at $(1, 0)$, in which case the $x$ axis in three dimensions is $$\vec{e}_x = \vec{c}_2 - \vec{c}_1$$ and the $y$ axis is perpendicular to it and the plane normal, and just as long (to keep the circles circular), so $$\vec{e}_y = \vec{e}_x \times \hat{n}$$ Note that if $\hat{n}$ is not an unit vector ($\hat{n}\cdot\hat{n} = 1$), the latter scales the 2D $y$ axis, skewing the results. So we really do need $\hat{n}$ to be unit length.

In these new 2D coordinates, we need to scale the radiuses of the respective circles down: $$\begin{array}{c} d = \lVert \vec{c}_2 - \vec{c}_1 \rVert \\ r_1 = \frac{R_1}{d} \\ r_2 = \frac{R_2}{d} \end{array}$$

Finding the plane coordinates for the circle intersection points is now trivial (using e.g. the Wolfram MathWorld article on Circle-Circle Intersection): $$\begin{cases} x = \frac{1 + r_1^2 - r_2^2}{2} \\ y = \pm \frac{1}{2}\sqrt{4 r_1^2 - (1 + r_1^2 - r_2^2)^2} \end{cases}$$

Because the plane origin is at the first circle, and we know both $x$ and $y$ axes' 3D vectors, we can express the intersection points as $$\vec{p} = \vec{c}_1 + x \vec{e}_x \pm y \vec{e}_y$$

0
On

To expand on my comment, assume that circle 1 is centered on the origin and that circle 2’s center is at $(d,0,0)$ and that they lie in the $x$-$y$ plane. Then the formulas that you’re using to compute the intersection points reduce to $$P_\pm=(a,\pm h,0).$$ To transform this into your coordinate system, define the unit vectors $u={C_{2C}-C_{1C}\over\|C_{2C}-C_{1C}\|}$ and $v=C_n\times u$. Rotate the resulting intersection points using the matrix $R=\begin{bmatrix}u&v&n\end{bmatrix}^T$ (i.e., the matrix with these vectors as its rows) and add $C_{1C}$ to translate into position. The result is $$C_{1C}+au\pm hv$$ just as in Aretino’s answer. This is just a slightly more roundabout way to get there.

One way to test whether or not the four points that you start with are in fact coplanar is to compute the determinant $$\begin{vmatrix}C_{2C}-C_{1C}\\C_{1P}-C_{1C}\\C_{2P}-C_{1C}\end{vmatrix}.$$ If this is zero, then the points are coplanar.