Acos is a mathematical function that operates on REAL arguments.
Acos is Fortran's inverse cosine function. It will return the angle ( in radians ) who's value of cosine equals the value of the argument passed to it.
acos (x)
The argument x must be of type REAL with value between -1.0 and 1.0. It is the value of cosine for which the computer will find the corresponding angle of in radians.
There are no optional arguments to this function.
There are an infinite number of correct answers, so the returned angle is restricted to the range zero through pi. Just keep in mind that the results that the function returns are in radians and not degrees. For instance, the next few lines of code will result in the value of 0.7854078 being stored in the variable angle not 45.0.
X= 0.7071 angle = acos(x)
If you need angle to be in degrees, you will have to convert using something like the following.
pi=3.14159265 angle=angle*(180.0/pi)
lecture seven
examples: survey.f
Written by Jason Wehr : jcw142@psu.edu and Maintained by John Mahaffy : jhm@cac.psu.edu