Re: [eigen] Euler-angles and partial reductions API design |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Euler-angles and partial reductions API design
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Sat, 19 Jul 2008 00:58:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=GU9iLyHDAbc/VMEtJ7UFBvc8aHjb6FA4HFMIkFlGZ1M=; b=h8fNlKgclrIPQA2aI264U1frHUEBdcXjqb9Z/9hCP0m73IsgKdX51odBGVbCLEaTML lvKt0dwVuiqmdItuSfzseNXViUoSJmbKxoBuos1ih7NAM4nr3e3uNZRn3QWyg0XfGmUZ IdijHelc6dbZGxGw0Fga/EbDPcAkpihyaHjdU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=NpBpD4Hx8ZLpyWQZJ3Jv0rr6ds8E90lS+zuayLvKk+c6m90tjgH6a8o9hmAatn85lH idFrOoD6r9ZTQNx1CuMVvKidd+Dh2O3XXv8tL6NAMiNacG26Q9oEP8uTFRaIzO4UTUIL datvG/ReeTo4G8ftWpGE0nsVcc998h2EO682Y=
well, I would prefer to keep the AngleAxis class, for various reasons.
One of them is that we also have the Quaternion, so you create an
angle axis and it gets automatically converted to whatever you want:
Quaternion q = AngleAxis(a,b);
Matrix m = AngleAxis(a,b);
that is pretty nice IMO, and Matrix3f::Rotation(a,b) will never be as
explicit as AngleAxis(a,b), isn't it ?
I also have to say that since two angle-axis cannot be directly
composed, AngleAxis(a,b) * AngleAxis(c,d) must convert the two
operands to a quaternion or a matrix. In practice, converting them to
Quaternion is always faster even if at the end you want a matrix (and
even if you have special AngleAxis to rotation matrix conversion
functions for rotation around basis axes).
gael.
> one more remark,
>
> if we drop EulerAngles then we can also drop the AngleAxis class in favor of
> just "rotation" functions, not classes. so the above snippet becomes
>
> Matrix3f m2 = Matrix3f::rotation(a1, Vector3f(1,0,0))
> * Matrix3f::rotation(a2, Vector3f(0,1,0))
> * Matrix3f::rotation(a3, Vector3f(0,0,1));
>
> I think that's nicer!
>
> Cheers,
> Benoit
>