[eigen] Rotations and unit vectors |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: Eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: [eigen] Rotations and unit vectors*From*: Hauke Heibel <hauke.heibel@xxxxxxxxx>*Date*: Sun, 5 May 2013 11:01:29 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=Wv80nXPaTk7+5pB2Cx9uwNIUiL/Ax3C6tenjPPyCvOo=; b=lRFJNw7yxtHTXmFnBHYCsIg8eBQa4pa7JLNnrbyiJzTay8nqLNTcggDFsBns2brNyT tN4uOSX1Hefj9P3DUyt2ekA8dtKi0G9bdm+AspYBs6D5xxITxq9j5KrxxXCkhyBE0emF fz2VQ8pnZpt9GZeOUjG8fok1j1X+LD31ZtAKifGRkyVqhmwJMb2XpmFzO1HsTQ+8VOUF +tf6Qz2OwUTzJRBTruu8sRbzg1HcDLPJwCLDT0RraIQqH32ABz/qabUTLTACM6g5TYzi DMTKT4LZDKQKDtY4/40XyCCglAZCZmdSOyGNpC4urfmSqJymiO3PD8YPX3NPyrL5pVO/ RHQA==

Hi,

I've just spent some considerable time debugging a unit test of mine and started seriously questioning myself until I found out that I created a random transformation via

Eigen::AngleAxis<double> rotation(random_angle, Vector3d::Random());

It turned out that this rotation is not norm preserving - well my fault since I initialized it the wrong way. ;)

I am just wondering whether we should add run-time asserts to classes which require unit vectors as inputs. If I remember correctly this also applies to the Quaternion class.

So far, I would add this assert to

a) AngleAxis<double>(const Scalar& angle, const MatrixBase<Derived>& axis)

b) Quaternion(const Scalar& w, const Scalar& x, const Scalar& y, const Scalar& z)

Maybe even AngleAxis(const MatrixBase<Derived>& m) deserves a test. I am not sure what happens, when anything but a rotation matrix is passed to the class.

Regards,

Hauke

**Follow-Ups**:**Re: [eigen] Rotations and unit vectors***From:*Gael Guennebaud

**Re: [eigen] Rotations and unit vectors***From:*Robert Lupton the Good

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Eigen SPQR support memory leak** - Next by Date:
**[eigen] Error: trying to recover Q matrix in sparse QR factorization** - Previous by thread:
**Re: [eigen] Eigen SPQR support memory leak** - Next by thread:
**Re: [eigen] Rotations and unit vectors**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |