[gmx-users] gangle for a plane and z axis

Mohsen Ramezanpour ramezanpour.mohsen at gmail.com
Wed Jan 24 01:20:56 CET 2018


Hi Gromacs users,

I would like to calculate the angle distribution between a plane and z
axis using gangle.

In a 5-member ring, there are three atoms of O1-C-O2 which form an angle.
So, I will choose these three atom names to define the plane.

I am not sure how the g_angle makes the vector normal for this plane,
though. I know that it first make two vectors, and then does a cross
product of these two initial vectors to make the normal vector to the
plane. But, what is the direction of the vector normal to this plane?

Looking at the calc_vec function (lines 652 to 690) code from:
https://github.com/gromacs/gromacs/blob/master/src/gromacs/trajectoryanalysis/modules/angle.cpp
It is using functions cprod and rvec_sub.

I found cprod definition here:
http://manual.gromacs.org/documentation/2018-beta3/doxygen/html-lib/group__module__simd.xhtml#ga54124af0ff118d3f171b0eef07105c76

cprod (v1,v2,xout) means C = v1 * v2 (so the Right Hand Rule can be used to
get the direction)

I could not find rvec_sub function, though. However, I think:
rvec_sub(x[1], x[0], v1) gives the v1 as v1= x[1]-x[0]. i.e. a vector
starting from x[0] and ending on x[1].

Are these correct?

Cheers,
Mohsen

-- 
*Rewards work better than punishment ...*


More information about the gromacs.org_gmx-users mailing list