Intersection points of a Triangle and a Circle

890 Views Asked by At

How can I find all intersection points of the following circle and triangle?

Triangle

$$A:=\begin{pmatrix}22\\-1.5\\1 \end{pmatrix} B:=\begin{pmatrix}27\\-2.25\\4 \end{pmatrix} C:=\begin{pmatrix}25.2\\-2\\4.7 \end{pmatrix}$$

Circle

$$\frac{9}{16}=(x-25)^2 + (y+2)^2 + (z-3)^2$$

What I did so far was to determine the line equations of the triangle (a, b and c):

$a : \overrightarrow {OX} = \begin{pmatrix}27\\-2.25\\4 \end{pmatrix}+ \lambda_1*\begin{pmatrix}-1.8\\0.25\\0.7 \end{pmatrix} $

$b : \overrightarrow {OX} = \begin{pmatrix}22\\-1.5\\1 \end{pmatrix}+ \lambda_2*\begin{pmatrix}3.2\\-0.5\\3.7 \end{pmatrix} $

$c : \overrightarrow {OX} = \begin{pmatrix}22\\-1.5\\1 \end{pmatrix}+ \lambda_3*\begin{pmatrix}5\\-0.75\\3 \end{pmatrix} $

But I am not sure what I have to do next...

3

There are 3 best solutions below

5
On BEST ANSWER

You want to find the intersection points of the lines and the cycle. You can to this by substituting. For instance: line $a$.

$$9 = (27-1.8\lambda_1 -25)^2 + (-2.25 + 0.25\lambda_1+2)^2 + (4+0.7\lambda_1)^2$$ Now you can calculate the value of $\lambda_1$, using the Quadratic formula.

You can ran into 3 cases: the discriminant is negative, in this case you have no intersection points, the discriminant is 0, there is one intersection point (note: the line is a tangent to the cycle in the found point), of discriminant positive, therefore 2 intersection points.

You get the coordinates of the points, by substituting $\lambda_1$ into the line equation $a$.

Now you have to check, if the points are indeed part of the triangle, or just part of the extension of the line. You can do this by making the creating the vectors $AB$ and $AP$. Look if they look both in the same direction and look, if $AB$ is longer than $AP$.

2
On

If $\,\;\;\vec a+t\vec b\,,\;t\in\Bbb R\;\;$ is a line in $\,\Bbb R^3\,$, then each of its points can be expressed as

$$\begin{pmatrix}\alpha_1:=a_1+tb_1\\\alpha_2:=a_2+tb_2\\\alpha_3:=a_3+tb_3\end{pmatrix}\;,\;\;a_i,b_i,t\in\Bbb R$$

then a point as above belongs to the circle

$$(x-25)^2+(y+2)^2+(z-3)^2=9\iff (\alpha_1-25)^2+(\alpha_2+2)^2+(\alpha_3-3)^2=9$$

so you have to substitute above, get a quadratic in $\,t\,$ and solve...of course, at most two different points for each straight line.

0
On

The side $AB$ of the triangle has equation $P(t) = (1-t)A + tB$ for $0 \le t \le 1$. The $0 \le t \le 1$ part is important. If $t$ lies outside $[0,1]$, the point $P(t)$ will lie on the infinite line through $A$ and $B$, but not on the edge $AB$ of the triangle. Substitute $(1-t)A + tB$ into the circle equation, as others have suggested. This will give you a quadratic equation in $t$ that you can solve using the well-known formula.

But, a solution $t$ will give you a circle/triangle intersection point only if it lies in the range $0 \le t \le 1$. Solutions outside this interval can be ignored.

Do the same thing with sides $BC$ and $AC$.