-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEllipse.cpp
42 lines (30 loc) · 881 Bytes
/
Ellipse.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
// C Implementation for drawing ellipse
#include <graphics.h>
int main()
{
// gm is Graphics mode which is a computer display
// mode that generates image using pixels.
// DETECT is a macro defined in "graphics.h" header file
int gd = DETECT, gm;
// location of ellipse
int x = 250, y = 200;
// here is the starting angle
// and end angle
int start_angle = 0;
int end_angle = 360;
// radius from x axis and y axis
int x_rad = 100;
int y_rad = 50;
// initgraph initializes the graphics system
// by loading a graphics driver from disk
initgraph(&gd, &gm, "");
// ellipse function
// ellipse(x, y, start_angle, end_angle, x_rad, y_rad);
ellipse(250,200,0,360,100,50);
getch();
// closegraph function closes the graphics
// mode and deallocates all memory allocated
// by graphics system .
closegraph();
return 0;
}