3#include <cgv/math/mat.h>
4#include <cgv/math/inv.h>
5#include <cgv/math/constants.h>
20void polar(
const mat<T> &c, mat<T> &r, mat<T> &a,
int num_iter=15)
23 for(
int i =0; i < num_iter;i++)
24 r = ((T)0.5)*(r+transpose(inv(r)));
45 mat<T> A = (T)0.5*(R - transpose(R));
46 mat<T> S = (T)0.5*(R + transpose(R));
49 T abssina = (T)sqrt(0.5*(
double)(A.frobenius_norm()*A.frobenius_norm()));
50 T cosa = 0.5*(trace(S)-1.0);
54 angle =(T)(cgv::math::rad2deg(asin(abssina))));
56 angle = (T)180.0-angle;
58 if(angle == 0 || angle == 180.0)
A matrix type (full column major storage) The matrix can be loaded directly into OpenGL without need ...
unsigned ncols() const
number of columns
unsigned nrows() const
number of rows
this header is dependency free