first try to implement gdispDrawARC() (not working yet)

ugfx_release_2.6
Tectu 2012-08-24 15:54:32 +02:00
parent 580c00b8f8
commit 8fd1de6ef5
1 changed files with 6 additions and 0 deletions

View File

@ -672,7 +672,13 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
* @api
*/
void gdispDrawArc(coord_t x, coord_t y, coord_t radius, uint16_t start, uint16_t end, color_t color) {
uint16_t i;
float step = 0.01;
for(i = 0; i <= (int)((abs(end-start)) / step); i++) {
gdispDrawPixel( ((float)x + (float)radius * cosf((float)start * M_PI / 180.0f) + (float)i * step * M_PI / 180.0f),
((float)y + (float)radius * sinf((float)start * M_PI / 180.0f) + (float)i * step * M_PI / 180.0f), color);
}
}
/*