Hi.

I tried to make a program that generates the angles of a triangle using the length of the sides. With a calculator, you divide one side by the other and then press SHIFT+COS (or 2nd+COS etc.) and the correct angle is displayed (in degrees!).

In C++, I think that this "SHIFT+COS" must be the acos-function (included in math.h).

So I tried the following:

.

.

.

#include <math.h>

.

.

.

double side1,side2,angle;

.

.

.

angle=acos(side1/side2);

.

.

.

Everything of the code is correct (yes, I took the correct two sides) but the acos-function doesn't calculate the right angle (in my example, the angle should be about 37 degrees, the acos says something about 0.69).

So, has anyone got an idea what the problem is? Perhaps it isn't the acos that I have to use or I did something wrong or is it really the acos that doesn't calculate correctly?

Thanks in advance,

-- pyrocommander --