[Math] How to find the intersection points of two circles in 3D

MATLAB

I have two circles in 3D space generated from their parametric equations. Also, these two circles are on the same plane. How can I find out their intersection points from the parametric equations?

Thanks everyone, your answers are really helpful. However, I just realize I may post this on the wrong place. I am using Matlab not Mathematica. Meanwhile as required, I edit my question to make it more clear. First, these two circles are on the same plane and they have two intersection points. second, the radius, the centers and the normal vector are known. The parametric equation I use to generate the circle is:

$$\quad \quad P(t) = r\cos(t)\,u+r\sin(t) n \otimes u+C$$

where, $C$ is the center, $r$ is the radius, $n$ is the normal vector, and $\otimes$ represents the cross product.

For my purposes, $n = (0.7071, 0.7071, 0.3400), $ $u = (n_y, -n_z, 0)$. The centers are $C1 = (-382.6075, 531.1854, 203.9778), C2 = (-382.6075, 522.1854, 203.9778)$.

The radius is $50$ for both circles.

I will try to work out the matlab code based on your reply.

Best Answer

Since you haven't provided any details, I'll provide some examples:

Here are parametric equations of two circles in the same plane in 3D that intersect:

cir1 = {20 Cos[t] + 15, 20 Sin[t], 2};
cir2 = {30 Cos[t], 30 Sin[t], 2};

Here they are visually:

pl = ParametricPlot3D[{cir1, cir2}, {t, -Pi, Pi}, BoxRatios -> {1, 1, 1}]

Mathematica graphics

Let's find their points of intersection. We create parametric regions:

reg1 = ParametricRegion[cir1, {{t, -Pi, Pi}}];
reg2 = ParametricRegion[cir2, {{t, -Pi, Pi}}];

Solve for the points:

sol = Reduce[{x, y, z} ∈ reg1 && {x, y, z} ∈ reg2, {x, y, z}]

Mathematica graphics

We can extract these points:

pts = {x, y, z} /. {ToRules @ sol}

OR

pts = {x, y, z} /. Solve[{x, y, z} ∈ reg1 && {x, y, z} ∈ reg2, {x, y, z}]

Mathematica graphics

Visualize:

Show[pl, Graphics3D[{PointSize[0.02], Red, Point[pts]}]]

Mathematica graphics

Related Question