Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[12pt, a4paper]{article}
- \usepackage[utf8]{inputenc}
- % \usepackage{amsmath}
- % \usepackage{amssymb}
- % \usepackage{polski}
- % \usepackage{fancyhdr}
- % \pagestyle{fancy}
- % %\pagenumbering{gobble}
- % \headheight=15pt
- \usepackage{graphicx}
- \def\pic#1#2{\DeclareGraphicsRule{.#2}{mps}{*}{}\includegraphics{#1.#2}}
- \begin{document}
- \includegraphics[scale=1.3]{preview.mps}
- \end{document}
- % pair a,b,c,s;
- % numeric u;
- % path P;
- % color pink;
- % pink:=blue+red;
- % u:=1cm;
- % a:=(0,0);
- % b:=(0,u);
- % c:=(u,0);
- % s:=(a+b+c)/3;
- % P:=a--b--c--cycle;
- % fill P withcolor red;
- % draw P;
- % draw s withpen pencircle scaled 1bp withcolor green+red;
- % label.llft(btex $A$ etex,a) withcolor red;
- % label.top(btex $B$ etex,b) withcolor red;
- % label.lrt(btex $C$ etex,c) withcolor red;
- % label.llft(btex $S$ etex,s) withcolor green;
- % %-----------------------------------------------------------------
- % numeric u;
- % pair o,a[];
- % u:=2cm;
- % o:=(0,0);
- % a[1]:=(0,u);
- % numeric n;
- % n:=9;
- % for i:=2 upto n: a[i]=a[i-1] rotatedaround(o,360/n); endfor
- % %-----------------------------------------------------------------
- % draw for i:=1 upto 9: a[i]-- endfor cycle withcolor red;
- % draw a[1]--a[4]--a[7]--cycle withcolor red;
- % draw a[1]--a[3] withcolor red;
- % draw a[4]--a[6] withcolor red;
- % draw a[7]--a[9] withcolor red;
- % fill Okragwpisany(a[1],a[2],a[3]) withcolor blue;
- % fill Okragwpisany(a[1],a[3],a[4]) withcolor blue;
- % fill Okragwpisany(a[4],a[5],a[6]) withcolor blue;
- % fill Okragwpisany(a[4],a[6],a[7]) withcolor blue;
- % fill Okragwpisany(a[7],a[8],a[9]) withcolor blue;
- % fill Okragwpisany(a[7],a[9],a[1]) withcolor blue;
- % fill Okragwpisany(a[1],a[4],a[7]) withcolor blue;
- % %-----------------------------------------------------------------
- % numeric u;
- % pair a,b,c,cc,d;
- % u:=2cm;
- % %-----------------------------------------------------------------
- % a=(0,0);
- % b=(4u,0);
- % c=(3u,2u);
- % draw a--b--c--cycle;
- % d:=Rzut(Srodekwpisanego(a,b,c),a,b);
- % draw c--d withcolor blue;
- % fill Okragwpisany(a,d,c) withcolor red;
- % fill Okragwpisany(d,b,c) withcolor green;
- % draw Srodekwpisanego(a,d,c)--Srodekwpisanego(d,b,c);
- % %-----------------------------------------------------------------
- % numeric u;
- % pair a,b,c,cc,d,e,f,g,h;
- % u:=2cm;
- % %-----------------------------------------------------------------
- % a=(0,0);
- % b=(4u,0);
- % c=(3u,2u);
- % draw a--b--c--cycle;
- % d:=(u,0);
- % draw c--d withcolor blue;
- % draw Okragwpisany(a,d,c);
- % draw Okragwpisany(d,b,c);
- % e=Srodekwpisanego(a,d,c);
- % f=Srodekwpisanego(d,b,c);
- % %draw e--f;
- % g:=Rzut(e,d,c);
- % h:=Rzut(f,d,c);
- % draw (g reflectedabout(e,f))--(h reflectedabout(e,f)) dashed evenly withcolor red;
- % label.llft(btex $A$ etex,a);
- % label.lrt(btex $B$ etex,b);
- % label.top(btex $C$ etex,c);\
- % %-----------------------------------------------------------------
- % numeric u;
- % pair a,b,c,cc,d,e,f,g,h,i,j;
- % u:=2cm;
- % %-----------------------------------------------------------------
- % a=(0,0);
- % b=(5u,0);
- % c=(4u,3u);
- % draw a--b--c--cycle;
- % d:=(2*u,0);
- % draw c--d withcolor blue;
- % draw Okragwpisany(a,d,c);
- % draw Okragwpisany(d,b,c);
- % e=Srodekwpisanego(a,d,c);
- % f=Srodekwpisanego(d,b,c);
- % %draw e--f;
- % g:=Rzut(e,d,c);
- % h:=Rzut(f,d,c);
- % i:=g reflectedabout(e,f);
- % j:=h reflectedabout(e,f);
- % draw i--j dashed evenly withcolor red;
- % Punkt(a);
- % Punkt(b);
- % Punkt(c);
- % Ppunkt(e);
- % Ppunkt(f);
- % Punkt(g);
- % Punkt(h);
- % Punkt(i);
- % Punkt(j);
- % label.llft(btex $A$ etex,a);
- % label.lrt(btex $B$ etex,b);
- % label.top(btex $C$ etex,c);
- % label.lrt(btex $O_1$ etex,e);
- % label.lrt(btex $O_2$ etex,f);
- % label.rt(btex $K$ etex,g);
- % label.lrt(btex $L$ etex,h);
- % label.urt(btex $M$ etex,i);
- % label.urt(btex $N$ etex,j);
- % def Okrag(expr o, r) =
- % (o+(0,r))..(o+(r,0)).. (o+(0,-r))..(o+(-r,0))..cycle
- % enddef;
- % def Dlugosc(expr a,b) =
- % sqrt(xpart(a-b)*xpart(a-b)+ypart(a-b)*ypart(a-b))
- % enddef;
- % def Obwod(expr a,b,c) =
- % (Dlugosc(a,b)+Dlugosc(b,c)+Dlugosc(c,a))
- % enddef;
- % def Pole(expr a,b,c) =
- % begingroup
- % save p; numeric p;
- % p:=Obwod(a,b,c)/2;
- % sqrt(p*(p-Dlugosc(a,b))*(p-Dlugosc(b,c))*(p-Dlugosc(c,a)))
- % endgroup
- % enddef;
- % def Promienwpisanego(expr a,b,c) =
- % 2*Pole(a,b,c)/Obwod(a,b,c)
- % enddef;
- % def Punktnadwusiecznej(expr b,a,c) =
- % b rotatedaround(a,(angle(c-a)-angle(b-a))/2)
- % enddef;
- % def Srodekwpisanego(expr a,b,c) =
- % begingroup
- % save aa, bb, i; pair aa, bb, i;
- % aa:=Punktnadwusiecznej(b,a,c);
- % bb:=Punktnadwusiecznej(c,b,a);
- % i:=whatever[a,aa]=whatever[b,bb];
- % i
- % endgroup
- % enddef;
- % def Okragwpisany(expr a,b,c) =
- % Okrag(Srodekwpisanego(a,b,c),Promienwpisanego(a,b,c))
- % enddef;
- % def Rzut(expr a,b,c) =
- % begingroup
- % save aa,r; pair aa,r;
- % aa:=a reflectedabout(b,c);
- % r:=(a+aa)/2;
- % r
- % endgroup
- % enddef;
- % def Punkt(expr p) =
- % fill Okrag(p,1bp) withcolor white;
- % draw Okrag(p,1bp) withpen pencircle scaled .6pt;
- % enddef;
- % def Ppunkt(expr p) =
- % fill Okrag(p,1bp);
- % enddef;
- % def Kratka(expr m,n,kolor)=
- % begingroup
- % save p; path p;
- % p:=(m,n)*u--(m,n+1)*u--(m+1,n+1)*u--(m+1,n)*u--cycle;
- % fill p withcolor kolor;
- % draw p;
- % endgroup
- % enddef;
- % def Szachownica(expr m,n) =
- % for i:=0 upto m-1:
- % for j:=0 upto n-1:
- % if((2j-i) mod 5=0):
- % Kratka(i,j,c[3]);
- % label(decimal(i+j),(i+.5,j+.5)*u)
- % else: Kratka(i,j,c[0]); fi;
- % endfor
- % endfor
- % enddef;
- % %-----------------------------------------------------------------
- % numeric u;
- % u:=0.5cm;
- % color c[];
- % c[0]:=white;
- % c[1]:=black;
- % c[2]:=red;
- % c[3]:=blue;
- % c[4]:=green;
- % c[5]:=blue+red;
- % %-----------------------------------------------------------------
- % Szachownica(8,8);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement