Circle, Arc & Pieslice in Graphics.h
Ubuntu - Libgraph - Graphics & Multimedia Lab - C++ Program
- circle(x0,y0,radius) - circle draws a circle with centre at x0,y0 & given radius in the current drawing colour.
- arc(x0,y0,start_angle,end_angle,radius) - arc draws a circular arc with centre at x0,y0 , given starting angle and ending angle & given radius in the current drawing color.
- pieslice(x0,y0,start_angle,end_angle,radius) - It is just like arc() but it fills it using the current fill colour.
Source code:
#include<graphics.h> using namespace std; int main() { int gd=DETECT, gm; initgraph(&gd, &gm,NULL); outtextxy(150,15, " Circle, Arc & Pieslice in Graphics.h"); arc(400,150,0,270,50); outtextxy(506,201,"Arc"); circle(150,150,50); outtextxy(201,201, "Circle"); pieslice(300,300,0,270,50); outtextxy(365, 321, "Pieslice"); getch(); closegraph(); return 0; }
Output:
nn@linuxmint ~ $ g++ g2.cpp -lgraph g2.cpp: In function ‘int main()’: g2.cpp:11: warning: deprecated conversion from string constant to ‘char*’ g2.cpp:14: warning: deprecated conversion from string constant to ‘char*’ g2.cpp:17: warning: deprecated conversion from string constant to ‘char*’ g2.cpp:20: warning: deprecated conversion from string constant to ‘char*’ nn@linuxmint ~ $ ./a.out a.out: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed. Aborted nn@linuxmint ~ $
what are algorimths for arc function ?
ReplyDelete