Re: [eigen] Re: Quaternion initialization from Block/segment (Eigen 3 beta 1)

[ Thread Index | Date Index | More Archives ]

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

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

Mail converted by MHonArc 2.6.19+