diff --git a/param.cpp b/param.cpp index 8ad74cc2e939cbd3243e6494898e0a23da783104..7c564ca14cf332bfc73d85e65f259a837a44eae2 100644 --- a/param.cpp +++ b/param.cpp @@ -564,6 +564,13 @@ int bioem_param::forprintBest(const char* fileinput) angles[0].pos[2] = atof(token); cout << "Best Q3 " << angles[0].pos[2] << "\n"; } + else if (strcmp(token, "BEST_Q4") == 0) + { + token = strtok(NULL, " "); + angles[0].quat4= atof(token); + cout << "Best Q3 " << angles[0].quat4 << "\n"; + } + else if (strcmp(token, "USE_PSF") == 0) { usepsf=true; @@ -668,7 +675,12 @@ int bioem_param::forprintBest(const char* fileinput) } - if(doquater)angles[0].quat4=sqrt(1.f-angles[0].pos[0]*angles[0].pos[0]-angles[0].pos[1]*angles[0].pos[1]-angles[0].pos[2]*angles[0].pos[2]); + if(doquater){ + if(angles[0].quat4*angles[0].quat4>1){cout << " Problem with quaternion "<< angles[0].quat4 << "\n";exit(1);} + if(angles[0].pos[0]*angles[0].pos[0]>1){cout << " Problem with quaternion "<< angles[0].pos[0] << "\n";exit(1);} + if(angles[0].pos[1]*angles[0].pos[1]>1){cout << " Problem with quaternion "<< angles[0].pos[1] << "\n";exit(1);} + if(angles[0].pos[2]*angles[0].pos[2]>1){cout << " Problem with quaternion "<< angles[0].pos[2] << "\n";exit(1);} + } input.close();