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

Linux Cross Reference
Tina4/src/geomstat/geom/gstat_ln3.c

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

  1 /**@(#)
  2 **/
  3 #include <tina/sys.h>
  4 #include <tina/math.h>
  5 #include <tina/mathfuncs.h>
  6 #include <tina/vision.h>
  7 #include <tina/visionfuncs.h>
  8 
  9 Basis3 *line3_basis(Line3 * line)
 10 {
 11     Basis3 *b;
 12     Basis3 *basis3_alloc();
 13 
 14     b = basis3_alloc();
 15     vec3_basis(line->v, vec3_ey(), &b->ex, &b->ey, &b->ez);
 16     return (b);
 17 }
 18 
 19 void    line3_correct(Line3 * line, Basis3 * basis, Vector * x)
 20 {
 21     double  x0 = vector_getf(x, 0);
 22     double  x1 = vector_getf(x, 1);
 23     double  x2 = vector_getf(x, 2);
 24     double  x3 = vector_getf(x, 3);
 25     Vec3    aim = {Vec3_id};
 26     Vec3    up = {Vec3_id};
 27 
 28     line->p = vec3_sum3(line->p, vec3_times(x0, basis->ex),
 29                         vec3_times(x1, basis->ey));
 30     aim = vec3_sum3(basis->ez, vec3_times(x2, basis->ex),
 31                     vec3_times(x3, basis->ey));
 32     up = vec3_sum(basis->ey, vec3_times(-x3, basis->ez));
 33     vec3_basis(aim, up, &basis->ex, &basis->ey, &basis->ez);
 34 
 35     line->v = basis->ez;
 36     line->p1 = vec3_closest_lines(line->p, line->v,
 37                                   vec3_zero(), vec3_unit(line->p1));
 38     line->p2 = vec3_closest_lines(line->p, line->v,
 39                                   vec3_zero(), vec3_unit(line->p2));
 40 
 41     /**
 42     alternatively:
 43     line->p1 = vec3_proj_on_line(line->p1, line->p, line->v);
 44     line->p2 = vec3_proj_on_line(line->p2, line->p, line->v);
 45     **/
 46 }
 47 

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