Commit a7f6f212 authored by Pilar Cossio's avatar Pilar Cossio
Browse files

check quat range

parent d86c3eae
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment