-
Notifications
You must be signed in to change notification settings - Fork 0
/
graf7.cpp
42 lines (37 loc) · 929 Bytes
/
graf7.cpp
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
37
38
39
40
41
42
#include <winbgim.h>
#include <iostream>
using namespace std;
void waitForLeftMouseClick();
void dibujarfigura();
int main()
{
dibujarfigura();
}
void dibujarfigura(){
int r,lx,ly;
cout<<"Digite el valor de r";
cin>>r;
lx=r*4+10;
ly=r*5+20;
initwindow(lx,ly);
arc(r,r,0,180,r);
arc((r*3),r,270,360,r);
arc(((3*r)/2),((7*r)/2),270,360,((3*r)/2));
line(0,r,((3*r)/2),((5*r)/2));
line(((3*r)/2),((5*r)/2),50,((7*r)/2));
line(50,((7*r)/2),((3*r)/2),((7*r)/2));
line(((3*r)/2),((7*r)/2),((3*r)/2),(5*r));
line((2*r),r,(4*r),r);
line((3*r),(r*2),(3*r),((7*r)/2));
waitForLeftMouseClick();
closegraph();
}
void waitForLeftMouseClick()
{
clearmouseclick(WM_LBUTTONDOWN);
const int DELAY = 50; // Milliseconds of delay between checks
int x, y;
while (!ismouseclick(WM_LBUTTONDOWN))
delay(DELAY);
getmouseclick(WM_LBUTTONDOWN, x, y);
}