marthoma
Junior Member level 3
- Joined
- Oct 15, 2014
- Messages
- 25
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 171
Code:
void GLCD_Circle(unsigned int cx,unsigned int cy ,unsigned int radius)
{
unsigned int x, y;
int radiusError;
x = radius;
y = 0;
radiusError = 1 - radius;
while(x >= y)
{
set_pixel(cx+x, cy+y);
set_pixel(cx+y, cy+x);
set_pixel(cx-x, cy+y);
set_pixel(cx-y, cy+x);
set_pixel(cx-x, cy-y);
set_pixel(cx-y, cy-x);
set_pixel(cx+x, cy-y);
set_pixel(cx+y, cy-x);
y++;
if ( radiusError < 0 )
{
radiusError += 2 * y + 1;
}
else
{
x--;
radiusError += 2 * (y - x + 1);
}
}
}
this code is is not plotting pixels near the x axis...wat could be wrong here?