Difference between revisions of "User:Derekwang2048/Asymptote/Graphing"

(*/Graphing*/)
(Graphing)
Line 6: Line 6:
 
<asy>
 
<asy>
 
/*
 
/*
Original copy at https://artofproblemsolving.com/wiki/index.php/User:Daybreakstudent
 
MADE BY DAYBREAKSTUDENT
 
 
THE BEST CHESS SET EVER LOGO (Yes, it's really called that)
 
THE BEST CHESS SET EVER LOGO (Yes, it's really called that)
 
The code may be very convoluted, just warning you...
 
The code may be very convoluted, just warning you...

Revision as of 20:15, 10 October 2022

Graphing

So basically I was bored one day and decided to play chess. I got bored again, so I decided to make a chess piece in Asymptote. This is what I got


[asy] /* THE BEST CHESS SET EVER LOGO (Yes, it's really called that) The code may be very convoluted, just warning you... VERSION 1.7 */    unitsize(1inch); //COLORS+LINE TYPES  //Guide Lines pen g=(linetype("2 3")+gray+linewidth(.5));  //Knight Outline pen b=(white+linewidth(.5));  //Knight Fill pen[][] c={{red, red+yellow},{red+yellow, yellow}};  //*GUIDE POINTS*  //C C pair A=(0,0); //C U4 pair B=(0,3.125); //C D4 pair C=(0,-3.125); //L4 C pair D=(-3.75,0); //R4 C pair E=(3.75,0); //L1 C pair F=(-1.25,0); //L1 U1 pair G=(-1.25,0.75); //L1 U2 pair H=(-1.25, 1.5); //L1 D1 pair I=(-1.25, -0.75); //L1 U3 pair K=(-1.25,2.75); //L1 D3 pair L=(-1.25,-2.75); //R1 C pair M=(1.25,0); //R1 U1 pair N=(1.25,0.75); //R1 U2 pair O=(1.25, 1.5); //R1 D1 pair P=(1.25, -0.75); //R1 D2 pair Q=(1.25, -1.5); //R1 U3 pair R=(1.25,2.75); //R1 D3 pair S=(1.25,-2.75); //L2 U1 pair T=(-1.875, .75); //L2 U2 pair U=(-1.875, 1.5); //L2 D1 pair V=(-1.875, -.75); //L2 D2  pair W=(-1.875, -1.5); //R2 U1 pair X=(1.875, .75); //R2 U2 pair Y=(1.875, 1.5); //R2 D1 pair Z=(1.875, -.75); //R2 D2  pair AA=(1.875, -1.5); //L3 U1 pair BB=(-2.75, .78125); //L3 D1 pair CC=(-2.75, -.78125); //R3 U1 pair DD=(2.75, .78125); //R3 D1 pair EE=(2.75, -.78125);  //Diagonal line ends pair ELD=(-2.875, -.125); pair ELU=(-2.875, .125); pair ERD=(2.875, -.125); pair ERU=(2.875, .125); //Diagonal line starts pair SLD=(-1.5625, -2.5); pair SLU=(-1.5625, 2.5); pair SRD=(1.5625, -2.5); pair SRU=(1.5625, 2.5); //Circle Intersections pair CLD=(-1.25, -.78125); pair CLU=(-1.25, .78125); pair CRD=(1.25, -.78125); pair CRU=(1.25, .78125); //Polar Lines pair PUL=(-2, 1.5); pair PUR=(2, 1.5); pair PDL=(-2, -1.5); pair PDR=(2, -1.5); //Central Points pair CPU=(0,1.5); pair CPD=(0,-1.5);    //KNIGHT POINTS pair KCC=(0,0); pair KRC=(0.375,0); pair KCU=(0,0.1875); pair KRU=(0.125,0.1875); pair KLU=(-.25,.1875); pair KCUUU=(0,.6875); pair KLC=(-0.8125, 0); pair KLUU=(-.3125,.5625); pair KLLUUU=(-.4375,1.0625); pair KLLUUUU=(-.8125, .6875); pair KLLUU=(-.8125, .4375); pair KCUUUU=(0, .9375); pair KCUUUUU=(0, 1.1875); pair KLUUUUU=(-.25, 1.1875); pair KRUU=(.25,.3125); pair KRRUU=(.5625,.25); pair KRRUUU=(.5625,.375); pair KRUUU=(.4375,.875); pair KRRU=(.6875,.125); pair KRRRU=(.9375,.125); pair KRRRUUUU=(.4375,.875); pair KRRRRRUUU=(.875,.6875); pair KRRRRRUU=(1,.25); pair KRUUUU=(.25,1); pair KCUUUUUU=(0,1.625); pair KLUUUUUU=(-.0625,.6875); pair KRDDD=(.375,-.5625); pair KRRRDDD=(.921875,-.5625); pair KCD=(0,-.75); pair KRRDDD=(.5,-1); pair KCDD=(0,-1.125); pair KRDDDD=(.5,-1.21875); pair KCDDD=(0,-1.5); pair KLD=(-.3125,-.1875); pair KLLD=(-.5,-.375); pair KLLLLD=(-.75,-.625); pair KLLLDDDDD=(-.4375,-1.1875); pair ICANTHELPMYSELF=(-.46875,-1.1875);   //KNIGHT BASE pair KBRT=(.8125,-1.03125); pair KBRU=(.9375,-1.25); pair KBRD=(1.0625,-1.25); pair KBRB=(1.0625,-1.5);  pair KBLT=(-.8125,-1.03125); pair KBLU=(-.9375,-1.25); pair KBLD=(-1.0625,-1.25); pair KBLB=(-1.0625,-1.5);   //DRAWING SYSTEMS fill((3.1875,3.125)--(-3.1875,3.125)--(-3.1875,-3.125)--(3.1875,-3.125)--cycle, black);  //GUIDE  draw(circle((0,0),.375), g);  draw(circle((.625,.375),.375),g); draw(circle((-.625,.375),.375),g); draw(circle((-.625,-.375),.375),g); draw(circle((.625,-.375),.375),g);   draw(circle((0,-1.4375),.375),g); draw(circle((0,1.4375),.375),g);   draw(circle((CRU),.375),g); draw(circle((CLU),.375),g); draw(circle((CLD),.375),g); draw(circle((CRD),.375),g);  draw(B--A--C, g); draw((-3.1875,0)--(0,0)--(3.1875,0), g);    draw(ELD--CPU--SRU, g); draw(ERD--CPU--SLU, g); draw(ELU--CPD--SRD, g); draw(ERU--CPD--SLD, g);   draw(K--L, g); draw(R--S, g);  draw(CLU--BB, g); draw(CLD--CC, g); draw(CRU--DD, g); draw(CRD--EE, g);  draw(PDR--PDL, g); draw(PUL--PUR, g);   //Knight //Fill latticeshade(KLC--KLLD--KLLLLD--(-.3125,-.90625)--(-.46875,-1.234375)--(-.8125,-1.03125)--KBLU--KBLD--KBLB--KBRB--KBRD--KBRU--KBRT--KRDDDD--KRRDDD--KRRRDDD--KRC--KRU--KRUU--KRRUU--KRRU--KRRRU--KRRUUU--KRRRRRUU--KRRRRRUUU--KRUUU--KRUUUU--KCUUUUU--CPU--(-.1875,1.375)--KLUUUUU--KLLUUU--KLLUUUU--cycle, c); //Outline //Quadrant LU draw(KCC--KCU--KLU--cycle, b);  draw(KCC--KLU--KLC--cycle, b);  draw(KCUUU--KCU--KLU--cycle, b);  draw(KCUUU--KLU--KLC--KLUU--cycle, b);  draw(KLC--KLLUUUU--KLUU--cycle, b);  draw(KCUUUU--KCUUU--KLLUUU--cycle, b);  draw(KLLUUU--KCUUU--KLUU--cycle, b);  draw(KLLUUU--KLLUUUU--KLUU--cycle, b);  draw(KCUUUU--KLLUUU--KLUUUUU--KCUUUUU--cycle, b);  draw(CPU--KCUUUUU--KLUUUUU--(-.1875,1.375)--cycle, b);  //Quadrant RU  draw(KCC--KRC--KRU--KCU--cycle, b);  draw(KRUU--KCUUU--KCU--KRU--cycle, b);  draw(KCUUU--KRRUUU--KRRUU--KRUU--cycle, b);  draw(KRRU--KRRRU--KRRUUU--KRRUU--cycle, b);  draw(KCUUU--KCUUUU--KRRRUUUU--cycle, b);  draw(KCUUU--KRRUUU--KRRRUUUU--cycle, b);  draw(KRRRRRUUU--KRRUUU--KRRRUUUU--cycle, b);  draw(KRRRRRUUU--KRRRRRUU--KRRUUU--cycle, b);  draw(KCUUUUU--KRUUUU--KRUUU--KCUUUU--cycle, b);  //Quadrant RD  draw(KCC--KRDDD--KCD--cycle, b);  draw(KRC--KRDDD--KCC--cycle, b);  draw(KRC--KRRRDDD--KRDDD--cycle, b);  draw(KRRRDDD--KRDDD--KCD--cycle, b);  draw(KCDD--KRRDDD--KCD--cycle, b);  draw(KRRRDDD--KRRDDD--KCD--cycle, b);  draw(KCDD--KRRDDD--KRDDDD--cycle, b);  draw(KCDD--KCDDD--KRDDDD--cycle, b);  draw(KCDDD--KBRT--KBRU--cycle, b);  draw(KCDDD--KBRU--KBRD--KBRB--cycle, b);  //Quadrant LD  draw(KCC--KLC--KLLD--KLD--cycle, b);  draw(KCC--KCD--KLD--cycle, b);  draw(KCD--KLLD--KLD--cycle, b);  draw(KCD--KLLD--KLLLLD--cycle, b);  draw(KCD--KLLLLD--KCDD--cycle, b);  draw(KCDDD--(-.40625,-1.28125)--KCDD--cycle, b);  draw((-.46875,-1.234375)--(-.40625,-1.28125)--KCDD--(-.3125,-.90625)--cycle, b);  draw(KCDDD--KBLT--KBLU--cycle, b);  draw(KCDDD--KBLU--KBLD--KBLB--cycle, b);  [/asy]