CODE FOR VECTOR ALGEBRA DIHEDRAL ANGLE CALCULATION
4 views (last 30 days)
Show older comments
I have calculated the dihedral angle (phi, psi of am amino acid in a protein) using following steps. Coordinates (X,Y,Z) of four atoms are given.
Let the four points (atoms) be a,b,c,d.
STEP 1: Calculation of vectors:
p = b - a q = c - b r = d - c
STEP 2: To find normal to the planes:
n1 = p X q n2 = q X r
(theta) = cos inverse [ (n1.n2) / n1.|n2| ]
I am getting the numerical value correct , but the sign is different. Where have I be wrong ?
Answers (1)
Roger Stafford
on 6 Aug 2013
Your notation "(n1.n2) / n1.|n2|" is confusing. If by this you mean the dot product of n1 and n2 divided by the product of their norms, you should get the correct answer for theta. I don't see how you can possibly get the wrong sign for it since the principal values of the inverse cosine are understood to lie between 0 and pi radians and are therefore all positive.
I assume the dihedral angle you are seeking is that defined by the two half planes which contain atom a and d respectively with the line bc as their intersection. The other possible dihedral angle would be the supplement of this angle, but either angle would be positive.
0 Comments
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!