Results 1 to 2 of 2
  1. #1
    taco89 is offline Member
    Join Date
    Feb 2008
    Rep Power

    Default 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.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    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

  1. Replies: 2
    Last Post: 11-21-2008, 09:36 PM
  2. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  3. i need help to make this program
    By masaka in forum New To Java
    Replies: 2
    Last Post: 03-23-2008, 02:26 PM
  4. Replies: 0
    Last Post: 10-04-2007, 09:33 PM
  5. how to make abcxyz to zyxcba
    By maram in forum New To Java
    Replies: 1
    Last Post: 08-01-2007, 07:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts