Results 1 to 2 of 2
- 02-14-2008, 02:47 AM #1
Member
- Join Date
- Feb 2008
- Posts
- 1
- Rep Power
- 0
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 03:33 AM.
- 02-14-2008, 04:10 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can't you use the combination between degrees and radian. But not sure it is easy, because I remember one of friend do that using complex numbers and stuff.
Similar Threads
-
"connection refused when attempting to contact localhost
By katie in forum New To JavaReplies: 2Last Post: 11-21-2008, 08:36 PM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
i need help to make this program
By masaka in forum New To JavaReplies: 2Last Post: 03-23-2008, 01:26 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM -
how to make abcxyz to zyxcba
By maram in forum New To JavaReplies: 1Last Post: 08-01-2007, 07:21 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks