27 #include <boost/shared_ptr.hpp>
29 #include "../../common/math/WLinearAlgebraFunctions.h"
30 #include "../../common/math/linearAlgebra/WVectorFixed.h"
31 #include "../../common/WAssert.h"
32 #include "../../common/WLimits.h"
47 setPlaneVectors( first, second );
48 m_first = normalize( m_first );
49 m_second = normalize( m_second );
62 void WPlane::resetPosition(
WPosition newPos )
69 boost::shared_ptr< std::set< WPosition > > WPlane::samplePoints(
double stepWidth,
size_t numX,
size_t numY )
const
72 boost::shared_ptr< std::set< WPosition > > result(
new std::set< WPosition >() );
75 const WVector3d ycrement = stepWidth * m_second;
76 const WVector3d xcrement = stepWidth * m_first;
77 result->insert( m_pos );
78 for(
size_t i = 0; i < numY; ++i )
80 for(
size_t j = 0; j < numX; ++j )
86 result->insert( m_pos -
id * ycrement - jd * xcrement );
87 result->insert( m_pos +
id * ycrement - jd * xcrement );
88 result->insert( m_pos -
id * ycrement + jd * xcrement );
89 result->insert( m_pos +
id * ycrement + jd * xcrement );
153 WPosition WPlane::getPointInPlane(
double x,
double y )
const
164 std::stringstream msg;
165 msg <<
"The give two vectors are not perpendicular to plane. First: " << first <<
" second: " << second <<
" for plane normal: " << m_normal;
168 std::stringstream msg2;
169 msg2 <<
"The given two vectors are not linear independent!: " << first <<
" and " << second;
170 WAssert( linearIndependent( first, second ), msg2.str() );
This only is a 3d double vector.
const float FLT_EPS
Smallest float such: 1.0 + FLT_EPS == 1.0 is still true.