~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/math/matrix/mat_mat3.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)Interchange mat3's and matrices
  2  */
  3 
  4 #include <tina/sys.h>
  5 #include <tina/math.h>
  6 
  7 double  matrix_getf();
  8 Matrix *matrix_alloc();
  9 
 10 Matrix *matrix_mat3(Mat3 m)
 11 {
 12     Matrix *mat = matrix_alloc(3, 3, matrix_full, float_v);
 13     float **el;
 14     int     i, j;
 15 
 16     el = mat->el.float_v;
 17     for (i = 0; i < 3; ++i)
 18         for (j = 0; j < 3; ++j)
 19             el[i][j] = m.el[i][j];
 20     return (mat);
 21 }
 22 
 23 Mat3    mat3_matrix(Matrix * mat)
 24 {
 25     Mat3    m = {Mat3_id};
 26     int     i, j;
 27 
 28     for (i = 0; i < 3; ++i)
 29         for (j = 0; j < 3; ++j)
 30             m.el[i][j] = matrix_getf(mat, i, j);
 31     return (m);
 32 }
 33 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.