acos ( ) in Java has gone bezierk

Started by
2 comments, last by TheChubu 8 years, 7 months ago

A bizarre thing

Math.acos(0.24309845) in my java code gave 1.3252374720942488 degrees

but arccos(0.24309845) is really 75.9305 degrees

So why is Math.acos() giving me the wrong value OR maybe what am i doing wrong?

My bet is i'm doing something stupid but can't see it yet

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

Advertisement

It's 1.325 radians, which is the same as 75.930 degrees.

I knew i was doing something stupid, ....guess i need to get sober first before coding these days

THANKS

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

All Java's Math trigonometry functions use radians. Keep that in mind (or read the docs, thats why they're there).

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

This topic is closed to new replies.

Advertisement