toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] TooN so3.h


From: Edward Rosten
Subject: [Toon-members] TooN so3.h
Date: Thu, 18 Jun 2009 14:48:20 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/06/18 14:48:20

Modified files:
        .              : so3.h 

Log message:
        Added some socumentation.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/so3.h?cvsroot=toon&r1=1.37&r2=1.38

Patches:
Index: so3.h
===================================================================
RCS file: /cvsroot/toon/TooN/so3.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- so3.h       9 Jun 2009 13:33:22 -0000       1.37
+++ so3.h       18 Jun 2009 14:48:19 -0000      1.38
@@ -184,6 +184,16 @@
        rhs.coerce();
 }
 
+///Compute a rotation exponential using the Rodrigues Formula.
+///The rotation axis is given by \f$\vec{w}\f$, and the rotation angle must
+///be computed using \f$ \theta = |\vec{w}|\f$. This is provided as a separate
+///function primarily to allow fast and rough matrix exponentials using fast 
+///and rough approximations to \e A \nd \e B.
+///
+///@param w Vector about which to rotate.
+///@param A \f$\frac{\sin \theta}{\theta}
+///@param B \f$\frac{1 - \cos \theta}{\theta^2}
+///@relates SO3
 template <typename Precision, typename VA, typename MA>
 inline void rodrigues_so3_exp(const Vector<3,Precision, VA>& w, const 
Precision A, const Precision B, Matrix<3,3,Precision,MA>& R){
        {
@@ -228,7 +238,8 @@
        const Precision theta_sq = w*w;
        const Precision theta = sqrt(theta_sq);
        Precision A, B;
-       
+       //Use a Taylor series expansion near zero. This is required for
+       //accuracy, since sin t / t and (1-cos t)/t^2 are both 0/0.
        if (theta_sq < 1e-8) {
                A = 1.0 - one_6th * theta_sq;
                B = 0.5;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]