## Is Eigen good for calculations between discretized curves?

flambert
Registered Member
Posts
1
Karma
0

### Is Eigen good for calculations between discretized curves?

Sat Feb 09, 2013 2:06 pm
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
ggael
Moderator
Posts
2653
Karma
16
OS

### Re: Is Eigen good for calculations between discretized curve

Sun Feb 10, 2013 10:02 am
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);

...

## Who is online

Registered users: Baidu [Spider], Bing [Bot], boudewijn, darkos, Exabot [Bot], ggael, Google [Bot], google01103, M4he, Majestic-12 [Bot], michelmassoud, paulus3005, sbragnaus2, Sogou [Bot], Yahoo [Bot]