Код: Выделить всё
template
void test(Eigen::MatrixBase& R, const double deg, const Vector3d& u) {
R = Eigen::MatrixBase::Identity(3, 3);
Vector3d u_ = u / u.norm();
for (int i = 0; i < 3; i++) {
Vector3d v = R.col(i);
R.col(i) = v * cos(deg) + u_.cross(v) * sin(deg) + (1 - cos(deg)) * (u_.dot(v)) * u_;
}
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... igenvector
Мобильная версия