-
Notifications
You must be signed in to change notification settings - Fork 1
/
drawthis.c
36 lines (34 loc) · 953 Bytes
/
drawthis.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
int i;
float center_x = 300;
float center_y = 300;
//draw_brush(widget, center_x, center_y);
float radius = 100;
float line_y = center_y+90;
for(i = 0; i < 800; i++) { //for all values of x
float xval = sqrt((radius*radius)-((i-center_x)*(i-center_y))); //bottom
float otherxval = 0-sqrt((radius*radius)-((i-center_x)*(i-center_y)));
if(i < center_x-radius) {
draw_brush(widget, i, line_y);
}
if((xval+center_y < line_y)&&(i < center_x)) {
draw_brush(widget, i, line_y);
}
if((xval+center_y < line_y)&&(i < center_x)) {
draw_brush(widget, i, xval+center_y);
}
if (otherxval+center_y < line_y){
draw_brush(widget, i, otherxval+center_y);
}
//if (otherxval+center_y < line_y){
//draw_brush(widget, i, otherxval+center_y);
//}
if((xval+center_y < line_y)&&(i > center_x)) {
draw_brush(widget, i, xval+center_y);
}
if((xval+center_y < line_y)&&(i > center_x)) {
draw_brush(widget, i, line_y);
}
if(i > center_x+radius) {
draw_brush(widget, i, line_y);
}
}