Fortran Fortran Trigonometric Function: Law of Cosines and Inverse Calculation

  • Thread starter Thread starter Benzoate
  • Start date Start date
  • Tags Tags
    Fortran
AI Thread 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()
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
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
Views
3K
Replies
12
Views
2K
Replies
9
Views
4K
Replies
3
Views
2K
Replies
4
Views
2K
Replies
1
Views
2K
Replies
8
Views
2K
Back
Top