aboutsummaryrefslogtreecommitdiff
path: root/dave
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-09 02:38:10 -0500
committercnlohr <lohr85@gmail.com>2017-03-09 02:38:10 -0500
commit6362b6ee00ef5e394b636e2bb63d5e20c18c01f8 (patch)
treedd457d6b04e77d95faffc56df5d0fcbe3a5d4095 /dave
parent48aa2b2a13daf5a007deb3fedf0da4e49aae0fd5 (diff)
downloadlibsurvive-6362b6ee00ef5e394b636e2bb63d5e20c18c01f8.tar.gz
libsurvive-6362b6ee00ef5e394b636e2bb63d5e20c18c01f8.tar.bz2
switch to atan2 instead of asin. Take out of performance check and put into test mode again.
Diffstat (limited to 'dave')
-rw-r--r--dave/AffineSolve.c9
-rw-r--r--dave/Makefile3
-rwxr-xr-xdave/dclapack_testbin12836 -> 12960 bytes
3 files changed, 7 insertions, 5 deletions
diff --git a/dave/AffineSolve.c b/dave/AffineSolve.c
index ad9ccb5..e848ade 100644
--- a/dave/AffineSolve.c
+++ b/dave/AffineSolve.c
@@ -314,6 +314,7 @@ PRINT(ab,2,1);
T[2][0]=R[2][0]; T[2][1]=R[2][1]; T[2][2]=R[2][2]; T[2][3]=trans[2];
T[3][0]=0.0; T[3][1]=0.0; T[3][2]=0.0; T[3][3]=1.0;
+ PRINT_MAT(T,4,4);
//-------------------
// Plot the output points
//-------------------
@@ -321,11 +322,11 @@ PRINT(ab,2,1);
float Tx = T[0][0]*X_in[0][i] + T[0][1]*X_in[1][i] + T[0][2]*X_in[2][i] + T[0][3];
float Ty = T[1][0]*X_in[0][i] + T[1][1]*X_in[1][i] + T[1][2]*X_in[2][i] + T[1][3];
float Tz = T[2][0]*X_in[0][i] + T[2][1]*X_in[1][i] + T[2][2]*X_in[2][i] + T[2][3];
- S_out[0][i] = asin(Tx / Ty); // horiz
- S_out[1][i] = asin(Tz / Ty); // vert
+ S_out[0][i] = atan2(Tx, Ty); // horiz
+ S_out[1][i] = atan2(Tz, Ty); // vert
//S_out[0][i] = Tx;
//S_out[1][i] = Tz;
-// printf("point %i Txyz %f %f %f in %f %f out %f %f morph %f %f\n", i, Tx,Ty,Tz, S_in[0][i], S_in[1][i], S_out[0][i], S_out[1][i], S_morph[0][i], S_morph[1][i]);
+ printf("point %i Txyz %f %f %f in %f %f out %f %f morph %f %f\n", i, Tx,Ty,Tz, S_in[0][i], S_in[1][i], S_out[0][i], S_out[1][i], S_morph[0][i], S_morph[1][i]);
}
// printf("xbar %f %f %f\n", xbar[0], xbar[1], xbar[2]);
@@ -603,7 +604,7 @@ int main()
//--------------------------------------------------
int loop;
- for (loop=0; loop<1000000; loop++)
+ for (loop=0; loop<1; loop++)
{
// Run OrthoSolve
OrthoSolve(
diff --git a/dave/Makefile b/dave/Makefile
index fc7dde5..7738850 100644
--- a/dave/Makefile
+++ b/dave/Makefile
@@ -1,6 +1,7 @@
all:
# gcc -O3 -o kalman_filter kalman_filter.c main.c
gcc -O3 -o dclapack_test dclapack_test.c -lm
- gcc -O3 -o AffineSolve AffineSolve.c -lm
+ gcc -O0 -g -o AffineSolve AffineSolve.c -lm #-Wall
+
clean:
rm -f kalman_filter dclapack_test
diff --git a/dave/dclapack_test b/dave/dclapack_test
index 7789e78..bac05e7 100755
--- a/dave/dclapack_test
+++ b/dave/dclapack_test
Binary files differ