1. ## torsion angle

Hi guys. I am an undergraduate student in Biology and I ve been assigned to calculate the torsion angles in a molecule... The hole idea is that we have 4 points in a 3D system A-B-C-D and the only thing we know is their coordinates, i.e. A(xa, ya, za). The wanted is to find tha torsion angle among between A-B an C-D. I have repeatedly searched and asked around but I still cant figure out what would a possible formula or algorithm would be. I have found this in the archives of a mailing list but I really dont know if it stands or is it true:

even if this formula stands I have a lot of question.
1) how can I calculate r1, r2, r3 out of the coordinates of the points
2) how can I multipy them. well actually I think this is the cross product but i am not sure..
3) I found how to calculate the cross product of two vectors and I think that this is it

a × b = (a2b3 − a3b2) i + (a3b1 − a1b3) j + (a1b2 − a2b1) k = (a2b3 − a3b2, a3b1 − a1b3, a1b2 − a2b1) however I still cant understand how can a vector which -from what I understood- is not just a point, be defined only by three coordinates, and if so how is this calculated out of its start and endpoint...
4)in the third an fourth equation from what I can tell there are two or more unknown elements so how can eaxh be calculated...
5) if I can find the cos or the sin of the angle what do I need atan for, and what atan stands for, since tha only things I know is cos, sin and tan.
6) also what is the difference betwenn p1 an |p1| and how are they calculated?
7) Last but not least I encounter two major problems which makes it even harder to find an answer, since i am a biologist and maths was never of first priority for me -regreatably i must admit- and english is not my native language so the math terms are not easily understood.
Please can anyone help me finding some answers or even point some directions here? thank you very much!!!

2. Originally Posted by pytheas
Hi guys. I am an undergraduate student in Biology and I ve been assigned to calculate the torsion angles in a molecule... The hole idea is that we have 4 points in a 3D system A-B-C-D and the only thing we know is their coordinates, i.e. A(xa, ya, za). The wanted is to find tha torsion angle among between A-B an C-D. I have repeatedly searched and asked around but I still cant figure out what would a possible formula or algorithm would be. I have found this in the archives of a mailing list but I really dont know if it stands or is it true:

even if this formula stands I have a lot of question.
1) how can I calculate r1, r2, r3 out of the coordinates of the points
2) how can I multipy them. well actually I think this is the cross product but i am not sure..
3) I found how to calculate the cross product of two vectors and I think that this is it

a × b = (a2b3 − a3b2) i + (a3b1 − a1b3) j + (a1b2 − a2b1) k = (a2b3 − a3b2, a3b1 − a1b3, a1b2 − a2b1) however I still cant understand how can a vector which -from what I understood- is not just a point, be defined only by three coordinates, and if so how is this calculated out of its start and endpoint...
4)in the third an fourth equation from what I can tell there are two or more unknown elements so how can eaxh be calculated...
5) if I can find the cos or the sin of the angle what do I need atan for, and what atan stands for, since tha only things I know is cos, sin and tan.
6) also what is the difference betwenn p1 an |p1| and how are they calculated?
7) Last but not least I encounter two major problems which makes it even harder to find an answer, since i am a biologist and maths was never of first priority for me -regreatably i must admit- and english is not my native language so the math terms are not easily understood.
Please can anyone help me finding some answers or even point some directions here? thank you very much!!!
You've got a lot of work ahead of you, but fortunately it looks like it is all applying definitions.

You have the positions of the four points in the molecule. So
$\displaystyle r_1 = (x_2 - x_1)\hat{i} + (y_2 - y_1)\hat{j} + (z_2 - z_1)\hat{k}$

$\displaystyle r_2 = (x_3 - x_2)\hat{i} + (y_3 - y_2)\hat{j} + (z_3 - z_2)\hat{k}$

etc.

Your formula for the cross product is correct, so all you need is how to find |p| from a vector p. |p| is the length (or magnitude) of the vector p and can be found by using the Pythagorean Theorem in 3D:
$\displaystyle \vec{p} = (p_x, p_y, p_z)$

$\displaystyle |p| = \sqrt{p_x^2 + p_y^2 + p_z^2}$

The rest of what you need can be accomplished by a calculator and lots of coffee. Good luck with it!

-Dan

3. I was just looking over my response and realized I had forgotten the dot product. Given two vectors $\displaystyle \vec{a} = (a_x, a_y, a_z)$ and $\displaystyle \vec{b} = (b_x, b_y, b_z)$ the dot product between them is
$\displaystyle \vec{a} \cdot \vec{b} = a_xb_x + a_yb_y + a_zb_z = |a|~|b| ~ cos(\phi)$

In fact, with this knowledge I see no reason why you should have to calculate the box product $\displaystyle r_2 \cdot (p_2 \times p_1)$ because you can find the angle via
$\displaystyle cos(\phi) = \frac{\vec{p_1} \cdot \vec{p_2}}{|p_1|~|p_2|}$

-Dan

4. I cant say how much you ve helped. really. however since i am a biologist and i am totally ignorant as far as math is concerned. I have some more questions... if you plzzz...
1) in the types

types

i, j, k, have any real meaning? I mean I know tha coordinates of the points but what are these numbers?
2) and most ridiculous. ok I find out the cos. how can I then calculate the angle? someone told me about arccos.. is this true?
Anyway thank you... It was a major step forward...

ps. I need atan because all these are supposed to be embedded in program written in perl which however does not support inverse trigonometric functions except for atan.. thanks

5. nevermind I figured it out... Can anyone tell me how can I find given the above whether an angle is clockwise or counterclockwise?

6. for knowing whether the angle is clockwise or anticlockwise you need to find he scalar triplet product.
if the scalar triplet product is positive then its clockwise or if its negative then anti clockwise.