Dihedral angle calculator

ChemAxon efa1591b5a

30-03-2005 11:22:47

In the near future a GeometryAnalizer class will be provided as part of ChemAxon's calculator plugins. Among many other functions it will be capable of calculating dihedral (torsional) angles.





In the meantime (in response to user request, see http://www.chemaxon.hu/forum/viewtopic.php?p=1638#1638) we give away the source code. Please note, that this code comes with no guarantee and it is intended for demonstration purposes.

User 870ab5b546

30-03-2005 12:22:51

Thank you! But make sure you spell "Analyzer" correctly when you add the class. ;-)
miklos wrote:
In the near future a GeometryAnalizer class will be provided as part of ChemAxon's calculator plugins. Among many other functions it will be capable of calculating dihedral (torsional) angles.





In the meantime (in response to user request, see http://www.chemaxon.hu/forum/viewtopic.php?p=1638#1638) we give away the source code. Please note, that this code comes with no guarantee and it is intended for demonstration purposes.

ChemAxon efa1591b5a

19-04-2005 13:23:36

I updated the sample code. The directionality of the dihedral angle was not considered by the original code, now this is fixed. Only one source line is changed, and this is the return statement in the calcDihedral() method. It must be





return n1.dotProd( v4 ) < 0 ? -da : da;





instead of





return da;








Please update your copies of the source code to get correct dihedral angle values.





Regards,


Miklos

User 870ab5b546

10-08-2005 16:32:07

There is a bug in the dihedral angle calculator. When the angle is exactly


180 degrees, it sometimes returns NaN (that means "not a number"), indicating an attempt to take a sqrt of a negative or some such.

ChemAxon 43e6884a7a

10-08-2005 21:44:01

Ooopps that's bad news indeed. Thanks Bob, we'll fix it and post a message here when it's done.


Regards,


Miklos

ChemAxon e08c317633

20-12-2006 12:02:17

GeometryPlugin.getDihedral(int,int,int,int) method is already available in GeomertyPlugin API. It can calculate dihedral angles.





Regards,


Zsolt