13 return vn + cos(a)*(v - vn) + sin(a)*
cross(n, v);
22 if (len > 2 * std::numeric_limits<T>::epsilon())
26 angle = atan2(len,
dot(v0, v1));
39 axis(0) = R(2, 1) - R(1, 2);
40 axis(1) = R(0, 2) - R(2, 0);
41 axis(2) = R(1, 0) - R(0, 1);
44 if (len < 2 * std::numeric_limits<T>::epsilon()) {
46 for (
unsigned c = 0; c<3; ++c)
62 angle = atan2(len, tra - T(1));
double normalize()
normalize the vector using the L2-Norm and return the length
Definition: fvec.h:260
matrix of fixed size dimensions
Definition: fmat.h:23
T length() const
length of the vector L2-Norm
Definition: fvec.h:219
fvec< T, N > cross(const fvec< T, N > &v, const fvec< T, N > &w)
returns the cross product of vector v and w
Definition: fvec.h:338
int decompose_rotation_to_axis_and_angle(const cgv::math::fmat< T, 3, 3 > &R, cgv::math::fvec< T, 3 > &axis, T &angle)
decompose a rotation matrix into axis angle representation
Definition: geom.h:37
T dot(const fvec< T, N > &v, const fvec< T, N > &w)
returns the dot product of vector v and w
Definition: fvec.h:300
cgv::math::fvec< T, 3 > rotate(const cgv::math::fvec< T, 3 > &v, const cgv::math::fvec< T, 3 > &n, T a)
rotate vector v around axis n by angle a (given in radian)
Definition: geom.h:10
void compute_rotation_axis_and_angle_from_vector_pair(const cgv::math::fvec< T, 3 > &v0, const cgv::math::fvec< T, 3 > &v1, cgv::math::fvec< T, 3 > &axis, T &angle)
compute a rotation axis and a rotation angle in radian that rotates v0 onto v1.
Definition: geom.h:18
the cgv namespace
Definition: vr_calib.cxx:9
cgv::math::fmat< T, 3, 3 > build_orthogonal_frame(const cgv::math::fvec< T, 3 > &v0, const cgv::math::fvec< T, 3 > &v1)
Given two vectors v0 and v1 extend to orthonormal frame and return 3x3 matrix containing frame vector...
Definition: geom.h:76
T trace() const
returns the trace
Definition: fmat.h:168