Jafar
|
00001 /* $ Id: $ */ 00002 00003 namespace jafar { 00004 namespace geom { 00005 template<int dimension> 00006 bool intersection( const Line<dimension>& l1, const HyperPlane<dimension>& hyp, typename Atom<dimension>::HomogenousVecD& vec ) 00007 { 00008 typedef typename Atom<dimension>::HomogenousVecD HomogenousVecD; 00009 HomogenousVecD normal = hyp.normal(); 00010 HomogenousVecD origin = hyp.origin(); 00011 HomogenousVecD fp = l1.origin(); 00012 HomogenousVecD lp = l1.pointAt(1.0); 00013 double d = ublas::inner_prod(normal, lp - fp); 00014 if( d < 1e-6) return false; 00015 double u = ublas::inner_prod(normal, origin - fp) / d; 00016 vec = l1.pointAt(u); 00017 return true; 00018 } 00019 00020 } 00021 }
Generated on Wed Oct 15 2014 00:37:19 for Jafar by doxygen 1.7.6.1 |