Files
ViewDesignEngine/eigen3/doc/examples/tut_arithmetic_dot_cross.cpp
hm a10ff5ef3b
Build & Test / build-and-test (push) Canceled after 0s
VDE Build & Test / build-and-test (push) Canceled after 0s
Build & Test / python-bindings (push) Canceled after 0s
merge: resolve conflicts with remote main (VDE-493 factories, docs); preserve empty-weights fix
2026-08-05 12:29:37 +08:00

16 lines
393 B
C++

#include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Vector3d v(1,2,3);
Vector3d w(0,1,2);
cout << "Dot product: " << v.dot(w) << endl;
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
cout << "Dot product via a matrix product: " << dp << endl;
cout << "Cross product:\n" << v.cross(w) << endl;
}