Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-14-2008, 03:47 AM
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-14-2008, 05:10 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,395
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on July 13, 2008)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute an External Program through Java program Java Tip java.io 0 04-04-2008 03:40 PM
i need help to make this program masaka New To Java 2 03-23-2008 02:26 PM
How to execute an External Program through Java program JavaBean Java Tips 0 10-04-2007 10:33 PM
"connection refused when attempting to contact localhost katie New To Java 1 08-06-2007 11:54 PM
how to make abcxyz to zyxcba maram New To Java 1 08-01-2007 08:21 PM


All times are GMT +3. The time now is 07:37 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org