# Dihedral angles - how to calculate

web-server-account web at pcjfn.msc.com
Fri Feb 21 09:33:46 EST 1997

```George A. Heavner (gheavner at voicenet.com) wrote:
: I am working on a project where I have cartesian coordinates for four
: consecutive atoms and need to calculate the dihedral angle (with correct
: sign).  I am not a crystallographer and readily admit to difficulty with
: the math.  The magnitude is not difficult (angle between two planes) but
: I am stuck on the sign.  Can anyone provide me with the procedure or
: point me to a readily intelligible text or other source.

The book "Crystal Structure Analysis for Chemists and Biologists"
by Jenny P. Glusker (with Mitchell Lewis and Miriam Rossi) gives
four different ways of calculating the dihedral angle, p 465-469.

Probably the most direct is:

Consider the four atom chain   1 - 2 - 3 - 4

The distances between any two atoms is denoted d(ij).
For example d13 is the distance between atoms 1 and 3.

Since you already have cartesian coordinates, this is easily
calculated as  SQRT( SQ(x3-x1) + SQ(y3-y1) + SQ(z3-z1) )

SQRT(x) = square root of x
SQ(x)   = x*x

The dihedral angle is defined as follows:

cos(angle) = P/SQRT(Q)

where

P = SQ(d12) * ( SQ(d23)+SQ(d34)-SQ(d24)) +
SQ(d23) * (-SQ(d23)+SQ(d34)+SQ(d24)) +
SQ(d13) * ( SQ(d23)-SQ(d34)+SQ(d24)) -
2 * SQ(d23) * SQ(d14)

and

Q = (d12 + d23 + d13) * ( d12 + d23 - d13) *
(d12 - d23 + d13) * (-d12 + d23 + d13 ) *
(d23 + d34 + d24) * ( d23 + d34 - d24 ) *
(d23 - d34 + d24) * (-d23 + d34 + d24 )

As a test case, for

d12 = 2.38
d23 = 1.481
d34 = 1.487
d13 = 3.564
d14 = 3.619
d24 = 2.408

P = 20.83
SQRT(Q) = 21.40
angle = 13.3 degrees.

--
Bev Vincent
Molecular Structure Corp
The Woodlands, TX
http://www.msc.com/

```