Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt,graph;
- var xc,yc:integer;
- kolvo:integer;
- x,y:integer;
- fi,r:double;
- i:integer;
- a:double;
- c:double;
- flag:boolean;
- begin
- flag:=false;
- xc:=Trunc(Getmaxy/2);
- yc:=trunc(getmaxx/2);
- putpixel(xc,yc,1);
- writeln('a zaday');
- readln(a);
- writeln('zaday kooficent uvelicheniya');
- readln(c);
- writeln('zaday kol-vo tochek');
- readln(kolvo);
- Clrscr;
- line(0,yc,2*xc,yc);
- line(xc,0,xc,2*yc);
- fi:=0;
- r:=c*a*sqrt(2*cos(2*fi));
- x:=(trunc((xc+r*cos(fi))));
- y:=(trunc((yc+r*sin(fi))));
- moveto(x,y);
- for i:=1 to kolvo do
- begin
- fi:=(2*pi/kolvo)*i;
- if (cos(2*fi)>=0) then
- begin
- r:=c*(a*sqrt(2*cos(2*fi)));
- x:=(trunc(xc+r*cos(fi)));
- y:=(trunc(yc+r*sin(fi)));
- if flag then
- begin
- if (x>0) and (x<getmaxy) and (y>=0) and (y<getmaxx) then
- moveto(x,y);
- flag:=false;
- end else
- if (x>0) and (x<getmaxy) and (y>=0) and (y<getmaxx) then
- putpixel(x,y,1);
- end
- else
- begin
- flag:=true;
- end
- end;
- end.
Add Comment
Please, Sign In to add comment