private void cosActionPerformed(java.awt.event.ActionEvent evt) { num = Double.parseDouble(jTextField1.getText()) ; jLabel1.setText("Cos "+num); ans = Math.cos(num); jTextField1.setText(Double.toString(ans)); }
cos(1) radian is 0.54030230586 cos(1) degree is 0.99984769515
Quote:In my code I enter 1 using sin function it gives answer 0.8414709848078965 while original value is 0.017452 and when I enter 1 using cos function it returns me 0.540302 while original value is 0.999848 and same like this others
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)