There are a lot of different approaches (if you're doing this with a basic drawing library). If you're not clearing the screen every frame, you could update the image by adding X pixels to the arc in the direction of rotation and removing X pixels from the arc on the opposite end
Code
moveArcClockwise(startAngle, endAngle, bigRadius, smallRadius)
for r between smallRadius and bigRadius:
drawPoint(r * cos(endAngle), r * sin(endAngle))
erasePoint(r*cos(beginAngle), r*sin(beginAngle))
in your picture, erase would just be to color blue and draw would be to color red
or just keep clearing the whole screen and redrawing a circle with an arc in it.
Code
drawCircleAndArc(startAngle, endAngle, bigRadius, smallRadius)
for angle between 0 and 360
color = blue
if angle between start and end angle
color = red
for r between smallRadius and bigRadius
drawPoint(r * cos(endAngle), r * sin(endAngle), color)
Hopefully this pseudo-code makes sense
This post was edited by Kronosaurus on Jan 11 2014 11:10am