This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class Vector3> | |
std::pair<Vector3, Vector3> best_plane_from_points(const std::vector<Vector3> & c) | |
{ | |
// copy coordinates to matrix in Eigen format | |
size_t num_atoms = c.size(); | |
Eigen::Matrix< Vector3::Scalar, Eigen::Dynamic, Eigen::Dynamic > coord(3, num_atoms); | |
for (size_t i = 0; i < num_atoms; ++i) coord.col(i) = c[i]; | |
// calculate centroid | |
Vector3 centroid(coord.row(0).mean(), coord.row(1).mean(), coord.row(2).mean()); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.