FACT++  1.0
static void t_vecmat ( int *  status)
static

Definition at line 997 of file palTest.c.

References i, palDav2m(), palDcs2c(), palDeuler(), palDimxv(), palDm2av(), palDmxm(), palDmxv(), palDvdv(), palDvn(), palDvxv(), vrmat(), and vvd().

Referenced by main().

997  {
998  int i;
999 
1000  /* palDav2m */
1001  double drm1[3][3];
1002  double dav[3] = { -0.123, 0.0987, 0.0654 };
1003  double dav2m_expected[3][3] = {
1004  { 0.9930075842721269, 0.05902743090199868, -0.1022335560329612 },
1005  { -0.07113807138648245, 0.9903204657727545, -0.1191836812279541 },
1006  { 0.09420887631983825, 0.1256229973879967, 0.9875948309655174 },
1007  };
1008 
1009  /* palDeuler */
1010  double drm2[3][3];
1011  double deuler_expected[3][3] = {
1012  { -0.1681574770810878, 0.1981362273264315, 0.9656423242187410 },
1013  { -0.2285369373983370, 0.9450659587140423, -0.2337117924378156 },
1014  { -0.9589024617479674, -0.2599853247796050, -0.1136384607117296 } };
1015 
1016  /* palDmxm */
1017  double drm[3][3];
1018  double dmxm_expected[3][3] = {
1019  { -0.09010460088585805, 0.3075993402463796, 0.9472400998581048 },
1020  { -0.3161868071070688, 0.8930686362478707, -0.3200848543149236 },
1021  { -0.9444083141897035, -0.3283459407855694, 0.01678926022795169 },
1022  };
1023 
1024  /* palDcs2c et al */
1025  double dv1[3];
1026  double dv2[3];
1027  double dv3[3];
1028  double dv4[3];
1029  double dv5[3];
1030  double dv6[3];
1031  double dv7[3];
1032  double dvm;
1033 
1034  /* palDav2m */
1035  palDav2m( dav, drm1 );
1036  vrmat( drm1, dav2m_expected, "palDav2m", 1.0e-12, status );
1037 
1038  /* Test palDeuler */
1039  palDeuler( "YZY", 2.345, -0.333, 2.222, drm2 );
1040  vrmat( drm2, deuler_expected, "palDeuler", 1.0e-12, status );
1041 
1042  /* palDmxm */
1043  palDmxm( drm2, drm1, drm );
1044  vrmat( drm, dmxm_expected, "palDmxm", 1.0e-12, status );
1045 
1046  /* palDcs2c */
1047  palDcs2c( 3.0123, -0.999, dv1 );
1048  vvd ( dv1[0], -0.5366267667260525, 1e-12,
1049  "palDcs2c", "x", status );
1050  vvd ( dv1[1], 0.06977111097651444, 1e-12,
1051  "palDcs2c", "y", status );
1052  vvd ( dv1[2], -0.8409302618566215, 1e-12,
1053  "palDcs2c", "z", status );
1054 
1055  /* palDmxv */
1056  palDmxv( drm1, dv1, dv2 );
1057  palDmxv( drm2, dv2, dv3 );
1058  vvd ( dv3[0], -0.7267487768696160, 1e-12,
1059  "palDmxv", "x", status );
1060  vvd ( dv3[1], 0.5011537352639822, 1e-12,
1061  "palDmxv", "y", status );
1062  vvd ( dv3[2], 0.4697671220397141, 1e-12,
1063  "palDmxv", "z", status );
1064 
1065  /* palDimxv */
1066  palDimxv( drm, dv3, dv4 );
1067  vvd ( dv4[0], -0.5366267667260526, 1e-12,
1068  "palDimxv", "X", status );
1069  vvd ( dv4[1], 0.06977111097651445, 1e-12,
1070  "palDimxv", "Y", status );
1071  vvd ( dv4[2], -0.8409302618566215, 1e-12,
1072  "palDimxv", "Z", status );
1073 
1074  /* palDm2av */
1075  palDm2av( drm, dv5 );
1076  vvd ( dv5[0], 0.006889040510209034, 1e-12,
1077  "palDm2av", "X", status );
1078  vvd ( dv5[1], -1.577473205461961, 1e-12,
1079  "palDm2av", "Y", status );
1080  vvd ( dv5[2], 0.5201843672856759, 1e-12,
1081  "palDm2av", "Z", status );
1082 
1083  for (i=0; i<3; i++) {
1084  dv5[i] *= 1000.0;
1085  }
1086 
1087  /* palDvn */
1088  palDvn( dv5, dv6, &dvm );
1089  vvd ( dv6[0], 0.004147420704640065, 1e-12,
1090  "palDvn", "X", status );
1091  vvd ( dv6[1], -0.9496888606842218, 1e-12,
1092  "palDvn", "Y", status );
1093  vvd ( dv6[2], 0.3131674740355448, 1e-12,
1094  "palDvn", "Z", status );
1095  vvd ( dvm, 1661.042127339937, 1e-9, "palDvn",
1096  "M", status );
1097 
1098  vvd ( palDvdv ( dv6, dv1 ), -0.3318384698006295,
1099  1e-12, "palDvn", " ", status );
1100 
1101  /* palDvxv */
1102  palDvxv( dv6, dv1, dv7 );
1103  vvd ( dv7[0], 0.7767720597123304, 1e-12,
1104  "palDvxv", "X", status );
1105  vvd ( dv7[1], -0.1645663574562769, 1e-12,
1106  "palDvxv", "Y", status );
1107  vvd ( dv7[2], -0.5093390925544726, 1e-12,
1108  "palDvxv", "Z", status );
1109 
1110 }
void palDm2av(double rmat[3][3], double axvec[3])
Definition: palOne2One.c:486
void palDmxv(double dm[3][3], double va[3], double vb[3])
Definition: palOne2One.c:605
void palDvn(double v[3], double uv[3], double *vm)
Definition: palOne2One.c:1015
int i
Definition: db_dim_client.c:21
void palDmxm(double a[3][3], double b[3][3], double c[3][3])
Definition: palOne2One.c:567
double palDvdv(double va[3], double vb[3])
Definition: palOne2One.c:976
void palDvxv(double va[3], double vb[3], double vc[3])
Definition: palOne2One.c:1053
void palDcs2c(double a, double b, double v[3])
Definition: palOne2One.c:368
void palDeuler(const char *order, double phi, double theta, double psi, double rmat[3][3])
Definition: palDeuler.c:95
static void vrmat(double rmat[3][3], double expected[3][3], const char *func, double dval, int *status)
Definition: palTest.c:158
void palDav2m(double axvec[3], double rmat[3][3])
Definition: palOne2One.c:286
void palDimxv(double dm[3][3], double va[3], double vb[3])
Definition: palOne2One.c:446
static void vvd(double val, double valok, double dval, const char *func, const char *test, int *status)
Definition: palTest.c:99

+ Here is the call graph for this function:

+ Here is the caller graph for this function: