This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problem with Quaternion dot

Tags: None
(comma "," separated)
dehabu
Registered Member
Posts
2
Karma
0

Problem with Quaternion dot

Thu Feb 21, 2013 5:48 pm
Hello everybody,

I'm having a problem when traying to combine two Quaternions:

Code: Select all
#include <vector>
#include <math.h>
#include <Eigen/Dense>
#include <Eigen/Geometry>

using namespace std;
using namespace Eigen;

int main(void)
{
   Quaternion<double> Q(1.0, 0.5, 0.3, 0.1);
   Quaternion<double> W(1.0, 0.5, 0.3, 0.1);


   Quaternion<double> Q2 = Q.dot(W);

   cout << "(" << Q2.w() << "," << Q2.x() << "," << Q2.y() << "," << Q2.z() << ")" << endl;
}


The compiler throws the following error: test4.cpp:17:33: error: conversion from 'Eigen::QuaternionBase<Eigen::Quaternion<double> >::Scalar {aka double}' to non-scalar type 'Eigen::Quaternion<double>' requested.

Does anybody know what is the correct way of doing this?

Best regards.
dehabu
Registered Member
Posts
2
Karma
0

Re: Problem with Quaternion dot  Topic is solved

Thu Feb 21, 2013 6:01 pm
My mistake. Dot was not the method I was looking for. It's the operator *.

Problem solved.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]