void draw_parabola_x(PFBDEV pFbdev, POINT center, int a, uint8_t r, uint8_t g, uint8_t b) { int x; POINT p; for(x=center.x-100; x { p.x = x; p.y = (x-center.x)*(x-center.x)/a + center.y; draw_dot(pFbdev, p, r, g, b); } }
void draw_parabola_y(PFBDEV pFbdev, POINT center, int a, uint8_t r, uint8_t g, uint8_t b) { int y; POINT p; for(y=center.y-100; y { p.y = y; p.x = (y-center.y)*(y-center.y)/a + center.x; draw_dot(pFbdev, p, r, g, b); } }
POINT center = { 600, 500, 0 }; int radius = 100; draw_circle(&fb, center, radius, 0x0, 0xff, 0x0); /* int i; for(i=radius-2; i>=0; i--) { draw_circle(&fb, center, i, 0xff, 0xff, 0x0); } */ center.x = 700; center.y = 250; int a = -100; draw_parabola_x(&fb, center, a, 0x0, 0xff, 0x0); draw_parabola_x(&fb, center, -a, 0x0, 0xff, 0x0); draw_parabola_y(&fb, center, a, 0x0, 0xff, 0x0); draw_parabola_y(&fb, center, -a, 0x0, 0xff, 0x0);