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

Linux Cross Reference
Tina4/src/geomstat/basis/basis.c

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

  1 /**@(#)
  2 **/
  3 #include <tina/sys.h>
  4 #include <tina/sysfuncs.h>
  5 #include <tina/math.h>
  6 #include <tina/mathfuncs.h>
  7 #include <tina/vision.h>
  8 #include <tina/visionfuncs.h>
  9 #include <geomstat/geomstat.h>
 10 #include <geomstat/geomstatfuncs.h>
 11 
 12 Basis2 *basis2_alloc(void)
 13 {
 14     Basis2 *b = ts_ralloc(Basis2);
 15 
 16     b->ex = vec2_ex();
 17     b->ey = vec2_ey();
 18     return (b);
 19 }
 20 
 21 void    basis2_format(Basis2 * basis)
 22 {
 23     Vec2    ex = {Vec2_id};
 24     Vec2    ey = {Vec2_id};
 25 
 26     ex = basis->ex;
 27     ey = basis->ey;
 28     format("Basis2:\n");
 29     format("ex = %15.6f%15.6f\n", vec2_x(ex), vec2_y(ex));
 30     format("ey = %15.6f%15.6f\n", vec2_x(ey), vec2_y(ey));
 31 }
 32 
 33 Basis3 *basis3_alloc(void)
 34 {
 35     Basis3 *b = ts_ralloc(Basis3);
 36 
 37     b->ex = vec3_ex();
 38     b->ey = vec3_ey();
 39     b->ez = vec3_ez();
 40     return (b);
 41 }
 42 
 43 void    basis3_format(Basis3 * basis)
 44 {
 45     Vec3    ex = {Vec3_id};
 46     Vec3    ey = {Vec3_id};
 47     Vec3    ez = {Vec3_id};
 48 
 49     ex = basis->ex;
 50     ey = basis->ey;
 51     ez = basis->ez;
 52     format("Basis3:\n");
 53     format("ex = %15.6f%15.6f%15.6f\n", vec3_x(ex), vec3_y(ex), vec3_z(ex));
 54     format("ey = %15.6f%15.6f%15.6f\n", vec3_x(ey), vec3_y(ey), vec3_z(ey));
 55     format("ez = %15.6f%15.6f%15.6f\n", vec3_x(ez), vec3_y(ez), vec3_z(ez));
 56 }
 57 
 58 void    basis_format(void *basis, int type)
 59 {
 60     switch (type)
 61     {
 62         case SCALAR:
 63         format("Basis0:\n(nil)\n");
 64         return;
 65     case POINT2:
 66     case LINE2:
 67         basis2_format((Basis2 *) basis);
 68         return;
 69     case POINT3:
 70     case LINE3:
 71     case PLANE:
 72         basis3_format((Basis3 *) basis);
 73         return;
 74     }
 75 }
 76 

~ [ 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.