GLYLIB
0.3.0b
|
00001 // Function written by B. Lachele Foley, 2007 00002 #include <mylib.h> 00003 #include <molecules.h> 00004 //#include "../inc/mylib.h" 00005 //#include "../inc/molecules.h" 00006 /************** get_plane() ******************/ 00007 /* this finds the plane defined by 3 coord_3D structs */ 00008 plane get_plane(coord_3D one, coord_3D two, coord_3D three){ 00009 plane p; 00010 p.A=(two.j-one.j)*(three.k-one.k)-(three.j-one.j)*(two.k-one.k); 00011 p.B=(two.k-one.k)*(three.i-one.i)-(three.k-one.k)*(two.i-one.i); 00012 p.C=(two.i-one.i)*(three.j-one.j)-(three.i-one.i)*(two.j-one.j); 00013 p.D=-(p.A*one.i) - (p.B*one.j) - (p.C*one.k); 00014 //dprint_coord_3D(one); 00015 //dprint_coord_3D(two); 00016 //dprint_coord_3D(three); 00017 //dprint_plane(&p); 00018 return p; 00019 }