头文件显示图形。h包含 圆圈() 函数,它画一个圆心在(x,y)和给定半径的圆。
null
语法:
circle(x, y, radius); where, (x, y) is center of the circle. 'radius' is the Radius of the circle.
例如:
Input : x = 250, y = 200, radius = 50 Output :Input : x = 300, y = 150, radius = 90 Output :
![]()
下面是用C绘制圆的实现:
// C Implementation for drawing circle #include <graphics.h> //driver code 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; // initgraph initializes the // graphics system by loading a // graphics driver from disk initgraph(&gd, &gm, "" ); // circle function circle(250, 200, 50); getch(); // closegraph function closes the // graphics mode and deallocates // all memory allocated by // graphics system . closegraph(); return 0; } |
输出:
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END