James Derrick wrote:

> In article <4f3od9$...@zeus.tcp.co.uk>, ag...@agale.tcp.co.uk (Aaron Gale)

> wrote:

> > Does anyone know how to find the intersection of a line and plane

> > in simple x,y and z cartesian coordinates. I have a model made

> > up of facets, each facet being defined by 4 points. The working

> > envelope that this model is in, is then scanned from the bottom

> > to the top. However I can't work out how to calculate the z

> > coordinate along the scan line that may intersect with a facet.

> > The scanning line is always horizontal and is defined with the

> > x and y coordinates remaining the same, with one end of the line

> > minus z and the other end positive z. As an example at what point

> > does the line whose start point is (54,46,-100) and whose end

> > point is (54,46,100) intersect with a plane facet defined by 4

> > points in a anti-clockwise direction point 1 (40,20,-70),

> > point 2 (40,60,-40), point 3 (120,60,-40) and point 4 (120,20,-70).

> You only need 3 points to define a plane. Using these three points you

> can calculate the equation for the plane by simulaneous equations.

> ie using the first 3 points the equation using a form of z=mx+ny+b would be:

> 1. -70 = 40m + 20n + b

> 2. -40 = 40m + 60n + b

> 3. -40 = 120m + 60n + b

> Solving these gives m=0,n=0.75,b=-85.

> If you had a more complicated line you could solve the intersection also

> by the same method, however as all x & y values are the same, you can just

> substitute the x & y in, which gives you the intersection at (54,46,-50.5)