← Back to team overview

yade-dev team mailing list archive

Re: computation of MomentBending

 

Bruno Chareyre said:     (by the date of Wed, 27 Oct 2010 10:26:35 +0200)

> Question sent to Eigen forum 
> (http://forum.kde.org/viewtopic.php?f=74&t=91129).
>
> Step 1 :
> cerr<<q
>   ->  1 -1.56132e-11 7.47311e-11 -1.7066e-10
> cerr<<q.w()
> -> 1
> NaN angle found in angleAxisr(q)

try this:

  std::cerr.precision(30);



> template<typename Scalar>
> AngleAxis<Scalar>& AngleAxis<Scalar>::operator=(const QuaternionType& q)
> {
>    Scalar n2 = q.vec().squaredNorm();
> _if (n2 < precision<Scalar>()*precision<Scalar>())_
>    {
>      m_angle = 0;
>      m_axis << 1, 0, 0;
>    }
>    else
>    {
>      m_angle = 2*std::acos(q.w());<--------- here we are computing 
> acos(1) in step 1 and 2 according to cerr...
>      m_axis = q.vec() / ei_sqrt(n2);
>    }
>    return *this;
> }

So they are handling this case in fact, this is good news. The only
problem is that the handling isn't working :) 


-- 
Janek Kozicki                               http://janek.kozicki.pl/  |



Follow ups

References