3 #include "../MemOps/MemOps.h"
4 #include "../Exceptions/exceptions.h"
5 #include "../Numerics/types.h"
14 if(xIsNan<IssmDouble>(xzvectors[i])){
16 T[0*3+0] = 1.0; T[0*3+1] = 0.0; T[0*3+2] = 0.0;
17 T[1*3+0] = 0.0; T[1*3+1] = 1.0; T[1*3+2] = 0.0;
18 T[2*3+0] = 0.0; T[2*3+1] = 0.0; T[2*3+2] = 1.0;
35 y[0] = x[2]*z[1] - x[1]*z[2];
36 y[1] = -x[2]*z[0] + x[0]*z[2];
37 y[2] = x[1]*z[0] - x[0]*z[1];
41 x_norm = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
42 y_norm = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2]);
43 z_norm = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2]);
45 x[0] = x[0]/x_norm; x[1] = x[1]/x_norm; x[2] = x[2]/x_norm;
46 y[0] = y[0]/y_norm; y[1] = y[1]/y_norm; y[2] = y[2]/y_norm;
47 z[0] = z[0]/z_norm; z[1] = z[1]/z_norm; z[2] = z[2]/z_norm;
50 T[0*3+0] = x[0]; T[0*3+1] = y[0]; T[0*3+2] = z[0];
51 T[1*3+0] = x[1]; T[1*3+1] = y[1]; T[1*3+2] = z[1];
52 T[2*3+0] = x[2]; T[2*3+1] = y[2]; T[2*3+2] = z[2];