title: Why does giving addArcWithCenter a startAngle of 0 degrees make it start at 90 degrees?
body: <p>I'm creating a <code>CAShapeLayer</code> to use as a mask for a <code>UIView</code>'s layer. I'm using a <code>UIBezierPath</code> to draw the shape layer. It's working fine, except I'm getting some odd results when I draw. The geometry is not behaving as expected. I'm trying to draw simple "pie slice" in the upper right corner:</p>
  
  <pre><code>#define degreesToRadians(x) ((x) * M_PI / 180.0)
  
  ...
  
  // "layer" refer's to the UIView's root layer
  
  CAShapeLayer *maskLayer = [CAShapeLayer layer];
  
  maskLayer.frame =
      layer.presentationLayer ? 
      ((CAGradientLayer *)layer.presentationLayer).bounds : layer.bounds;
  maskLayer.fillRule = kCAFillRuleEvenOdd;
  maskLayer.needsDisplayOnBoundsChange = YES;
  
  CGFloat maskLayerWidth = maskLayer.bounds.size.width;
  CGFloat maskLayerHeight = maskLayer.bounds.size.height;
  CGPoint maskLayerCenter = 
      CGPointMake(maskLayerWidth/2,maskLayerHeight/2);
  
  UIBezierPath *path = [UIBezierPath bezierPath];
  
  [path moveToPoint:maskLayerCenter];
  
  [path addArcWithCenter:maskLayerCenter radius:(maskLayerWidth/2)
  startAngle:degreesToRadians(0) endAngle:degreesToRadians(90) clockwise:YES];
  
  [path closePath];
  
  
  maskLayer.path = path.CGPath;
  
  layer.mask = maskLayer;
  </code></pre>
  
  <p>The end result is that a pie slice is drawn in the lower right corner. The first point of the arc is drawn at the 90 degrees, then down to 180. Why does it do this even though I'm using 0 and 90 degree angles?</p>