Fortran Fortran Trigonometric Function: Law of Cosines and Inverse Calculation

  • Thread starter Thread starter Benzoate
  • Start date Start date
  • Tags Tags
    Fortran
Click For Summary
Fortran can recognize trigonometric functions, including the inverse cosine function, which is essential for implementing the Law of Cosines. To calculate the angle 'c' using the inverse of the Law of Cosines, the correct syntax in Fortran is to use the acos() function. The equation can be expressed as c = acos((d**2 + a**2 - b**2) / (2 * a * d)). It's important to consult the Fortran documentation for specific function names, as they may vary between different dialects of the language.
Benzoate
Messages
418
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))
 
Technology 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.
 
Hi Benzoate,

The inverse cosine function is given by:

acos()
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

  • · Replies 25 ·
Replies
25
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 37 ·
2
Replies
37
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K