title: Android - draw line vertically
body: <p>I have a custom view where I override the onDraw method and drawn a circle. Now I  want to draw a line from the center of the circle to the top of the circle.</p>
  
  <p>Here is my code..</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
  
      canvas.drawRect(0, 0, getWidth(), getHeight(), backgroundPaint);
      canvas.drawCircle(centerX, centerY, outerRadius, outerCirclePaint);
  
      double angleRadians = Math.toRadians(0);
  
      double x = (outerRadius * Math.cos(angleRadians)) + centerX;
      double y = (outerRadius * Math.sin(angleRadians)) + centerY;
  
      canvas.drawLine((float)x, (float)y, centerX, centerY, innerCirclePaint);
  }
  </code></pre>
  
  <p>centerX and centerY are the center of the circle
  outerRadius is the radius for the circle</p>
  
  <p>When i run this the line is drawn from the center to the right at 90 degrees instead of the top of the circle 0 degrees, even though I have told it the angle is 0</p>
  
  <p>This is confusing me and can't seem what I am doing wrong.
  If anyone has any ideas on this I would be very grateful</p>