Re: [eigen] Re: Quaternion initialization from Block/segment (Eigen 3 beta 1) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: Quaternion initialization from Block/segment (Eigen 3 beta 1)
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Thu, 22 Jul 2010 20:05:04 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=dAwSck6yaZod1vpXwYgPrlQT2WhVpGKuOiCyidX5hpA=; b=yEeFjOtY05w6BGR2OtzDBHkYj9KYZz4f1CYhif9x1yjl/d/Ax1g2cLnWF+J2DNoOFa DMoxgVqTZVuhaAl3/JJcRJIY/X/NWdfnDrAbgioK79UKStZFRuXy5WNKPg5l2fU0rqn4 GQ44upHHNfrS4JTFNn0euJLinFSGygY7kXWKw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TNVVqnuS4iLvzJOFGCCNKC1wa9t9OjXo1jgkMBXnKZ0kMtP2r2p8ltpQqyw02SRM/m ZSa2ptorzRHVOXrlVCZy6DJJsxO6jLdDtbg7PKBTSHCcuBK5TEIYTMtSazp7GIpv4fzp lEtJARvCoytaYkD9P23ucPJAJFZFw2+5l0ql8=
Hi Jens,
On Thu, Jul 22, 2010 at 7:56 PM, Jens Andersen <jens.andersen@xxxxxxxxx> wrote:
> On a similar note.
> Is it possible to do the following in a smarter way?
>
> X_new.segment(3,4) = Eigen::Vector4d(q.x(), q.y(), q.z(), q.w());
X_new.segment(3,4) = q.coeffs()
should work. Vice versa
q.coeffs() = X_new.segment(3,4);
should work as well for setting the quaternion.
I am actually wondering why we have .vec() !? It is equivalent to
q.coeffs().template head<3>(); What is the reasoning behind this
function?
I am just asking since for Transform we have .matrix() returning the
matrix equivalent of a transformation and I find it confusing that
q.vec() does something totally different.
- Hauke