You're assuming that the tan funtion uses degrees. It doesn't - the API says it uses radians (pi=3.1419... radians equals 180 degrees). Most calculators have several possible modes - a "DRG" button toggles between degrees mode, radians mode, and grad mode (which has 100 grads in a 90 degree angle; seldom used). Your calculator is currently in degrees mode. Java's Math class doesn't have these modes; it always uses radians because that's the most mathematically natural mode to use. (Computations are actually simplest for the computer this way.) But you can use the toDegrees() and toRadians() methods to convert between radians and degrees.
"I'm not back." - Bill Harding, Twister
Kevin de Berk
posted 14 years ago
Oh.. Well, thanks mate
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...