Bugs item #3260566, was opened at 2011-03-30 11:54
Message generated for change (Tracker Item Submitted) made by ksdrew
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428740&aid=3260566&group_id=40728

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library Functions
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: ksdrew (ksdrew)
Assigned to: Nobody/Anonymous (nobody)
Summary: precision error in conversion from internal coordiantes

Initial Comment:
Name: Kevin Drew
Email: kd...@nyu.edu
Version: openbabel-2.3.0
OS: Mac and Linux

I noticed a small change in torsion angle degrees when I input gzmat formatted 
files (internal coordinates).  I only notice it with torsion angles of 0.0 (d5 
and d6 in sample) and 180.0 (d9 in sample).  The roundtrip conversion returns 
values of 0.03 (rather than 0.0) and 179.97 (rather than 180.0) respectively.  
--command--
obabel -i "gzmat" sample.gzmat -O output.gzmat
--command--

The problem seems to be related to the boundary conditions of an acos call in 
the vectorAngle function in math/vector3.cpp.  I have increased the precision 
of boundary condition tests at lines 211 and 214 of math/vector3.cpp on my 
local copy and it seems to produce the desired results.
-snip-
211    if (dp < -0.99999999999999)
212               return 180.0
213 
214   if (dp > 0.99999999999999)
215               return 0.0
-snip-

I am not sure if this is the best way to fix this and I am not sure if this 
fixes all cases. Also, it seems like the vectorAngle function is deemed 
deprecated by comments in the code but is still being called by the 
CalcTorsionAngle function in math/vector3.cpp.  

Please let me know if you need any more information.

Thank you for your time,

Kevin Drew

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428740&aid=3260566&group_id=40728

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to