Files Classes Functions Hierarchy
#include <plane.h>
Public Member Functions | |
| boolc | nmlxIsZero () const |
| Is the normals x component zero? | |
| boolc | nmlyIsZero () const |
| Is the normals y component zero? | |
| boolc | nmlzIsZero () const |
| Is the normals z component zero? | |
| plane (point3< double > const &nml_, doublec d0_) | |
| Construct a plane. | |
| plane (bool &valid, point3< double > const &p0, point3< double > const &p1, point3< double > const &p2) | |
| Construct a plane through three points. | |
| boolc | intersects (point3< double > &A, point3< double > &B, plane const &P2) const |
| Find the line A+Bt that is the two planes intersection. | |
| boolc | isPointOnPlane (point3< double > const &p) const |
| Determine if a point is on a plane or not. | |
| operator stringc () const | |
| Write this object as a string. | |
Public Attributes | |
| point3< double > | nml |
| nml*X=d0. | |
| double | d0 |
| The plane constant. | |
N*X = d. N is the normal and d is the plane equations constant.
Definition at line 15 of file plane.h.
| plane::plane | ( | bool & | valid, | |
| point3< double > const & | p0, | |||
| point3< double > const & | p1, | |||
| point3< double > const & | p2 | |||
| ) |
Construct a plane through three points.
Definition at line 11 of file plane.cpp.
References crossproduct::evalxyz().
00017 { 00018 valid=false; 00019 point3<double> arm1(p1-p0); 00020 point3<double> arm2(p2-p0); 00021 00022 // If the points are colinear then the plane can not 00023 // be determined. 00024 crossproduct::evalxyz(nml,arm1,arm2); 00025 if (nml.x*nml.x+nml.y*nml.y+nml.z*nml.z<zero<double>::val) 00026 return; 00027 00028 valid=true; 00029 00030 d0 = nml.dot(p0); 00031 }
Find the line A+Bt that is the two planes intersection.
Definition at line 35 of file plane.cpp.
References d0, solverInconsistent< T >::d2linearequ(), point3< T >::dot(), crossproduct::evalxyz(), nml, point3< T >::x, point3< T >::y, and point3< T >::z.
Referenced by planeinttest::test01(), planetest::test02(), and planetest::test03().
00040 { 00041 //crossprod< point3<double> > cp; 00042 //cp(B,nml,P2.nml); 00043 crossproduct::evalxyz(B,nml,P2.nml); 00044 if (zero<double>::test(B.dot(B))) 00045 return false; 00046 00047 point3<double> w; 00048 bool res; 00049 res = solverInconsistent<double>::d2linearequ 00050 ( 00051 A.x, A.y, A.z, 00052 nml.x, nml.y, nml.z, d0, 00053 P2.nml.x, P2.nml.y, P2.nml.z, P2.d0 00054 ); 00055 00056 return res; 00057 00058 // if (B.dot(B)<zero<double>::val) 00059 // return false; 00060 00061 // Find an intersection point. 00062 00063 /* 00064 if (nmlxIsZero()) 00065 if (P2.nmlxIsZero()) 00066 { 00067 A.x = 0.0; 00068 00069 return solver<double>::d2linearequ 00070 ( 00071 A.y, 00072 A.z, 00073 nml.y, 00074 nml.z, 00075 P2.nml.y, 00076 P2.nml.z, 00077 d0, 00078 P2.d0 00079 ); 00080 } 00081 00082 //if (abs(nml.y)+abs(P2.nml.y) < zero ) 00083 if (nmlyIsZero()) 00084 if (P2.nmlyIsZero()) 00085 { 00086 A.y = 0.0; 00087 00088 return solver<double>::d2linearequ 00089 ( 00090 A.x, 00091 A.z, 00092 nml.x, 00093 nml.z, 00094 P2.nml.x, 00095 P2.nml.z, 00096 d0, 00097 P2.d0 00098 ); 00099 } 00100 00101 if (nmlzIsZero()) 00102 if (P2.nmlzIsZero()) 00103 { 00104 A.z = 0.0; 00105 00106 return solver<double>::d2linearequ 00107 ( 00108 A.x, 00109 A.y, 00110 nml.x, 00111 nml.y, 00112 P2.nml.x, 00113 P2.nml.y, 00114 d0, 00115 P2.d0 00116 ); 00117 } 00118 00119 A.z=1.0; 00120 return solver<double>::d2linearequ 00121 ( 00122 A.x, 00123 A.y, 00124 nml.x, 00125 nml.y, 00126 P2.nml.x, 00127 P2.nml.y, 00128 d0-nml.z, 00129 P2.d0-P2.nml.z 00130 ); 00131 */ 00132 }
Determine if a point is on a plane or not.
Definition at line 57 of file plane.h.
References d0, point3< T >::dot(), and nml.
Referenced by planetest::test02(), and planetest::test03().
00058 { return zero<double>::test(nml.dot(p)-d0); }
| boolc plane::nmlxIsZero | ( | ) | const [inline] |
Is the normals x component zero?
Definition at line 25 of file plane.h.
References nml, and point3< T >::x.
00026 { return nml.x*nml.x<zero<double>::val; }
| boolc plane::nmlyIsZero | ( | ) | const [inline] |
Is the normals y component zero?
Definition at line 28 of file plane.h.
References nml, and point3< T >::y.
00029 { return nml.y*nml.y<zero<double>::val; }
| boolc plane::nmlzIsZero | ( | ) | const [inline] |
Is the normals z component zero?
Definition at line 31 of file plane.h.
References nml, and point3< T >::z.
00032 { return nml.z*nml.z<zero<double>::val; }
| plane::operator stringc | ( | ) | const |
Write this object as a string.
The normal first then the plane constant.
| double plane::d0 |
The plane constant.
Definition at line 22 of file plane.h.
Referenced by intersects(), and isPointOnPlane().
| point3<double> plane::nml |
nml*X=d0.
Definition at line 20 of file plane.h.
Referenced by intersects(), isPointOnPlane(), nmlxIsZero(), nmlyIsZero(), and nmlzIsZero().
1.5.8