From: Robert Brunner (
Date: Wed Aug 03 2005 - 09:22:21 CDT

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 <


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