Commit 630dd9b3 by Chloe Dequeker

added rotate_global function

parent ee5f0b18
...@@ -18,12 +18,12 @@ void sphericToxyz(float *x, float *y, float *z, float x0, float y0, float z0, fl ...@@ -18,12 +18,12 @@ void sphericToxyz(float *x, float *y, float *z, float x0, float y0, float z0, fl
struct pdb_values* rotate_global(struct pdb_values* pdb, struct pdb_values* pdbR, struct pdb_values* newPDB, float R, float theta, float phi, float alpha,float beta,float gamma){ struct pdb_values* rotate_global(struct pdb_values* pdb, struct pdb_values* pdbR, struct pdb_values* newPDB, float R, float theta, float phi, float alpha,float beta,float gamma){
/* This function aims at rotating the pdb parameter and gets its new coordinates /* This function aims at rotating the pdb parameter and gets its new coordinates
* in the newPDB parameter. * in the newPDB parameter.
* Let the N axis the rotation of the x axis around the z axis by an alpha angle. * Let the N axis the rotation of the x axis about the z axis by an alpha angle.
* Let the Z axis the rotation of the z axis around the N axis by a beta angle. * Let the Z axis the rotation of the z axis about the N axis by a beta angle.
* *
* The xyz system is centered on the center of mass of the pdb parameter. * The xyz system is centered on the center of mass of the pdb parameter.
* We then rotate the pdb by an alpha angle around the axis z, then by a beta * We then rotate the pdb by an alpha angle about the axis z, then by a beta
* angle around the axis N and finally by a gamma angle around the axis Z. * angle about the axis N and finally by a gamma angle about the axis Z.
* The following image available on wikipedia can help to understand the scheme : * The following image available on wikipedia can help to understand the scheme :
* https://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Eulerangles.svg/300px-Eulerangles.svg.png * https://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Eulerangles.svg/300px-Eulerangles.svg.png
*/ */
...@@ -38,20 +38,19 @@ struct pdb_values* rotate_global(struct pdb_values* pdb, struct pdb_values* pdbR ...@@ -38,20 +38,19 @@ struct pdb_values* rotate_global(struct pdb_values* pdb, struct pdb_values* pdbR
float c_g=cos(gamma),s_g=sin(gamma); float c_g=cos(gamma),s_g=sin(gamma);
/* TODO : This needs to be updated to match global settings */ /* Coordinates of the N axis */
float xN = c_a; float xN = c_a;
float yN = s_a; float yN = s_a;
float zN = 0; float zN = 0;
/* The coordinates of the unit vector for the axis Z can be computed as such : /* The coordinates of the unit vector for the axis Z can be computed as such :
* TODO : To be updated as well ! * xZ : c_b
* xZ : -s_a0 * c_b0 * yZ : c_a * s_b
* yZ : c_a0 * c_b0 * zZ : s_a * s_b
* zZ : s_b0
*/ */
float xZ = 0; float xZ = c_b;
float yZ = 0; float yZ = c_a * s_b;
float zZ = 0; float zZ = s_a * s_b;
if(newPDB == NULL){ if(newPDB == NULL){
newPDB = allocate_pdb(pdb->nbRes); newPDB = allocate_pdb(pdb->nbRes);
...@@ -246,8 +245,8 @@ struct pdb_values* rotate_sophie(struct pdb_values* pdb, struct pdb_values* pdbR ...@@ -246,8 +245,8 @@ struct pdb_values* rotate_sophie(struct pdb_values* pdb, struct pdb_values* pdbR
void getAnglesFromCA1andCA5_sophie(struct pdb_values* pdb, float* alpha, float* beta, float* gamma){ void getAnglesFromCA1andCA5_sophie(struct pdb_values* pdb, float* alpha, float* beta, float* gamma){
/* In this function, we first need to find the initial angles alpha and beta that correspond /* In this function, we first need to find the initial angles alpha and beta that correspond
* to the angles alpha and beta for the first CA of the protein. * to the angles alpha and beta for the first CA of the protein.
* Then, we need to apply a rotation alpha around the axis Z, then a rotation beta * Then, we need to apply a rotation alpha about the axis Z, then a rotation beta
* around the axis X on the fifth atom CA of the protein. * about the axis X on the fifth atom CA of the protein.
* The coordinates of the then rotated atom CA 5 will give us the initial angle gamma * The coordinates of the then rotated atom CA 5 will give us the initial angle gamma
*/ */
......
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