title: Promblems with the code when using Math.toDegrees
body: <p>Can someone tell me why my code is not working with Degrees,All is fine with Radians,but in this task I'm need to have 40 degrees.Why when I'm using Degrees I only have 1 loop step?</p>
  
  <p><a href="https://i.stack.imgur.com/0nDSl.png" rel="nofollow noreferrer">Working code with Radians</a>.
  <a href="https://i.stack.imgur.com/fc2Fq.png" rel="nofollow noreferrer">Not working code with Degrees</a></p>
  
  <pre><code>Scanner sc=new Scanner(System.in);
  double g=8.86,a=40; // a=lenkis
  double v0,x,y,t;
  boolean bulletInFlight = true;
  boolean hitTarget = false;
  
  System.out.println("191RDB107 Vladislavs Fedotovs");
  System.out.println("While operators,07,Urans");
  
  System.out.print("v0=");
  if (sc.hasNextDouble())
  v0 = sc.nextDouble();
  else {
      System.out.println("input-output error");
      sc.close();
      return;
  
  }
  sc.close();
  System.out.println("result:");
  System.out.println("t \t x \t y");
  t = 0.1;
  while(bulletInFlight) {
  
      x =v0*t*Math.cos(Math.toDegrees(40));                   ||Main Problem
      y =v0*t*Math.sin(Math.toDegrees(40))-(g*Math.pow(t, 2))/2; ||Main Problem
      System.out.printf("%3.2f\t%7.3f\t%7.3f\n", t, x, y);
      if (x &gt;= 12  &amp;&amp; x &lt;= 17 &amp;&amp; y &lt;=-2 &amp;&amp; y &gt;=-4) // red target 
      {
          bulletInFlight = false;
          hitTarget = true;
          t+=0.05;
      }else if ((x&gt;= 0 &amp;&amp; x&lt;=10 &amp;&amp; y&lt;0)|| (x&gt;10 &amp;&amp; x&lt;12 &amp;&amp; y&lt;=-4) ||(x&gt;10 &amp;&amp; y&lt;=-4)) // green grass
      {
          bulletInFlight = false;
          t+=0.05;    
      }else
                  t+=0.05;
      }if (hitTarget)
       System.out.println("the target was destroyed");
  
       else
           System.out.println("shot off the target");
      }
  }
    [1]: https://i.stack.imgur.com/0nDSl.png
    [2]: https://i.stack.imgur.com/fc2Fq.png
  </code></pre>