11
$\begingroup$

Given 2 set of points

((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) and

((p1,q1,r1),(p2,q2,r2),(p3,q3,r3)) each forming a triangle in 3D space.

How will you find out whether these triangles intersect or not?

One obvious solution to this problem is to find the equation of the plane formed by each triangle. If the planes are parallel, then they don't intersect.

Else, find out the equation of line formed by the intersection of these planes using the normal vectors of these planes.

Now, if this line lies in both of the triangular regions, then these two triangles intersect, otherwise not.

Is there any other solution?

  • 0
    "Now, if this line lies in both of the triangular regions, then these two triangles intersect, otherwise not." Not really... If the line lies in both triangular regions, then each triangle meets the line in a line segment, and *only if those two line segments have points in common* do the triangles intersect.2011-08-18
  • 0
    I was going to say the two triangles could be parametrized as closed curves and then invoke the [linking coefficient](http://en.wikipedia.org/wiki/Linking_number#Gauss.27s_integral_definition), but I don't think the formula applies when the curves are only piecewise differentiable.2011-08-19

4 Answers 4