The following is a snippet of code where I am trying to draw a circle but my x value prints as a constant value. It's most likely something very very simple. Thanks in advance for any help.
int sides = 100;
int radius = 200;
int centerX = 100;
int centerY = 100;
CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f};
CGContextSetStrokeColor(context, red);
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, 0);
int i = 0;
for(i = 0; i <= sides; i++)
{
CGFloat pointRatio = i/sides;
CGFloat xSteps = cos( pointRatio * 2 * M_PI);
CGFloat ySteps = sin( pointRatio * 2 * M_PI );
CGFloat pointX = centerX + xSteps * radius;
CGFloat pointY = centerY + ySteps * radius;
NSLog(@"%i", pointX);
CGContextAddLineToPoint(context, pointX, pointY);
}
CGContextStrokePath(context);