untelon

03-04-2009, 01:58 AM

I am trying to obtain an angle in degrees.

I have the hypotenuse and the adjacent lengths, so I use cosine to obtain the angle but get different degrees in Maya versus my calc. (my calc. is correct, so something is missing from my Maya code).

Example:

float $hypotenuse = 25.110;

float $adjacent = 24.377;

print(rad_to_deg(cos($adjacent / $hypotenuse)));

I get 32.351

I should get 13.88 (http://www.easycalculation.com/trigonometry/triangle-angles.php)

What gives?

Here's something interesting as well:

print(cosd(13.88));

// Result: 0.9708

print(rad_to_deg(cos(.9708)));

// Result: 32.351

Somebody enlighten me please.

I have the hypotenuse and the adjacent lengths, so I use cosine to obtain the angle but get different degrees in Maya versus my calc. (my calc. is correct, so something is missing from my Maya code).

Example:

float $hypotenuse = 25.110;

float $adjacent = 24.377;

print(rad_to_deg(cos($adjacent / $hypotenuse)));

I get 32.351

I should get 13.88 (http://www.easycalculation.com/trigonometry/triangle-angles.php)

What gives?

Here's something interesting as well:

print(cosd(13.88));

// Result: 0.9708

print(rad_to_deg(cos(.9708)));

// Result: 32.351

Somebody enlighten me please.