【#文档大全网# 导语】以下是®文档大全网的小编为您整理的《python图形代码北极星》,欢迎阅读!
python图形代码北极星
/* TC北极星图案计算机图形学*/#include ""Stdio.h" #include "Conio.h”
#include "graphics.h”#include "math.h" #define PI3.1415926
void bei_ji_xing(float x,float y,float r,float b) int i;
float xo[ 19],.yo[19]; for(i=2;i<=16;i-i+2)
{xo[们]-x+r*sin( (i-1)*PL/8+b ) ;yo[i]-y-r*cos( (i-1)*PL/8+b ) ;)
xo[1]=x+2.5*r*sin(b);
xo[9]=x-2.5*r*sin(b);yo[1]-y-2.5*r*cos(b);
yo[9]-y+2.5*r*cos(b); for(i-3i<一15;i一计4》 xo[]一x+2*r*sin( (i-1)*PL/&+b; 9F7+t04*Pi/8+b) ; max.book118.com
xo[5]-x+1.5*r*cos(b);xo[13]-x-1.5*r*cos(b); yo[5]-y+2*r*sin(b);yo[13]-y-2*r*sin(b); for(i-1;i16;it+)
linc(xo[i,yo[i],xo[i+1],yo[i+1]);
line(xo[1],yo[1],xo[16],yo[16]:nax.book118.com for(i=l;i<=16;il+) line(x,y,xo[i,yo[iD3
setfillstyle(1,i);delay(1000);floodfill(x+12,y-2,7);setfillstyle(1,i;delay( 1000);floodfill(x-12,y+2,7);setfillstyle(1.it1);_delay(1000); _
floodfill(x-2,y-12,7);setfillstylea1.rft: delay(1ooon: fioodfill(x+2,y+12,7);setfilistyle(1,i)ydelay(1000xg —floodfill(x+12,y-8,7);setfillstyle(1itex[delay(10005 floodfill(x-12,y+8,7);setfillstyle(Iit3delay(1000):cefloodfill(x-8,y-12,7);setfillstyle(1,i+3);delay( 1000);floodfill(x+8,y+12,7);
int main(void) int i;
float b=O,x=250,y-250,r-40;*b是角度*/
intgdriver = DETECT , gmode;max.book118.cominitgraph ( &gdriver , &gmode ," ");seEkcoia:0) ;
seacain(73;
for(i-O;i<=15;i++)cleardevice(;r-r+3; bei_ji_xing(x,y,r,b);delay( 100000); for(i-15;i>-0;i--)cleardevice(;r-r-3; bei_ji_xing(x,y,r,b);delay( 100000);
for(x=250;x<=400;x+=25){ cleardevice(; bei_ji_xing(x,y,r,b);delay( 100000); for(y=250;y>=100;y--25) cleardeviceo; bei_ji_xing(x,y,r,b);delay( 100000); for(b-0;b<-Pl;b+-PL/32)cleardevice(; bei_ji_xing(x,y,r,b);delay( 100000);
for(b=O,x=400,y=100;b<=Pl,x>=250,y<=250;b--PL/8,x--6.25,y+=6.25)cleardevice(;
bei_ji_xing(x,y,r,b);delay(100000);
for(b-0,x=250,y=250,r=40;b<-PI,x<-400,y>=100,r>=15;b- -PE/8,x1=6.25,y--6.25,r--1) {cleardevice(;
bei_ji_xing(x,y,r,b);delay(100000);} getch ( );closegraph (); }
本文来源:https://www.wddqxz.cn/efa475256ddb6f1aff00bed5b9f3f90f76c64d9c.html