#include <iostream>
#include <Eigen/Dense>
◆ main()
5 Eigen::Vector3d
v(1, 2, 3);
6 Eigen::Vector3d
w(0, 1, 2);
8 std::cout <<
"Dot product: " <<
v.dot(
w) << std::endl;
9 double dp =
v.adjoint() *
w;
10 std::cout <<
"Dot product via a matrix product: " << dp << std::endl;
12 std::cout <<
"Cross product:\n" <<
v.cross(
w) << std::endl;
13 Eigen::Vector2d
v2(1, 2);
14 Eigen::Vector2d w2(0, 1);
15 double cp =
v2.cross(w2);
16 std::cout <<
"Cross product for 2D vectors: " << cp << std::endl;
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Map< RowVectorXf > v2(M2.data(), M2.size())
References v, v2(), and w.