Commit 42925eeb authored by Jan Möbius's avatar Jan Möbius
Browse files

Documentation

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12985 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e34cfd10
......@@ -953,18 +953,15 @@ template <typename Scalar>
VectorT<Scalar,3>
perpendicular( const VectorT<Scalar,3>& v )
{
if (fabs(v[0]) < fabs(v[1]))
{
if (fabs(v[0]) < fabs(v[1])) {
if (fabs(v[0]) < fabs(v[2]))
return VectorT<Scalar,3>( Scalar(1.0) - v[0]*v[0], -v[0]*v[1], -v[0]*v[2]).normalize();
return VectorT<Scalar, 3>(Scalar(1.0) - v[0] * v[0], -v[0] * v[1], -v[0] * v[2]).normalize();
} else {
if (fabs(v[1]) < fabs(v[2]))
return VectorT<Scalar, 3>(-v[1] * v[0], Scalar(1.0) - v[1] * v[1], -v[1] * v[2]).normalize();
}
else
{
if (fabs(v[1]) < fabs(v[2]))
return VectorT<Scalar,3>(-v[1]*v[0], Scalar(1.0) - v[1]*v[1], -v[1]*v[2]).normalize();
}
return VectorT<Scalar,3>(-v[2]*v[0], -v[2]*v[1], Scalar(1.0) - v[2]*v[2]).normalize();
return VectorT<Scalar, 3>(-v[2] * v[0], -v[2] * v[1], Scalar(1.0) - v[2] * v[2]).normalize();
}
......
......@@ -96,7 +96,14 @@ circumRadius( const VectorT<Scalar,3>& _v0,
}
/// find a vector that's perpendicular to _v
/** \brief find a vector that's perpendicular to _v
*
* This function takes a vector and generates a new arbitrary
* vecor that is perpendicular to the input vector.
*
* @param _v Input vector
* @return Perpendicular vector
*/
template <typename Scalar>
VectorT<Scalar,3>
perpendicular( const VectorT<Scalar,3>& _v );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment