Advertisement

Arc Cosine Help...

Started by May 27, 2002 02:41 AM
1 comment, last by RegularKid 22 years, 8 months ago
Ok, I''m using the acos() / acosf() functions to get an angle from a cosine value (should return 0 - 180). However, some of the time these functions return an indefinite number (-1.#IND0000000). Can someone explain to me why this is and what it means. Also, how can I make sure that they always return a valid angle? If that isn''t possible, is there just a formula getting an angle from it''s cosine value? Any help would be great. Thanks!
ACOS(3)          Linux Programmer''s Manual         ACOS(3)NAME       acos - arc cosine functionSYNOPSIS       #include <math.h>       double acos(double x);DESCRIPTION       The acos() function calculates the arc cosine of x;       that is the value whose cosine is x.   If  x  falls       outside  the  range -1 to 1, acos() fails and errno       is set.RETURN VALUE       The acos() function returns the arc cosine in radi�       ans  and  the value is mathematically defined to be       between 0 and PI (inclusive).

Might that be your problem ?

Advertisement
Thank you!

This topic is closed to new replies.

Advertisement