Re: [eigen] Why does Eigen::Quaterniond::angularDistance() method return the absolute angle?
• To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
• Subject: Re: [eigen] Why does Eigen::Quaterniond::angularDistance() method return the absolute angle?
• From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
• Date: Wed, 8 Aug 2018 10:13:55 +0200
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=xwCWB4/r56Mv4fviY0rIugTLW/OtY7h8zqotWDKpOQE=; b=AM//9I/7/fbN3+KP9rQagjbgujzcTDTiWfzlg8V5zCLdIfixaOKpTHwERSeupYtjjK zS8PWOLpe+HJlB3QZzMCt8H9ATEsG5s9fzbraxrgHq1EIXm+A6SrcW2JvRCYqetq2AG5 MFYsQ9/NY4azk/14hTi8DB38uImkKojSyNR6/JHKxlIC2ai1oR4aq8kbzRumENvJTfex mCbF1Z98E5Qd2WTwxtziiG/PYcebMCdwSg5kO629fKG4QIQOiyU8P6oIDxLP1uv5WCr0 uXSFgLwYe/z+zJjeixwKxwrbcqR2MKktb1HjvE8TNERERvbteC6aQEq+SMpQc3vZaYF2 oxPg==

One reasons is that a distance is expected to be symmetric and positive. Another one is that the "sign" is relative to the axis of rotation, so returning a "signed" angular distance alone does not seem to make much sense. Perhaps you want:

AngleAxisd aa(q1*q2.conjugate());

and if you really don't care about the axis defining the sign:

double a = AngleAxisd(q1*q2.conjugate()).angle();

gael

On Tue, Aug 7, 2018 at 4:59 PM Dluhosch, Michael <michael.dluhosch@xxxxxxxxxx> wrote:

Hi All,

This is my first mailling list mail. So if I could improve something tell me.

The Issue I face currently with the Eigen::Quaterniond class is that my application relies on the signed angle between two quaternions. Is there a really easy way to get that sign information I'm not aware of?

I had a look in the history why there is the numext::abs(d.w()) inside the atan2 call and found this:

http://eigen.tuxfamily.org/bz/show_bug.cgi?id=824#c1

This is not really an explanation so I wanted to ask for the reasoning behind the abs.

I would appreciate if you could change this method or add another one which gives the signed angle.

Regards,

Michael

The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.

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