For Eigen
the arguments of .cross
must be known at compile-time to be of size 3. (For example declaring matrices as Eigen::Matrix<float, 3, 1> ...
Now I was wondering if casting a dynamic matrix would hurt? For example:
Eigen::Matrix<float, -1, 1> a(3), b(3), c(3);
...
typedef Eigen::Matrix<float, 3, 1> vector3_t;
c = ((vector3_t)a).cross((vector3_t)b);
I can't really see a down-side of this. Is there maybe a hidden copy mechanism involved?