-1

I have the folling:

double angle = 0.0;
double rad = Math.toRadians(angle);
double sinIs = Math.sin(rad);
double cosIs = Math.cos(rad);

I would expect the result to be:

rad=0.0
sinIs=0
cosIs=1

However the return Math.toRadians(0.0) will return

rad=2.356194490192345
octavio
  • 456
  • 4
  • 14

1 Answers1

0

Seems some issue at your end. I tested this code

public static void main(String a1[]) 
    {
        double angle = 0.0;
        double rad = Math.toRadians(angle);
        double sinIs = Math.sin(rad);
        double cosIs = Math.cos(rad);
        System.out.print("sin-->"+sinIs+"\ncos-->"+cosIs);
    }

Output

sin-->0.0
cos-->1.0
RockAndRoll
  • 2,247
  • 2
  • 16
  • 35