View Single Post
  #1 (permalink)  
Old 02-14-2008, 03:47 AM
taco89 taco89 is offline
Member
 
Join Date: Feb 2008
Posts: 1
taco89 is on a distinguished road
Attempting to make a Law of Sines program
Okay, so I've been making my own Law of Sines program (just because I can) and I've noticed something: Java seems to be automatically "set" to calculate on a radian "mode". I noticed this by inputing:

Side b = 27.4
Angle A = 49
Angle B = 28.7

If I compute this using my TI-84 calculator, I end up with an answer of 43.06 (rounded). This is because I have the mode set on degrees. Yet when I attempt the same thing with my Java program, I get 63.29, the exact same answer I get on my calculator if I have the mode set to radians.

So my question is how can I "force" Java to calculate this formula in degrees, rather than radians? I have tried the Math.toDegrees() [and Math.toRadians() just to test it] on both the final answer, and each inputted angle, yet it seems to have no effect on the final result.

Any suggestions? Thanks!


EDIT: Nevermind, I figured it out. Thanks anyway!

Last edited by taco89 : 02-14-2008 at 04:33 AM.
Reply With Quote
Sponsored Links