Changeset View
Changeset View
Standalone View
Standalone View
intern/libmv/libmv/numeric/numeric.h
| Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | |||||
| // This is computed using the Rodrigues formula, see: | // This is computed using the Rodrigues formula, see: | ||||
| // http://mathworld.wolfram.com/RodriguesRotationFormula.html | // http://mathworld.wolfram.com/RodriguesRotationFormula.html | ||||
| Mat3 RotationRodrigues(const Vec3& axis); | Mat3 RotationRodrigues(const Vec3& axis); | ||||
| // Make a rotation matrix such that center becomes the direction of the | // Make a rotation matrix such that center becomes the direction of the | ||||
| // positive z-axis, and y is oriented close to up. | // positive z-axis, and y is oriented close to up. | ||||
| Mat3 LookAt(Vec3 center); | Mat3 LookAt(Vec3 center); | ||||
| // Return a diagonal matrix from a vector containg the diagonal values. | // Return a diagonal matrix from a vector containing the diagonal values. | ||||
| template <typename TVec> | template <typename TVec> | ||||
| inline Mat Diag(const TVec& x) { | inline Mat Diag(const TVec& x) { | ||||
| return x.asDiagonal(); | return x.asDiagonal(); | ||||
| } | } | ||||
| template <typename TMat> | template <typename TMat> | ||||
| inline double FrobeniusNorm(const TMat& A) { | inline double FrobeniusNorm(const TMat& A) { | ||||
| return sqrt(A.array().abs2().sum()); | return sqrt(A.array().abs2().sum()); | ||||
| ▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines | |||||