// anything after double slash, on any line, is comment not code // NB if window display isn't wide enough, lines may spill over // so that comment becomes (invalid) code - you may need to // close a TeXnicCenter utility window import macros23Aug09; // connects to the file of this name which // you have saved in c:/program files/asymptote height = 120; // sets the distance between top and bottom rows /* frame oneFrame = plainShape( // 'oneFrame' because that's how we refer to it later (line... ) // copy and paste this block to create more plainShapes // (called threeFrame, whatever...) minBox((makeText( // "$\frac{d}{dx}$", 1.4, (0,0), // to include this line, delete the first double slash "$A$", 1, (0,0) // 1 is for size (fractions usually want to be 1.4), // (0,0) is to adjust position ).fit()), 45, 30), // 45 is horizontal minimum, 30 vertical minimum size minBox((makeText( // "$\int$", 1.4, (0,0), "$B$", 1, (0,0) // follow with comma if using 'dx' (or any) frame next line // "$dx$", 1, (0,0) ).fit()), 45, 30), 1 // make sure this is set to 1 (for 'oneFrame', etc.) ); // this marks the end of the sentence beginning 'frame oneFrame ...' */ /* // slash-star (previous line) comments out everything up to star-slash, so remove these to create the frame frame oneFrame = plainShape( minBox((makeText( // "$\frac{d^2}{dx^2}$", 1.4, (0,0), "$C$", 1, (0,0) ).fit()), 45, 30), minBox((makeText( // "$\int$", 1.4, (0,0), // "$\frac{d}{dx}$", 1.4, (0,0), "$D$", 1, (0,0) // "$dx$", 1, (0,0) ).fit()), 45, 30), minBox((makeText( // "$\int$", 1.4, (0,0), "$E$", 1, (0,0) // "$dx$", 1, (0,0), ).fit()), 45, 30), 1 ); */ frame dashFrame1 = minBox((makeText("$F$", 1.4, (0,0))).fit(),30,14); frame leftFrame1 = minBox((makeText("$G$", 1.4, (0,0))).fit(),30,14); frame chainExtension1 = chainExtension(dashFrame1, leftFrame1); /* frame twoFrame = chainShape( 0, // for animation - leave as zero for now! minBox((makeText("$H$", 1.4, (0,0))).fit(),0,14), // bottomMultiplier - If FractionChain minBox((makeText("$I$", 1, (0,0))).fit(),0,14), // bottomLeftString - or else insert // chainExtension 0, // bottomNormalExpFracOrRootfrac... 0, 1, 2 or 3 minBox((makeText("$J$", 1, (0,0))).fit(),30,14), // bottomDashString minBox((makeText("$K$", 1, (0,0))).fit(),0,14), // bottomRightString minBox((makeText("$L$", 1, (0,0))).fit(),0,14), // bottomTopString minBox((makeText("$M$", 1.4, (0,0))).fit(),0,14), // topMultiplier - If FractionChain minBox((makeText("$N$", 1.0, (0,0))).fit(),0,14), // topLeftString 0, // topNormalExpFracOrRootfrac... 0, 1, 2 or 3 minBox((makeText("$O$", 1, (0,0))).fit(),30,14), // topDashString minBox((makeText("$P$", 1, (0,0))).fit(),0,14), // topRightString minBox((makeText("$Q$", 1, (0,0))).fit(),0,14), // topTopString minBox((makeText("$R$", 1, (0,0))).fit(),25,30), // byProdString 2 ); */ /* frame oneFrame = prodShapeIn( true, // legs crossed? minBox((makeText("$O$", 1, (0,0))).fit(),23,12), // oneLeft minBox((makeText("$P$", 1, (0,0))).fit(),23,12), // oneRight minBox((makeText("$Q$", 1, (0,0))).fit(),23,12), // twoLeft minBox((makeText("$R$", 1, (0,0))).fit(),23,12), // twoRight minBox((makeText("$S$", 1, (0,0))).fit(),23,12), // threeLeft minBox((makeText("$T$", 1, (0,0))).fit(),23,12), // threeRight 1 ); */ /* frame oneFrame = prodShapeInLeft( true, minBox((makeText("$U$", 1.4, (0,0))).fit(),0,14), // bottomMultiplier - If FractionChain minBox((makeText("$V$", 1, (0,0))).fit(),0,14), // bottomLeftString 0, // bottomNormalExpFracOrRootfrac minBox((makeText("$W$", 1, (0,0))).fit(),30,14), // bottomDashString minBox((makeText("$X$", 1, (0,0))).fit(),0,14), // bottomRightString minBox((makeText("$Y$", 1, (0,0))).fit(),0,14), // bottomTopString minBox((makeText("$Z$", 1.4, (0,0))).fit(),0,14), // topMultiplier - If FractionChain minBox((makeText("$A$", 1, (0,0))).fit(),0,14), // topLeftString 0, // topNormalExpFracOrRootfrac minBox((makeText("$B$", 1, (0,0))).fit(),30,14), // topDashString minBox((makeText("$C$", 1, (0,0))).fit(),0,14), // topRightString minBox((makeText("$D$", 1, (0,0))).fit(),0,14), // topTopString minBox((makeText("$E$", 1, (0,0))).fit(),30,20), // byProdString minBox((makeText("$F$", 1, (0,0))).fit(),30,14), // oneRight minBox((makeText("$G$", 1, (0,0))).fit(),30,14), // twoRight minBox((makeText("$H$", 1, (0,0))).fit(),30,14), // threeLeft minBox((makeText("$I$", 1, (0,0))).fit(),30,14), // threeRight 1 ); */ /* frame oneFrame = prodShapeInRight( false, minBox((makeText("$?$", 1, (0,0))).fit(),30,14), // oneLeft minBox((makeText("$\sqrt{x^2 - 7}$", 1, (0,0))).fit(),30,14), // oneRight minBox((makeText("$2x$", 1, (0,0))).fit(),30,14), // twoLeft minBox((makeText("$2x$", 1, (0,0))).fit(),30,14), // threeLeft minBox((makeText("$O$", 1.4, (0,0))).fit(),0,14), // bottomMultiplier - If FractionChain minBox((makeText("$?$", 1, (0,0))).fit(),0,14), // bottomLeftString 0, // bottomNormalExpFracOrRootfrac minBox((makeText("$x^2 - 7$", 1, (0,0))).fit(),30,14), // bottomDashString minBox((makeText("$?$", 1, (0,9))).fit(),0,14), // bottomRightString minBox((makeText("$S$", 1, (0,0))).fit(),0,14), // bottomTopString minBox((makeText("$T$", 1.4, (0,0))).fit(),0,14), // topMultiplier - If FractionChain minBox((makeText("$$", 1, (0,0))).fit(),0,14), // topLeftString 0, // topNormalExpFracOrRootfrac minBox((makeText("$x^2 - 7$", 1, (0,0))).fit(),30,14), // topDashString minBox((makeText("$^\frac{1}{2}$", 1, (0,9))).fit(),0,14), // topRightString minBox((makeText("$X$", 1, (0,0))).fit(),0,14), // topTopString minBox((makeText("$2x$", 1, (0,0))).fit(),30,20), // byProdString 1 ); */ /* frame oneFrame = prodShapeInBoth( true, minBox((makeText("$Z$", 1.4, (0,0))).fit(),0,14), // leftBottomMultiplier - If FractionChain minBox((makeText("$A$", 1, (0,0))).fit(),0,14), // leftBottomLeftString 0, // leftBottomNormalExpFracOrRootfrac minBox((makeText("$B$", 1, (0,0))).fit(),30,14), // leftBottomDashString minBox((makeText("$C$", 1, (0,0))).fit(),0,14), // leftBottomRightString minBox((makeText("$D$", 1, (0,0))).fit(),0,14), // leftBottomTopString minBox((makeText("$E$", 1.4, (0,0))).fit(),0,14), // leftTopMultiplier - If FractionChain minBox((makeText("$F$", 1, (0,0))).fit(),0,14), // leftTopLeftString 0, // leftTopNormalExpFracOrRootfrac minBox((makeText("$G$", 1, (0,0))).fit(),30,14), // leftTopDashString minBox((makeText("$H$", 1, (0,0))).fit(),0,14), // leftTopRightString minBox((makeText("$I$", 1, (0,0))).fit(),0,14), // leftTopTopString minBox((makeText("$J$", 1, (0,0))).fit(),30,20), // leftByProdString minBox((makeText("$K$", 1, (0,0))).fit(),40,14), //oneRight minBox((makeText("$L$", 1, (0,0))).fit(),40,14), //threeLeft minBox((makeText("$M$", 1.4, (0,0))).fit(),0,14), // rightBottomMultiplier - If FractionChain minBox((makeText("$N$", 1, (0,0))).fit(),0,14), // rightBottomLeftString 0, // rightBottomNormalExpFracOrRootfrac minBox((makeText("$O$", 1, (0,0))).fit(),30,14), // rightBottomDashString minBox((makeText("$P$", 1, (0,0))).fit(),0,14), // rightBottomRightString minBox((makeText("$Q$", 1, (0,0))).fit(),0,14), // rightBottomTopString minBox((makeText("$R$", 1.4, (0,0))).fit(),0,14), // rightTopMultiplier - If FractionChain minBox((makeText("$S$", 1, (0,0))).fit(),0,14), // rightTopLeftString 0, // rightTopNormalExpFracOrRootfrac minBox((makeText("$T$", 1, (0,0))).fit(),30,14), // rightTopDashString minBox((makeText("$U$", 1, (0,0))).fit(),0,14), // rightTopRightString minBox((makeText("$V$", 1, (0,0))).fit(),0,14), // rightTopTopString minBox((makeText("$W$", 1, (0,0))).fit(),30,20), // rightByProdString 1 ); */ frame oneFrame = doubleChainShape( true, minBox((makeText("$Z$", 1.4, (0,0))).fit(),0,14), // leftBottomMultiplier - If FractionChain minBox((makeText("$A$", 1, (0,0))).fit(),0,14), // leftBottomLeftString 0, // leftBottomNormalExpFracOrRootfrac minBox((makeText("$B$", 1, (0,0))).fit(),30,14), // leftBottomDashString minBox((makeText("$C$", 1, (0,0))).fit(),0,14), // leftBottomRightString minBox((makeText("$D$", 1, (0,0))).fit(),0,14), // leftBottomTopString minBox((makeText("$E$", 1.4, (0,0))).fit(),0,14), // leftTopMultiplier - If FractionChain minBox((makeText("$F$", 1, (0,0))).fit(),0,14), // leftTopLeftString 0, // leftTopNormalExpFracOrRootfrac minBox((makeText("$G$", 1, (0,0))).fit(),30,14), // leftTopDashString minBox((makeText("$H$", 1, (0,0))).fit(),0,14), // leftTopRightString minBox((makeText("$I$", 1, (0,0))).fit(),0,14), // leftTopTopString minBox((makeText("$J$", 1, (0,0))).fit(),30,20), // leftByProdString minBox((makeText("$K$", 1, (0,0))).fit(),40,14), //oneRight minBox((makeText("$L$", 1, (0,0))).fit(),40,14), //threeLeft minBox((makeText("$M$", 1.4, (0,0))).fit(),0,14), // rightBottomMultiplier - If FractionChain minBox((makeText("$N$", 1, (0,0))).fit(),0,14), // rightBottomLeftString 0, // rightBottomNormalExpFracOrRootfrac minBox((makeText("$O$", 1, (0,0))).fit(),30,14), // rightBottomDashString minBox((makeText("$P$", 1, (0,0))).fit(),0,14), // rightBottomRightString minBox((makeText("$Q$", 1, (0,0))).fit(),0,14), // rightBottomTopString minBox((makeText("$R$", 1.4, (0,0))).fit(),0,14), // rightTopMultiplier - If FractionChain minBox((makeText("$S$", 1, (0,0))).fit(),0,14), // rightTopLeftString 0, // rightTopNormalExpFracOrRootfrac minBox((makeText("$T$", 1, (0,0))).fit(),30,14), // rightTopDashString minBox((makeText("$U$", 1, (0,0))).fit(),0,14), // rightTopRightString minBox((makeText("$V$", 1, (0,0))).fit(),0,14), // rightTopTopString minBox((makeText("$W$", 1, (0,0))).fit(),30,20), // rightByProdString 1 ); // then we paste the various frames into a picture, pik picture pik; real oneMax = xpart(max(oneFrame)); add(pik,oneFrame,(0,0)); /* real twoMin = xpart(min(twoFrame)); real twoMax = xpart(max(twoFrame)); shapeShift[2] = oneMax + 60 - twoMin; add(pik,twoFrame,(shapeShift[2],0)); /* // uncomment from here if you have created a 'threeFrame' real threeMin = xpart(min(threeFrame)); real threeMax = xpart(max(threeFrame)); shapeShift[3] = shapeShift[2] + twoMax + 60 - threeMin; add(pik,threeFrame,(shapeShift[3],0)); /* // likewise for 'fourFrame'... copy and modify for further frames real fourMin = xpart(min(fourFrame)); real fourMax = xpart(max(fourFrame)); shapeShift[4] = shapeShift[3] + threeMax + 40 - fourMin; add(pik,fourFrame,(shapeShift[4],0)); */ /* label(pik,scale(textScale)*"$=$",(bottomSign(1,2,1,2), 0)); // places = sign between frames 1 and 2, at fraction 1 over 2 label(pik,scale(textScale)*"$=$",(topSign(1,2,1,2), height)); // same /* label(pik,scale(textScale)*"$-$",(bottomSign(2,3,1,3), 0)); // places - sign between frames 2 and 3, at fraction 1 over 3 label(pik,scale(textScale)*"$-$",(topSign(2,3,1,3) + 10, height)); label(pik,scale(1.4*textScale)*"$[$",(bottomSign(2,3,2,3), 0)); // places [ sign between frames 2 and 3, at fraction 2 over 3 label(pik,scale(1.4*textScale)*"$[$",(topSign(2,3,2,3) + 20, height)); label(pik,scale(textScale)*"$-$",(bottomSign(3,4,1,2), 0)); // places - sign half-way between frames 3 and 4 label(pik,scale(textScale)*"$-$",(topSign(3,4,1,2), height)); label(pik,scale(textScale)*"$=$",(bottomSign(4,5,1,2), 0)); label(pik,scale(textScale)*"$=$",(topSign(4,5,1,2), height)); label(pik,scale(1.4*textScale)*"$]$",(shapeShift[4] + bottomRight[4] + 20,0)); label(pik,scale(1.4*textScale)*"$]$",(shapeShift[4] + topRight[4] + 40,height)); */ // label(pik,scale(textScale)*"$+\ \ \ \ c$",(shapeShift[2] + topRight[2] + 50,height)); // places +\ \ \ \ c text some way (50) past top right end of second frame /* // un-comment this block to create mapping arrows for 'internal' substitution pik.add(new void(frame f, transform t) { pair bottomBase = (shapeShift[2] + bottomArrowX[2], bottomArrowY[2] - 20); pair bottomHead = (shapeShift[2] + shapeShift[3] + bottomArrowX[3], bottomArrowY[3] - 30); path bottomLine=shift(5,9)*bottomBase --shift(7,0)*bottomBase --shift(-7,0)*bottomHead --shift(-5,9)*bottomHead; draw(f,bottomLine,Arrow(6bp)); label(f,scale(textScale*3/4)*"$x \mapsto \arctan t$",shift(0,-20)*(bottomBase + bottomHead)/2); pair topBase = (topArrowX[1], height + topArrowY[1] + 30); pair topHead = (shapeShift[2] + shapeShift[3] + topArrowX[3], height + topArrowY[3] + 30); path topLine=shift(5,-9)*topBase --shift(7,0)*topBase --shift(-7,0)*topHead --shift(-5,-9)*topHead; draw(f,topLine,Arrow(6bp)); label(f,scale(textScale*3/4)*"$x \mapsto \arctan t$",shift(0,20)*(topBase + topHead)/2); }); */ frame pikFrame = pik.fit(); //label(pikFrame, scale(0.7)*"drawn with: Asymptote", shift(45,-17)*min(pikFrame)); // please include these //label(pikFrame, scale(0.7)*"and Balloon Calculus", shift(40,-5)*min(pikFrame)); // ... or better! box(pikFrame, 5mm,5mm, invisible); add(pikFrame,(0,0));