Registered Member
|
Hi all,
I have a Eigen::Vector2d which I would like to upgrade into a 3d vector Vector3d within computations. Currently what I am writing is:
Is there a more compact way to code the same behavior? Thanks, Antoine. |
Moderator
|
If you want to extend with 0, then remove the respective content:
p_3d = <some operation>.leftCols<2>() * v_2d; If you want to extend with 1, then there is v_2D.homogeneous(); And finally, you can also create the 3D vector as: Vector3d v3; v3 << v2, 0; |
Registered Member
|
Very relevant, thanks!
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]