VMD-L Mailing List
From: Robert Brunner (rbrunner_at_uiuc.edu)
Date: Wed Aug 03 2005 - 09:22:21 CDT
- Next message: Kevin Smith: "PDB to STL help needed"
- Previous message: vivek sharma: "Re: more precision in inverse trig functions"
- In reply to: Samuel Flores: "more precision in inverse trig functions"
- Next in thread: Jason Lee: "RE: namd-l: Nanotube Simulations"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
If you're dealing with angles near the extremes, you may find that
the atan2 function gives you better results. Try to re-cast your
equations to use that function. Also, try using trig identities to
change your cosines to sines and leave the subtraction until the end,
so that you don't get subtractive cancellation.
Alternatively, truncate anything greater than 1 down to 1 (same for <
-1).
Robert
On Aug 2, 2005, at 11:11 PM, Samuel Flores wrote:
>
> Hi All,
>
> Does anyone know what I can do to get more precision in the
> calculation of
> inverse trig functions? I keep getting errors when I try to take
> the acos
> of some number like 1.0000007. I think this is the result of
> imprecision in
> an earlier mathematical step to take another arccosine.
>
> Help would be much appreciated!
>
> Thanks
>
> Sam
>
>
- application/pkcs7-signature attachment: smime.p7s
- application/pgp-signature attachment: This is a digitally signed message part
- Next message: Kevin Smith: "PDB to STL help needed"
- Previous message: vivek sharma: "Re: more precision in inverse trig functions"
- In reply to: Samuel Flores: "more precision in inverse trig functions"
- Next in thread: Jason Lee: "RE: namd-l: Nanotube Simulations"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]