Reply to topic

Is Eigen good for calculations between discretized curves?

flambert
Registered Member
Posts
1
Karma
0
Hi,

I have two 3 dimensional discretized curves describt by 3 double arrays per curve (each curve has one array of doubles for x, one array for y, and one array for z). I have to make different calculations with this curves. For example, find the nearest point of curve 2 to an given point of curve 1, or calculate the normal vector on a specific point, and something else.
I would like to use the eigen-library. Is ist a good idea? If so, what is the best way to store the arrays into Eigen::Vector3d (there are thousand of points)?

Best regards,
flambert
User avatar ggael
Moderator
Posts
2194
Karma
15
OS
In order to get the best our of Eigen, I'd rather store the point coordinates into a Matrix<double,3,Dynamic,RowMajor>. This way data.row(0) gives you the vector of x, and data.col(i) gives you coordinates of the i-th points. You can try ColMajor or RowMajor to see what works best in your case.

For instance, the bounding box is simply obtained as: data.rowwise().minCoeff(), data.rowwise().maxCoeff().

The tangent vectors of the n-1 first points: data.tail(n-1) - data(head(n-1);

...

 
Reply to topic

Bookmarks



Who is online

Registered users: 16777216, alake, Baidu [Spider], Bing [Bot], Exabot [Bot], garthecho, Google [Bot], GordieGii, Hans, koriun, Majestic-12 [Bot], mmistretta, nezumi, onesandzeros, Yahoo [Bot]