Path: utzoo!utgpu!watserv1!watmath!att!att!bu.edu!rpi!zaphod.mps.ohio-state.edu!usc!apple!well!levine From: levine@well.sf.ca.us (Ron Levine) Newsgroups: comp.graphics Subject: Re: How to determine 4 points in a 3D plane?? Summary: elementary vector algebra Message-ID: <21401@well.sf.ca.us> Date: 29 Oct 90 19:54:44 GMT References: <31644@netnews.upenn.edu> Lines: 35 In article <31644@netnews.upenn.edu>, sichen@grasp.cis.upenn.edu (the S T R A N G E R ???!!!) writes: > > I am looking for the algorithm (pseudocode is fine) to determine any 4 given > abitrary points p(x,y,z) that lie in the same plane...e.g. The algorithm should > work for the following points .. > > a) p1=[1,1,0] > p2=[0,2,1] > p3=[1,0,2] > p4=[3,-1,2] > > b) p1=[4, 2, 1] > p2=[0, -3, 4] > p3=[2, 0, 3] > p4=[1, 4, 1] Form the 3 vectors v1 = p1 - p4, v2 = p2 - p4, and v3 = p3 - p4. Then the four points are coplanar if and only if the "box product" v1 dot ( v2 cross v3 ) = 0. Another way of expressing the same formula is that the determinant | v1x v1y v1z | | v2x v2y v2z | = 0 | v3x v3y v3z | If you don't understand "dot", "cross", or "determinant", see any book on elementary vector algebra. Applying this test shows that neither of the point sets a) nor b) is coplanar. --Ron