Fortran Trigonometric Function: Law of Cosines and Inverse Calculation

  • Topic: Fortran 
  • Thread starter Thread starter Benzoate
  • Start date Start date
  • Tags Tags
    Fortran
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 4K views
Benzoate
Messages
420
Reaction score
0
I want Fortran to regconize trigonometric functions.

The trigonometric equation I am trying to right in Fortran is the Law of cosines

COS(c)=d^2+a^2-b^2/(2*a*d)
However, I want Fortran to calculate the inverse of the above equation:

How would I write the following equation in Fortran?
c=COS^1-(d^2+a^2-b^2/(2*a*d))
 
Physics news on Phys.org
You are looking for arccos - you will have to check documentation for the correct name of the function, as it differs between dialects.