; TeX output 1995.04.04:0931T@P@Pz"Vff cmbx10AUser'sMan=ualforMetaPost $': cmti10JohnD.HobbycK`y cmr10A*T&TUUBellLabGoratories $)MurrayUUHill,NJ 07974"jABSTRACTGThe:MetaPostsystemimplementsapicture-drawinglanguageverymuchlikeKnuth'so> logo10METAF9ONTGexceptthatitoutputsPostScriptcommandsinsteadofrun-length-encoGdedbitmaps.DNMetaPostisGapGowerfullanguageforproGducing guresfordocumentstobeprintedonPostScriptprinters.ItGprovides easyaccesstoallthefeaturesofPostScriptanditincludesfacilitiesforintegratingtextGandUUgraphics.!GThismdoGcumentservesasanintroGductoryuser'smanual.QzItdoGesnotrequireknowledgeofMETA-GF9ONT^oraccesstoTheo> logosl10METAFONTb}'ook,but^bGotharebene cial.Anappendixexplainsthedi erencesGbGetweenUUMetaPostandMETAF9ONT.*3ٟΠT@PGp0J cmsl10AUUUser'sManualforMetaPost(ިi@PGCon=tentsG1!HIntroGduction? b> cmmi10::::::::::::::::::::::::::::::::::::::::::::.s1G2!HBasicUUDrawingStatementsͬ::::::::::::::::::::::::::::::::::::.s2G3!HCurves%:::::::::::::::::::::::::::::::::::::::::::::::.s3 !H3.18LBGezierUUCubicCurvesͮ::::::::::::::::::::::::::::::::::::.s5!H3.28LSpGecifyingUUDirection,T*ension,andCurlw:::::::::::::::::::::::::.s5!H3.38LSummaryUUofPathSyntaxFo:::::::::::::::::::::::::::::::::.s7G4!HLinearUUEquations?:::::::::::::::::::::::::::::::::::::::::.s9!H4.18LEquationsUUandCoGordinatePairs)獑::::::::::::::::::::::::::::::.s9!H4.28LDealingUUwithUnknowns"::::::::::::::::::::::::::::::::::.r11G5!HExpressions ::::::::::::::::::::::::::::::::::::::::::::.r12!H5.18LDataUUTypGes:::::::::::::::::::::::::::::::::::::::::.r12!H5.28LOpGerators::::::::::::::::::::::::::::::::::::::::::.r13!H5.38LF*ractions,UUMediation,andUnaryOpGerators䍑:::::::::::::::::::::::.r15G6!HV*ariables#M:::::::::::::::::::::::::::::::::::::::::::::.r16!H6.18LT*okens`::::::::::::::::::::::::::::::::::::::::::::.r16!H6.28LV*ariableUUDeclarations[㍑::::::::::::::::::::::::::::::::::::.r17G7!HIntegratingUUT*extandGraphics :::::::::::::::::::::::::::::::::.r18!H7.18LTypGesettingUUY*ourLabelsD::::::::::::::::::::::::::::::::::.r20!H7.28LTheUUQespGecially8 guresforTU>'ExX^3andtro documents.h0The gurescanbeintegratedintoaTU>'ExXGdoGcumentWviaafreelyavqailableprogramcalleddvipsasshowninFigure1.^4 /@A'ExXUUDoGcument$ u cmex10???y:6?:6?:6?:6y-]$"݇ff݈߉ffBPt* :9MetaPostffBP鎑BP"݇ff"%"݇ff݈߉ff4t*TU>'ExXff44"݇ff???y:6?:6?:6?:6yqύwFiguresUUinPostScript-jWdviUU le???y:6?:6?:6?:6yj{"݇ff݈߉fft*MEdvipsff"݇ffL?L?L?LyU\ PostScript1FigureUU1:qAdiagramoftheproGcessingforaTU>'ExXdocumentwith guresinMetaPost*!GT*ouseMetaPost,youprepareaninput lecontainingMetaPostcoGdeandtheninvokeMetaPost,GusuallyUUbygivingacommandoftheform.ܲmpY~ !", cmsy10h leUUname'q̶iG(ThisQwsyntaxcouldbGesystemdependent).p}MetaPostQwinput lesnormallyhaveQwnamesending\.mp" GbutUUthispartofthenamecanbGeomittedwheninvokingUUMetaPost.qF*oraninput lefoo.mp mp?fooGJffr J= "5-: Aacmr61LܮMETAF9ONTXisatrademarkofAddisonWJesleyPublishingcompanÎy. > "5-:2LܴPÎostScriptXisatrademarkofAdob'ExXandMETAF9ONTdo.;BThusbprefersGtoPostScriptpGoints(\bigpGoints")andptreferstoprinter'spGoints.[VOtherunitsofmeasureincludeGinUUforinches,cmforcentimeters,andmmformillimeters.qF*orexample,@(2cm,2cm)--(0,0)--(0,3cm)--(3cm,0)--(0,0)GgeneratesualargerversionoftheabGovediagram.ӞItisOKutosay0instead0cmbGecausecmisreally Gjustxaconversionxfactorand0cmjustmultipliestheconversionfactorbyzero.(;(MetaPostunderstandsGconstructionsUUlike2cmasshorthandfor2*cm).!GItisoftenconvenienttointroGduceyourownscalefactor,sayu.UThenyoucande necoGordinatesGintermsofuanddecidelaterwhetheryouwanttobGeginwithu=1cmoru=0.5cm.ThisgivesyouGcontroldoverwhatgetsscaledandwhatdoGesnotsothatchanginguwillnota ectfeaturessuchasGlineUUwidths.!GTheretaremanywaystoa ecttheappGearanceofalinebesidesjustchangingitswidth,ӻsotheGwidth-controlmechanismsallowalotofgeneralitythatwedonotneedyet.5ThisleadstothestrangeGloGokingUUstatement˲pickup?pencirclescaled4ptGXffr J= "5-:5LܴAr*{promptisusedforinÎteractive{inputanda**promptindicatesthataninput lenameisexp'ExXorGtro doGcumentifyouhaveanoutputdriverthatcanhandleencapsulatedPostScript gures.HIfyourGstandardTU>'ExXmacrodirectorycontainsa leepsf.tex,youcanprobablyincludefig.1inaTU>'ExXGdoGcumentUUasfollows:ꍍz\input?epsfԍ}.}.}.$$\epsfbox{fig.1}$$UGThe\epsfboxmacro guresouthowmuchroGomtoleaveforthe gureandusesTU>'ExX's\specialGcommandUUtoinsertarequestforfig.1.!GIt5isalsopGossibletoincludeMetaPostoutputinatr}'o ɭdocument.hThe-mpicturesmacroGpackqagede nesacommand.BPϾthatincludesanencapsulatedPostScript le.EKF*orinstance,thetr}'o GcommandÀ.BP?fig.13c3cƤGincludesUUfig.1andspGeci esthatitsheightandwidthareboththreecentimeters.$ōG3*FCurv=eskGMetaPostispGerfectlyhappytodrawcurvedlinesaswellasstraightones.iAdrawstatementwithGthe?IpGointsseparatedby..drawsasmoGothcurvethroughthepGoints./F*orexampleconsiderthe`T@PGAUUUser'sManualforMetaPost&ĭ4@PGresultUUof Ųdraw?z0..z1..z2..z3..z4GafterUUde ning vepGointsasfollows:qG`̲z0?=(0,0);z1=(60,40);`z2?=(40,90); z3=(10,70);`z4?=(30,50);GFigureUU3showsthecurvewithpGointsz0throughz4labGeled.E+zga>4PSfile=manfig.3 llx=-3 lly=-2 urx=68 ury=100 rwi=710zFigureUU3:qTheresultofdraw?z0..z1..z2..z3..z49!GThere1aremanyotherwaystodrawacurvedpaththroughthesame vepGoints.RT*omakeaGsmoGothclosedcurve,connectz4backtothebGeginningbyappGending..cycletothedrawstatementGas NshowninFigure4a.YItisalsopGossibleinasingledrawstatementtomixcurvesandstraightlinesGas̍showninFigure4b.pJustuse--whereyouwantstraightlinesand..whereyouwantcurves.GThus ϲdraw?z0..z1..z2..z3--z4--cycleGproGducesacurvethroughpoints0,1,2,and3,thenapGolygonallinefrompoint3topoint4andGbackUUtopGoint0.qTheresultisessentiallythesameashavingtwodrawstatementsdraw?z0..z1..z2..z3Ganddraw?z3--z4--z0F׍T({1덍<$d7PSfile=manfig.104 llx=-8 lly=-15 urx=68 ury=100 rwi=760 卒(a)<$6PSfile=manfig.204 llx=-8 lly=-4 urx=68 ury=100 rwi=760 卒/P(b)! GFigure )4:o(a)Theresultofdraw?z0..z1..z2..z3..z4..cycle;g(b)theresultofdrawz0..z1..Gz2..z3--z4--cycle.o1T@PGAUUUser'sManualforMetaPost&ĭ5@PGN cmbx123.10GBqezierCubicCurvesWMGWhenZMetaPostisaskedtodrawasmoGothcurvethroughasequenceofpGoints,ܛitconstructsa Gpiecewise$cubiccurvewithcontinuousslopGeandapproximatelycontinuouscurvqature.5ThismeansGthatUUapathspGeci cationsuchas òz0..z1..z2..z3..z4..z5Gresults`inacurvethatcanbGede nedparametricallyas(X(t);Y8(t))for0t5,}where`X(t) GandfoY8(t)arepiecewisecubicfunctions.Thatis,jthereisadi erentpairofcubicfunctionsforeachGinteger-bGoundedt-intervqal.3XIfz0=(x0|s;y0),}z1=(x1;y1),}z2=(x2;y2),}:::̭,}MetaPostselectsBGezierGcontrolUUpGoints(x䍳+0;y䍐[ٳ+0i),(xO!cmsy71;y䍐[ٻ1ڭ),(x䍳+1;y䍐[ٳ+1i),:::,whereZ2#X(t8+i)RJ=h(18t)3|sxi,+3t(1t)2x䍳+ip+3t2(1t)x䍻i+1/+t3xi+1 tO;BÍ[ڭ.!GInorderforthepathtohaveacontinuousslopGeat(xiTL;yi), theincomingandoutgoingdirectionsGatUU(X(i);Y8(i))mustmatch.qThusthevectors~ب(xi,8x䍻i;UPyiy䍐[ٻiڭ)and8y(x䍳+ipxiTL;UPy䍐[ٳ+i 8Iyi)Gmusthavethesamedirection;*i.e.,[(xiTL;yi)mustbGeonthelinesegmentbGetween(x䍻i;y䍐[ٻiڭ)andG(x䍳+i;y䍐[ٳ+ii).iThis4PSfile=manfig.5 llx=-3 lly=-3 urx=68 ury=100 rwi=710GFigureƯ5:T{Theresultofdraw?z0..z1..z2..z3..z4withtheautomatically-selectedBGeziercontrolGpGolygonUUillustratedbydashedlines.#(G3.20GSp`ecifyingDirection,Tension,andCurlWMGMetaPost:providesmanywaysofcontrollingthebGehaviorofacurvedpathwithoutactuallyspGecifyingGthemcontrolpGoints.F*orinstance,somepGointsonthepathmaybGeselectedasverticalorhorizontalvYT@PGAUUUser'sManualforMetaPost&ĭ6@PGextrema.] If`z1istobGeahorizontalextremeandz2istobeaverticalextreme,#youcanspGecifythat G(X(t);Y8(t))UUshouldgoupwardUUatz1andtotheleftatz2::'ղdraw?z0..z1{up}..z2{left}..z3..z4;GThe=resultingshowninFigure6hasthedesiredverticalandhorizontaldirectionsatz1andz2,Gbut/itdoGesnotlookassmoothasthecurveinFigure3.BTThereasonisthelargediscontinuityinGcurvqatureatz1.OIfitwerenotforthespGeci eddirectionatz1,HtheMetaPostinterpreterwouldhaveGchosenadirectiondesignedtomakethecurvqatureabGovez1almostthesameasthecurvqaturebGelowGthatUUpGoint.rBxcic>4PSfile=manfig.6 llx=-3 lly=-4 urx=68 ury=100 rwi=710_FigureUU6:qTheresultofdraw?z0..z1{up}..z2{left}..z3..z4.I!GHow*canthechoiceofdirectionsatgivenpGointsonacurvedeterminewhetherthecurvqatureGwillbGecontinuous?^CThereasonisthatcurvesusedinMetaPostcomefromafamilywhereapathisGdetermined0byitsendpGointsandthedirectionsthere.eFigures7and8giveagoGod0ideaofwhatthisGfamilyUUofcurvesislike.`ǟ V⍍&5PSfile=manfig.7 llx=-1 lly=-1 urx=171 ury=51 rwi=1720q3-beginfig(7)3-for?a=0upto9:'draw?(0,0){dir45}..{dir-10a}(6cm,0);3-endfor3-endfig;2KGFigureUU7:qAcurvefamilyandtheMetaPostinstructionsforgeneratingitdIǟ Vg).6PSfile=manfig.8 llx=-1 lly=-31 urx=171 ury=20 rwi=1720q+beginfig(8)+for?a=0upto7:S%draw?(0,0){dir45}..{dir10a}(6cm,0);+endfor+endfig;2@gFigureUU8:qAnothercurvefamilywiththecorrespGondingMetaPostinstructions!GFiguresI7and8illustrateafewnewMetaPostfeatures.mThe rstisthediropGeratorthattakesGan+angleindegreesandgeneratesaunitvectorinthatdirection.SThusdir?0isequivqalenttorightGanddir?90isequivqalenttoup.Therearealsoprede neddirectionvectorsleftanddownfordirG180UUanddir?270.!GThedirectionvectorsgivenin{}canbGeofanylength,&andtheycancomebGeforeapointaswellGasafterone.5JItisevenpGossibleforapathspeci cationtohavedirectionsgivenbeforeandafteraGpGoint.qF*orUUexampleapathspeci cationcontaining:' ò..{dir?60}(10,0){up}..T@PGAUUUser'sManualforMetaPost&ĭ7@PGproGducesUUacurvewithacornerat(10;0).ֱ!GNoteethatsomeofthecurvesinFigure7havepGointsofin ection.)Thisisnecessaryinorderto GproGducejsmoothcurvesinsituationslikeFigure4a,butitisprobablynotdesirablewhendealingGwithverticalandhorizontalextremepGointsasinFigure9a.aEIfz1issuppGosedtobethetopmostGpGointonthecurve,thiscanbGeachievedbyusing...insteadof..inthepathspGeci cationasshownGin(Figure9b.bThemeaningof...is\choGoseanin ection-freepathbetween(thesepointsunlesstheGendpGointdirectionsmakethisimpGossible."*(ItwouldbGepossibletoavoidin ectionsinFigure7,GbutUUnotinFigure8).RMo B%ፍ @%8PSfile=manfig.109 llx=-75 lly=-10 urx=75 ury=19 rwi=1500k7mӲdraw?z0{up}..z1{right}..z2{down}晍 q8PSfile=manfig.209 llx=-75 lly=-10 urx=75 ury=16 rwi=1500Jdraw?z0{up}...z1{right}...z2{down}%ngFigureUU9:qTwodrawstatementsandtheresultingcurves.V!GAnotherXbwaytocontrolamisbGehavingpathistoincreasethe\tension"parameter.zUsing..inGaodpathspGeci cationsetsthetensionparametertothedefaultvqalue1.IfthismakessomepartofaGpath0alittletoGowild,wecanselectivelyincreasethetension.TIfFigure10aisconsidered\toGowild,"GaUUdrawstatementofthefollowingformincreasesthetensionbGetweenz1andz2:Ҳdraw?z0..z1..tension1.3..z2..z3GThisR?proGducesFigure10b.pF*oranasymmetricale ectlikeFigure10c,RthedrawstatementbGecomes ۲draw?z0..z1..tension1.6and1..z2..z3GTheUUtensionparametercanbGelessthanone,butitmustbeatleast 3&fes4 ..m=| &7损2֕8PSfile=manfig.110 llx=-57 lly=-10 urx=57 ury=31 rwi=1140`ae(a)ۍ8PSfile=manfig.210 llx=-57 lly=-10 urx=57 ury=27 rwi=1140^w׾(b)򜝍/0}8PSfile=manfig.310 llx=-57 lly=-10 urx=57 ury=28 rwi=1140c(c))>?2`>>?1΍!GNotesthat=isnotanassignmentopGerator;:itsimplydeclaresthattheleft-handsideequalsGthe[right-handside.Thusa=a+1proGducesanerrormessagecomplainingaboutan\inconsistentGequation."qTheUUwaytoincreasethevqalueofaistousetheassignmentopGerator:=asfollows:؀a:=a+1;GInUUotherwords,:=isforchangingexistingvqalueswhile=isforgivinglinearequationstosolve.O!GThere]isnorestrictionagainstmixingequationsandassignmentopGerationsasinthefollowingGexample:`̲a?=2;b=a;a:=3;c=a;}GAfterthe rsttwoequationssetaandbequalto2,theassignmentopGerationchangesato3withoutGa ecting*b.:EThe nalvqalueofcis3sinceitisequatedtothenewvalueofa.:EIngeneral,anGassignment=opGerationisinterpretedby rstcomputingthenewvqalue,theneliminatingtheoldvalueGfromUUallexistingequationsbGeforeactuallyassigningthenewvqalue.!󍍑G4.10GEquationsandCo`ordinatePairsGMetaPost^canalsosolvelinearequationsinvolvingcoGordinatepairs.W*ehavealreadyseenmanyGtrivialUUexamplesofthisintheformofequationslikez1=(0,.2in)GEachѭsideoftheequationmustbGeformedbyaddingorsubtractingcoGordinatepairsandmultiplyingGorbYdividingthembyknownnumericquantities.Otherwaysofnamingpair-vqaluedvariableswillbGeGdiscussedUUlater,butthezhnumbGer!Zi,1ͭisconvenientUUbGecauseitisanabbreviationforD3(x-hnumbGer!Zi堥,?y`hnumbGer!Zi=)GThis_makesitpGossibletogivevqaluestozvariablesbygivingequationsinvolvingtheircoGordinates.GF*orUUinstance,pGointsz1,z2,z3,andz6inFigure13wereinitializedviathefollowingequations:Šz1=-z2=(.2in,0);Šx3=-x6=.3in;Šx3+y3=x6+y6=1.1in; T@PGAUUUser'sManualforMetaPost!í10@PGExactlyUUthesamepGointscouldbeobtainedbysettingtheirvqaluesdirectly:|%G@Բz1=(.2in,0);z2=(-.2in,0); @z3=(.3in,.6in);?z6=(-.3in,1.2in);<!GAfterreadingtheequations,HtheMetaPostinterpreterknowsthevqaluesofz1,Hz2,z3,and㱲z6. GTheμnextstepintheconstructionofFigure13istode nepGointsz4andz5equallyspacedalongGthelinefromz3toz6.}SincethisopGerationcomesupoften,MetaPosthasaspecialsyntaxforit.GThisUUmediationconstructionz4=1/3[z3,z6]ҍGmeansUUthatz4is 1&fes3 ofthewayUUfromzp3toz6;i.e.,"زz4I=z3+<$l1lwfe (֍3 G(z6 ڶ8z3):GSimilarlyz5=2/3[z3,z6]GmakesUUz5 2&fes3 ofthewayfromzp3toz6.R lZ_ qc߲beginfig(13);cz1=-z2=(.2in,0);cx3=-x6=.3in;cx3+y3=x6+y6=1.1in;cz4=1/3[z3,z6];cz5=2/3[z3,z6];cz20=whatever[z1,z3]=whatever[z2,z4];cz30=whatever[z1,z4]=whatever[z2,z5];cz40=whatever[z1,z5]=whatever[z2,z6];cdraw?z1--z20--z2--z30--z1--z40--z2;cpickup?pencirclescaled1pt;cdraw?z1--z2;cdraw?z3--z6;cendfig;Y *s7PSfile=manfig.13 llx=-31 lly=-10 urx=40 ury=174 rwi=710qӍGFigure13:IMetaPostcommandsandtheresulting gure.VPointlabGelshavebGeenaddedtothe gureGforUUclarity*.M!GMediation\&canalsobGeusedtosaythatsomepointisatanunknownpGositionalongthelineGbGetweenptwoknownpGoints.TF*orinstance,wecouldaintroGducenewvqariableaaandwritesomethingGlike z20=aa[z1,z3];GThissaysthatz20issomeunknownfractionaaofthewayalongthelinebGetweenz1andz3.GAnother{suchequationinvolvingadi erentlineissucientto xthevqalueofz20._T*osaythatz20GisUUattheintersectionofthez1-z3lineandthez2-z4line,introGduceanothervqariableabandsetߴ z20=ab[z2,z4];GThisUUallowsMetaPosttosolveforx20,y20,aa,andab.⍑!GIt hisalittlepainfultokeepthinkingupnewnameslikeaaandab.XThiscanbGeavoidedbyusing Ga6\spGecialfeaturecalledwhatever.ThismacrogeneratesanewanonymousvqariableeachtimeitGappGears.qThusUUthestatementߴײz20=whatever[z1,z3]=whatever[z2,z4] ZT@PGAUUUser'sManualforMetaPost!í11@PGsetsUz20asbGefore,exceptituseswhatevertogeneratetwoUdi er}'ent-anonymousvqariablesinstead GofUUaaandab.qThisishowFigure13setsz20,z30,andz40. G4.20GDealingwithUnknownsGAsystemofequationssuchasthoseusedinFigure13canbGegiveninanyorderaslongasalltheGequationsxarelinearandallthevqariablescanbGedeterminedbeforetheyareneeded.|0ThismeansGthatUUtheequations Šz1=-z2=(.2in,0);Šx3=-x6=.3in;Šx3+y3=x6+y6=1.1in;Šz4=1/3[z3,z6];Šz5=2/3[z3,z6];Gsuceitodeterminez1throughz6,mnomatterwhatordertheequationsaregivenin.Ontheother Ghandz20=whatever[z1,z3]捑GislegalonlywhenaknownvqaluehaspreviouslybGeenspeci edforthedi erencez3{z1 ,QbecauseGtheUUequationisequivqalentto˲z20?=z1+whatever*(z3-z1)GandX)thelinearityrequirementdisallowsmultiplyingunknowncompGonentsofz3:²z1byX)theanony-Gmous#unknownresultofwhatever.0ThegeneralruleisthatyoucannotmultiplytwounknownGquantitiesmordividebyanunknownquantity*,norcananunknownquantitybGeusedinadrawGstatement.Sinceonlylinearequationsareallowed,>theMetaPostinterpretercaneasilysolvetheGequationsUUandkeeptrackofwhatvqaluesareknown.8!GTheUUmostnaturalwayUUtoensurethatMetaPostcanhandleanexpressionlike Àwhatever[z1,z3]GisVtoensurethatz1andz3arebGothknown.HoweverVthisisnotactuallyrequiredsinceMetaPost GmayќbGeabletodeduceaknownvqalueforz31pz1bGeforeќeitherofz1andz3areknown.EF*orinstance,GMetaPostUUwillaccepttheequations ޲z3=z1+(.1in,.6in); z20=whatever[z1,z3];GbutUUitwillnotbGeabletodetermineanyofthecomponentsofz1,z3,orz20.!GThese-equationsdogivepartialinformationabGoutz1,5z3,and-z20.dA-goodway-toseethisisto GgiveUUanotherequationsuchasx20-x1=(y20-y1)/6;捑GThis proGducestheerrormessage\! Redundant?equation.">MetaPostassumesthatyouaretryingGtoEtellitsomethingnew,|soitwillusuallywarnyouwhenyougivearedundantequation.PIfthenewGequationUUhadbGeenƲ(x20-x1)-(y20-y1)/6=1in;GtheUUerrormessagewouldhavebGeen |!?Inconsistentequation(offby71.99979).GThis2errormessageillustratesroundo errorinMetaPost'slinearequationsolvingmechanism. GRoundo werrorisnormallynotaseriousproblem.}butitislikelytocausetroubleifyouaretryingGtoUUdosomethinglike ndtheintersectionoftwolinesthatarealmostparallel. T@PGAUUUser'sManualforMetaPost!í12@PG5*FExpressionsGItisnowtimeforamoresystematicviewoftheMetaPostlanguage. W*ehaveseenthatthere Gare[numericquantitiesandcoGordinatepairs, andthatthesecanbecombinedtospecifypathsforGdraw:#statements.hW*ehavealsoseenhowvqariablescanbGeusedinlinearequations,?butwehavenotGdiscussedUUalltheopGerationsanddatatypesthatcanbeusedinequations.!GItispGossibletoexperimentwithexpressionsinvolvinganyofthedatatypGesmentionedbGelowGbyUUusingthestatement9show&hexpression,wiGtoaskMetaPosttoprintasymbGolicrepresentationofthevqalueofeachexpression.F*orknownGnumeric^8vqalues,`peachisprintedonanewlineprecededby\>>".oOthertypGesofresultsareprintedGsimilarly*,Wexceptthatcomplicatedvqaluesaresometimesnotprintedonstandardoutput. CThisGproGducesUUareferencetothetranscript lethatlookslikethis:`ز>>?picture(seethetranscriptfile)GIfqyouwanttothefullresultsofshowstatementstobGeprintedonyourterminal,assignapGositive GvqalueUUtotheinternalvariabletracingonline.!6G5.10GDataTyp`esuTGMetaPost4)actuallyhasninebasicdatatypGes:a1numeric,:pair,path,transform,color,string,bGoolean,Gpicture,UUandpGen.qLetusconsidertheseoneatatimebeginningwiththenumerictypGe.!GNumeric9quantitiesinMetaPostarerepresentedin xedpGointarithmeticasintegermultiplesof =`1Dz&fe?65536(e.ETheymustnormallyhaveabsolutevqalueslessthan4096butintermediateresultscanbGeeightGtimes=larger.iThisshouldnotbGeaproblemfordistancesorcoordinatevqaluessince4096PostScriptGpGoints ismorethan1.4meters.1YIfyouneedtoworkwithnumbGersofmagnitude4096ormore,settingGtheinternalvqariablewarningchecktozerosuppressesthewarningmessagesabGoutlargenumericGquantites.!GThepairtypGeisrepresentedasapairofnumericquantities.VUW*ehaveseenthatpairsareusedtoGgivevcoGordinatesindrawstatements.M}PairscanbGeadded,testob8jectsofanytypGeforequalityandinequality.@Comparisonrelations<,<=,>,andG>=Garede nedlexicographicallyforstringsandintheobviouswayfornumerics.mOrderingrelationsGare[alsode nedforbGooleans,]Fpairs,colors,and[transforms,butthecomparisonrulesarenotworthGdiscussingUUhere.!GThe_SpicturedatatypGeisjustwhatthenameimplies.AnythingthatcanbGedrawninMetaPostGcan0bGestoredinapicturevqariable.HInfact,thedrawstatementactuallystoresitsresultsinaspecialGpictureXvqariablecalledcurrentpicture.pPicturescanbGeaddedtootherpicturesandoperatedonGbyUUtransforms.!GFinally*,$thereisadatatypGecalledapen.IThemainfunctionofpensinMetaPostistodetermineGlineUUthickness,buttheycanalsobGeusedtoachievecalligraphice ects.qThestatement)ۍpickupYwhpGenUUexpression@$iGcausesmthegivenpGentobeusedinsubsequentdrawstatements.Normally*,sthepGenexpressionisof GtheUUform`pencircle?scaled-hnumericUUprimaryH|i>nDZ:ꍑGThisde nesacircularpGenthatproduceslinesofconstantthickness.Ifcalligraphice ectsareGdesired,UUthepGenexpressioncanbeadjustedtogiveanellipticalpenorapolygonalpen. 0G5.20GOp`eratorsEGTheretaremanydi erentwaystomakeexpressionsoftheninebasictypGes,butmostoftheoperationsG tintoafairlysimplesyntaxwithfourlevelsofprecedenceasshowninFigure14.nThereareGprimaries,secondaries,tertiaries,andgexpressionsofeachofthebasictypGes,sothesyntaxrulesGcouldDbGespecializedtodealwithitemssuchashnumericprimaryi,{hbGooleanDtertiaryi,etc.?ThisGallowsQtheresulttypGeforanoperationtodependonthechoiceofoperatorandthetypesofitsGopGerands.6F*orexample,MtheDi|,hprimary"#iuhtertiary!wi !hsecondary+#i=jhtertiary!wi+hsecondaryUUbinopF굶iz\hsecondary+#iuhexpression,wi!htertiary!wi=jhexpression,wi7jhtertiaryUUbinop<㘶i|chtertiary!wi|.ЭFigureUU14:qTheoverallUUsyntaxrulesforexpressionsGaddition"++and\Pythagoreansubtraction"+-+:a++bmeansp feŞUUar2S+8br2,rqanda+-+bmeansp feŞUUar2S8br2)Ƴ. GThereʇaretoGomanyotheroperatorstolisthere,butsomeofthemostimportantarethebooleanGopGerators2andandor.4_TheandoperatorisahprimarybinopiandtheoroperatorisahsecondaryGbinopi.!GThebasicopGerationsonstringsareconcatenationandsubstringconstruction.ThehtertiaryGbinopiUU&implementsconcatenation;e.g.,`"abc"?&"de"GproGducesthestring"abcde".|F*orsubstringconstruction,Ethehofoperatorisubstringisusedlike Gthis:gɲsubstringRVhpairUUexpressionAq϶i5of `hstringUUprimary?1ѶiGTheٶhpairexpressionidetermineswhatpartofthestringtoselect.TF*orthispurpGose,thestringisGindexed65sothatintegerpGositionsfallb}'etweencharacters.ggPretend65thestringiswrittenonapieceofGgraphZpapGersothatthe rstcharacteroccupiesxcoordinatesbetweenZzeroandoneandthenextGcharacterUUcoverstherange1x2,etc.qThusthestring"abcde"shouldbGethoughtoflikethis* 5PSfile=manfig.14 llx=-3 lly=-13 urx=93 ury=16 rwi=960Gand substring?(2,4)of"abcde"is"cd".ZThistakesalittlegettingusedtobutittendstoavoidGannoyingUU\o byone"errors.!GSomeopGeratorstakenoargumentsatall.QAnexampleofwhatFigure14callsahnullaryopiisGnullpictureUUwhichreturnsacompletelyblankpicture.!GThebasicsyntaxinFigure14onlycoversaspGectsoftheexpressionsyntaxthatarerelativelyGtypGe-independent.RF*orinstance,thecomplicatedpathsyntaxgiveninFigure12givesalternativeGrulesUUforconstructingahpathexpressioni.qAnadditionalruleFhpathUUknot+AiG!hpairUUtertiary5϶iCjhpathUUtertiary8qжiGexplainsUUthemeaningofhpathknotiinFigure12.qThismeansthatthepathexpressionz1+(1,1){right}..z2GdoGesUUnotneedparenthesesaroundz1+(1,1).ޠT@PGAUUUser'sManualforMetaPost!í15@PG5.30GFractions,Mediation,andUnaryOp`eratorsHGMediationIexpressionsdonotappGearinthebasicexpressionsyntaxofFigure14.[nMediationexpres- GsionsUUareparsedatthehprimaryilevel,sothegeneralruleforconstructingthemisoD*hprimary"#i!hnumericUUatomTheGdecimalieopGeratortakesanumbGerandreturnsthestringrepresentation.TheangleopGeratortakesGa5kpairandcomputesthetwo-argument5karctangent;ui.e.,mpangleistheinverseofthediropGeratorGthatBOwasdiscussedinSection3.2.kpThereisalsoanopGeratorcyclethattakesahpathprimaryiandGreturnsUUabGooleanUUresultindicatingwhetherthepathisaclosedcurve.T@PGAUUUser'sManualforMetaPost!í16@P!GThereAisawholeclassofotheropGeratorsthatclassifyexpressionsandreturnbooleanresults.k6A GtypGenamesuchaspaircanopGerateonanytypGeofhprimaryiandreturnabooleanresultindicatingGwhethertheargumentisapair.;Similarly*,eachofthefollowingcanbGeusedasaunaryoperator:Gnumeric,#boolean,color,string,transform,path,pen,andNpicture.`BesidesjusttestingtheGtypGebofahprimaryi,D%youcanusetheknownandunknownopGeratorstotestifithasacompletelyGknownUUvqalue.!GEvenanumbGercanbehavelikeanopGeratorinsomecontexts.PLThisreferstothetrickthatallowsG3xand3cmasalternativesto3*xand3*cm."TheruleisthatahnumbGerorfractionithatisnotGfollowedHby+,K[-,oranotherhnumbGerorfractionicanserveasahprimarybinopi.mThus2/3xistwoGthirdsUUofxbut(2)/3xis 2&feW3xgand3?3isillegal.!GThere-arealsoopGeratorsforextractingnumericsub eldsfrompairs,colors,and-eventransforms.GIfUUpisahpairprimaryi,xpart?pandypartpextractitscompGonentssothat(xpart?p,ypartp)Gis}equivqalenttopevenifpisanunknownpairthatisbGeingusedinalinearequation.@Similarly*,a GcolorUUcisequivqalentto`ز(redpart?c,greenpartc,bluepartc)GTheUUpartspGeci ersfortransformswillbediscussedlater.'čG6*FVariablesGMetaPost,=allowscompGoundvqariablenamessuchasx.a,x2r,y2r,andz2r,wherez2rmeansG(x2r,y2r)8;andz.ameans(x.a,y.a).zInfactthereisabroadclassofsuxessuchthatzhsuf-G xiUUmeans*(xhsuxvi㔱;UPy[ٶhsuxvi?m):GSinceUUahsuxiiscompGosedoftokens,itisbesttobeginwithafewcommentsabouttokens.!6G6.10GTokensuTGAMetaPostinput leistreatedasasequenceofnumbGers, stringconstants, andsymbGolictokens.SAGnumbGercconsistsofasequenceofdigitspossiblycontainingadecimalpoint.|T*echnically,gthecminusGsignlinfrontofanegativenumbGerisaseparatetoken. SinceMetaPostuses xedpGointarithmetic,GitdoGesnotunderstandexponentialnotationsuchas6.02E23._*MetaPostwouldinterpretthisastheGnumbGerUU6.02,followedUUbythesymbGolictokenE,followedbythenumbGer23.!GAnything9bGetweenapairofdoublequotes"isastringconstant.QiItisillegalforastringconstantGtostartononelineandendonalaterline.VNorcanastringconstantcontaindoublequotes"orGanythingUUotherthanprintableASCIGIcharacters.!GEverything inalineofinputotherthannumbGersandstringconstantsisbrokenintosymbGolicGtokens.ApesymbGolicptokenisasequenceofoneormoresimilarcharacters,wherecharactersareG\similar"UUiftheyoGccuronthesamerowofT*able1.!GThusCA_alphaand+-+aresymbGolictokensbut!=isinterpretedastwotokensandx34isaGsymbGoliccKtokenfollowedbyanumbGer.Sincethebrackets[and]arelistedonlinesbythemselves,GtheUUonlysymbGolictokensinvolvingthemare[,[[,[[[,etc.and],]],etc.!GSome<-charactersarenotlistedinT*able1bGecausetheyneedspecialtreatment.ThefourcharactersG,;()! are\loners":Weachcomma,+semicolon,or! parenthesisisaseparatetokenevenwhentheyoGccurܠT@PGAUUUser'sManualforMetaPost!í17(2c9Ed_ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz :<=>|`#&@$/*\堦+-堦!?堦'`堦^~堦{}@[@]WqǍkCT*ableUU1:qCharacterclassesfortokenizationGconsecutively*.lOThusD(())isfourtokens,H4notoneortwo.lOThepGercentsignisveryspGecialbecauseit GintroGducescomments.NThepGercentsignandeverythingafterituptotheendofthelineareignored.!GAnotherspGecialcharacteristheperiod.Twoormoreperiodstogetherformasymbolictoken,Gbut,asinglepGeriod,isignored,5 andapGeriod,precededorfollowed,bydigitsispartofanumbGerThusG..UandK...aresymbGolictokenswhilea.bisjusttwotokensaandb.UItconventionaltousepGeriodsGtoUUseparatetokensinthisfashionwhennamingavqariablethatismorethanonetokenlong.!6G6.20GVariableDeclarationsuTGAvqariablenameisasymbGolictokenorasequenceofsymbGolictokens.)MostsymbGolictokensareGlegitimatenvqariablenames,6butanythingwithaprede nedmeaninglikedraw,6+,orn..T%isdisallowed;Gi.e.,ҴvqariablennamescannotbGemacrosorMetaPostprimitives.ThisminorrestrictionallowsanGamazinglybroadclassofvqariablenames:alpha,e==>,@&#$&,andɲ~~arealllegitimatevariableGnames.qSuchUUsymbGolictokenswithoutspGecialmeaningsarecalledtags.!GAzPvqariablezZnamecanbGeasequenceoftagslikef.botorf.top.TheideaistoprovidesomeofGthefunctionalityofPascalrecordsorCstructures.ItisalsopGossibletosimulatearraysbyusingGvqariablenamesthatcontainnumbGersaswellassymbGolictokens.F*orexample,thevqariablenameGx2rOѭconsistsofthetagx,PthenumbGerO2,andthetagr.oTherecanalsobGevqariablesnamedx3randGevenzx3.14r.ThesevqariablescanbGetreatedasanarrayviaconstructionslikex[i]r,FwhereihasGanUUappropriatenumericvqalue.qTheoverallsyntaxforvqariablenamesisshowninFigure16.ZI9xkIhvqariable"1Ͷi+K!htag 㑶iqhsuxvixkIhsuxvi!hempty8i(6jhsuxvi!hsubscript'ZiSforthe"a"labGelandlabel.lftforthe"b"labelasshowninthe gure.~ThehlabelGsuxispGeci esthepositionofthelabelrelativetothespeci edcoordinates.ThecompletesetofGpGossibilitiesUUis#ʍSXhlabGelUUsux/G$i!hempty8i(6jlftjrtjtopjbotjulftjurtjllftjlrt4۠T@PGAUUUser'sManualforMetaPost!í19'NcǟDVqfbeginfig(17); fa=.7in;?b=.5in;fz0=(0,0);fz1=-z3=(a,0);fz2=-z4=(0,b);fdraw?z1..z2..z3..z4..cycle;fdraw?z1--z0--z2;flabel.top("a",?.5[z0,z1]);flabel.lft("b",?.5[z0,z2]);fdotlabel.bot("(0,0)",?z0);fendfig;"i7PSfile=manfig.17 llx=-51 lly=-37 urx=51 ury=37 rwi=1020VzFigureUU17:qMetaPostcoGdeandtheresultingoutputGwhere߲lftandrtmeanleftandrightandllft,ulft,etc.meanlowerleft,uppGerleft,etc.DdThe GactualvamountbywhichthelabGeliso setinwhateverdirectionisdeterminedbytheinternalvqariableGlabeloffset.!GFigure17alsoillustratesthedotlabelstatement.<1ThisisexactlylikethelabelstatementGexceptUUthatitaddsadotattheindicatedcoGordinates.qF*orexample@Ȳdotlabel.bot("(0,0)",?z0)Gplaces adotatz0andthenputsthelabGel\(0,0)"justbelowthedot.>Anotheralternativeisthe Gmacrovthelabel.h)ThishasthesamesyntaxasthelabelanddotlabelstatementsexceptthatitGreturnsUUthelabGelasahpictureprimaryiinsteadofactuallydrawingit.qThus òlabel.bot("(0,0)",?z0)GisUUequivqalentto ϲdraw?thelabel.bot("(0,0)",z0)!GF*orsimpleapplicationsoflabGeled gures,,youcannormallygetbywithjustlabelanddotlabel.GInfact,youmaybGeabletouseashortformofthedotlabelstatementthatsavesalotoftypingGwhen:6youhavemanypGointsz0,?z1,z.a,z.b,etc.:6andyouwanttousethezsuxesaslabGels.hTheGstatement òdotlabels.rt(0,?1,a);GisUUequivqalenttoEdotlabel.rt("0",z0);?dotlabel.rt("1",z1);dotlabel.rt("a",z.a);GThus#theargumenttodotlabelsisalistofsuxesforwhichzvqariablesareknown,#andthehlabGel GsuxiUUgivenwithdotlabelsisusedtopGositionallthelabels.!GThereisalsoalabelsstatementthatisanalogoustodotlabelsbutitsuseisdiscouragedGbGecauseitpresentscompatibilityproblemswithMETAF9ONT.SomeversionsofthepreloadedPlainGmacroUUpackqagede nelabelstobGesynonymouswithdotlabels.!GF*orlabGelingstatementssuchaslabelanddotlabelthatuseastringexpressionforthelabGelGtext,_the*stringgetstypGesetinadefaultfontasdeterminedbythestringvqariabledefaultfont.GTheinitialvqalueofdefaultfontislikelytobGe"cmr10",butitcanbechangedtoadi erentfontGnameUUbygivinganassignmentsuchasɲdefaultfont:="Times-Roman"DT@PGAUUUser'sManualforMetaPost!í20@PGTheredisalsoanumericquantitycalleddefaultscalethatdeterminesthetypGesize.!Whendefault- Gscaleis1,[yougetthe\normalsize"whichisusually10pGoint,[butthiscanalsobGechanged.*F*orGinstancedefaultscale?:=1.2`GmakeslabGelscomeouttwentypGercentlarger.IfyoudonotknowthenormalsizeandyouwanttoGbGessurethetextcomesoutatsomespeci csize,{qsay12points,{qyouscanusethefontsizeoperatorGtoUUdeterminethenormalsize:qe.g.,v|defaultscale?:=12pt/fontsizedefaultfont;؍!GWhenayouchangedefaultfont,_thenewfontnameshouldbGesomethingthatTU>'ExXwouldunder-GstandRsinceMetaPostgetsheightandwidthinformationbyreadingthetfm le.p(ThisisexplainedGinL%ThesTKß'E-Xb}'ook.[5@]6)ItshouldbGepossibletousebuilt-inPostScriptfonts,MbutthenamesforthemGaresystem-depGendent.NASomesystemsmayuserptmrorps-times-romaninsteadofTimes-Roman.GATU>'ExXfontsuchascmr10isalittledangerousbGecauseitdoesnothaveaspacecharacterorcertainGASCIGIzsymbols.In{Baddition,ĽMetaPostdoGesnotusetheligaturesandkerninginformationthatGcomesUUwithaTU>'ExXfont.!eG7.10GTyp`esettingYourLabels GTU>'ExXUUmaybGeusedtoformatcomplexlabels.qIfyousay=btex緶htypGesettingUUcommandsb*i!6etexGinʄaMetaPostinput le,thehtypGesettingcommandsigetprocessedbyTU>'ExXandtranslatedintoaGpicture(expression(actuallyahpictureprimaryi)thatcanbGeusedinalabelordotlabelstatement.GAnyUUspacesafterbtexorbGeforeetexareignored.qF*orinstance,thestatementw`label.lrt(btex?$\sqrtx$etex,(3,sqrt3)*u)GinUUFigure18placesthelabGelp fe3荱xatthelowerUUrightofthepGoint(3,sqrt?3)*u. LcǟDVq*f beginfig(18);*f numeric?u;*f u?=1cm;*f draw?(0,2u)--(0,0)--(4u,0);*f pickup?pencirclescaled1pt;*f draw?(0,0){up}4for?i=1upto8:..(i/2,sqrt(i/2))*u endfor;*f label.lrt(btex?$\sqrtx$etex,(3,sqrt3)*u);*f label.bot(btex?$x$etex,(2u,0));*f label.lft(btex?$y$etex,(0,u));*f endfig;/6PSfile=manfig.18 llx=-9 lly=-8 urx=114 ury=58 rwi=1230VzFigureUU18:qMetaPostcoGdeandtheresultingoutput/!GFigureZ19illustratessomeofthemorecomplicatedthingsthatcanbGedonewithlabels.?SincetheGresultRIofbtex:::etexisapicture,RitcanbGeoperatedonlikeapicture.pInparticular,RitispossibleGtoloapplytransformationstopictures.W*ehavelonotdiscussedthesyntaxforthisyet,r6butahpictureGsecondaryiUUcanbGehpictureUUsecondaryMBiڙrotated#hnumericUUprimaryH|i`GThisUUisusedinFigure19torotatethelabGel\y.axis"sothatitrunsvertically*.QT@PGAUUUser'sManualforMetaPost!í21h݈"bȟdՍq3щbeginfig(19); 3щnumeric?ux,uy;3щ120ux=1.2in;?4uy=2.4in;3щdraw?(0,4uy)--(0,0)--(120ux,0);3щpickup?pencirclescaled1pt;3щdraw?(0,uy){right}>Qfor?ix=1upto8:H}..(15ix*ux,?uy*2/(1+cosd15ix))>Qendfor;3щlabel.bot(btex?$x$axisetex,(60ux,0));3щlabel.lft(btex?$y$axisetexrotated90,hQk(0,2uy));3щlabel.lft(>Qbtex?$\displaystyley={2\over1+\cosx}$etex,>Q(120ux,?4uy));3щendfig;^Ս>7PSfile=manfig.19 llx=-12 lly=-10 urx=87 ury=184 rwi=990vΜzFigureUU19:qMetaPostcoGdeandtheresultingoutputg!GAnotherUUcomplicationinFigure19istheuseofthedisplayedUUequationKb3y"=<$yd2Kwfe%2 (֍18+cosGxfGasUUalabGel.qItwouldbemorenaturaltocodethisas$AŲ$$y={2\over?1+\cosx}$$GbutUUthiswouldnotworkbGecauseTU>'ExXtypGesetsthelabelsin\horizontalmode."A!GHerec4ishowTU>'ExXmaterialgetstranslatedintoaformMetaPostunderstands:TheMetaPost GproGcessor @skipsover @btex:::kϲetexblocksanddependsonapreprocessortotranslatethemintolowGlevelMetaPostcommands.^Ifthemain leisfig.mp,'@thetranslatedTU>'ExXmaterialisplacedina leGnamedDzfig.mpx.VThisisnormallydonesilentlywithoutanyuserinterventionbutitcouldfailifoneGof-thebtex:::ݲetexbloGckscontainsanerroneousTU>'ExX-command.dThentheerroneousTU>'EXinputisGsavedUUinthe lempxerr.texandtheerrormessagesappGearinmpxerr.log.!GTU>'ExX'EXcommandscanbGeenclosedinaverbatimtexG:::"etexbloGck.4Thedi erencebetweenbtexandverbatimtexisthattheformergeneratesapictureGexpressionBwhilethelatteronlyaddsmaterialforTU>'ExXtoproGcess.kF*orinstance,FHifyouwantTU>'ExXtoGtypGesetlabelsusingmacrosde nedinmymac.tex,KyourMetaPostinput lewouldloGoksomethingGlikeUUthis:$ATkwverbatimtex?ninputmymacetexTkwbeginfig(1);8hky.hky.hky.Tkwlabel(btexhTU>'ExXUUmaterialusingmymac.tex-ietex;ꥶhsomeUUcoGordinatesJ{iY>);hky.hky.hky.e!GOnHUnix^6 Msystems,0DanenvironmentHvqariablecanbGeusedtospecifythatbtex:::M7etexand Gverbatimtexy::: etexybloGcksareintro insteadofTU>'ExX.Whenusingthisoption,itisagoodideaG6ffr J= "5-:6LܴUnixXisaregisteredtrademarkofUnixSystemsLab'ExXfonts,sinceGprogramsthattranslateTU>'ExXoutputintoPostScriptneedtomakespGecialprovisionsforTU>'ExXfontsGintiincluded guresandthestandardPostScriptstructuringrulesdonotallowforthis.ThedetailsGonhowtoincludePostScript guresinapapGerdoneinTU>'ExXortro aresystem-dependent.yTheyGcanygenerallybGefoundinmanualpagesandotheron-linedocumentation.&3Aj lecalleddvips.texGisUUdistributedelectronicallyalongwiththedvipsTU>'ExXoutputproGcessor.!xˍG7.20GThe߆T cmtt12infontop`eratorGRegardless"rofwhetheryouuseTU>'ExXortro ,,alltherealworkofaddingtexttopicturesisdonebyaGMetaPost[primitiveopGeratorcalledinfont.ItisahprimarybinopithattakesahstringsecondaryiGasitsleftargumentandahstringprimaryiasitsrightargument.TTheleftargumentistext, andtheGrightargumentisafontname.TheresultoftheopGerationisahpicturesecondaryithatcanthenGbGeUUtransformedinvqariousways.qOneUUpossibilityUUisenlargementbyagivenfactorviathesyntax׍hpictureUUsecondaryMBi9scaledd$hnumericUUprimaryH|iGThusUUlabel("text",z0)isequivqalenttoWlabel("text"?infontdefaultfontscaleddefaultscale,z0)!GIfUUitisnotconvenientUUtouseastringconstantfortheleftargumentofinfont,youcanuse9char#hnumericUUprimaryH|iGtoUUselectacharacterbasedonitsnumericpGositioninthefont.qThusѲchar(n+64)?infont"Times-Roman"GisUUapicturecontainingcharactern+64oftheTimes-Romanfont.G7.30GMeasuringTextGMetaPostmakesreadilyavqailablethephysicaldimensionsofpicturesgeneratedbytheinfont GopGerator.Thereareunaryoperatorsllcorner,Dlrcorner,urcorner,ulcorner,andcenterthatGtake!ahpictureprimaryiandreturnthecornersofits\bGoundingbox"asillustratedinFigure20.GThecenteropGeratoralsoacceptshpathprimaryiandhpenprimaryioperands.>InMetaPostV*ersionG0.30UUandhigher,llcorner,lrcorner,etc.qacceptallthreeargumenttypGesaswell.!GTheb.argumenttypGerestrictionsonthecorneroperatorsarenotveryimportantbecausetheirmainGpurpGosezistoallowlabelanddotlabelstatementstocentertheirtextpropGerly*.5Theprede nedGmacroNݲbboxyhpictureUUprimaryDѶitG nds0arectangularpaththatrepresentsthebGoundingboxofagivenpicture.eIfpisapicture,7bboxGpUUequivqalentto׍Z(llcorner?p--lrcornerp--urcornerp--ulcornerp--cycle)GexceptthatitallowsforasmallamountofextraspacearoundpasspGeci edbytheinternalvqariable Gbboxmargin.l T@PGAUUUser'sManualforMetaPost!í23v FHC󍍍`\8PSfile=manfig.20 llx=-45 lly=-19 urx=231 ury=52 rwi=2760~FigureUU20:qAbGoundingboxanditscornerpoints.!GNote%thatMetaPostcomputesthebGoundingboxofabtex:::etexpicturejustthewayTU>'ExX GdoGes.aThis$isquitenatural,.butithascertainimplicationsinviewofthefactthatTU>'ExXhasfeaturesGlikeUU\strutand\rlapthatallowTU>'ExXuserstolieabGoutthedimensionsofabox.!GWhenATU>'ExXcommandsthatlieabGoutthedimensionsofaboxaretranslatedintolow-levelGMetaPostUUcoGde,asetboundsstatementdoGesthelying:tsetbounds}hpictureUUvqariableD{i Ato 5hpathUUexpressionD1жiGmakesTHthehpicturevqariableibGehaveasifitsbGoundingboxwerethesameasthegivenpath.T*ogetthe Gtrue]bGoundingboxofsuchapicture,_assignapGositivevqaluetotheinternalvqariabletruecorners:^7Gi.e.,|show?urcornerbtex$\bullet$\rlap{A}etexGproGducesUU\>>?(4.9813,6.8078)"whileRtruecorners:=1;?showurcornerbtex$\bullet$\rlap{A}etexGproGducesUU\>>?(15.7742,6.8078)."'čG8*FAdv{ancedGraphicsGAlltheexamplesintheprevioussectionshavebGeensimplelinedrawingswithlabelsadded.!This GsectionTdescribGesshadingandtoolsforgeneratingnot-so-simplelinedrawings.PShadingisdonewithGtheɲfillstatement.LCInitssimplestform,KthefillstatementrequiresahpathexpressionithatgivesGtheUUbGoundaryoftheregiontobe lled.qInthesyntaxݲfill9yhpathUUexpressionD1жiGthev argumentshouldbGeacyclicpath,~Ri.e.,av paththatdescribesaclosedcurveviathe..cycleor G--cycle3ǭnotation.fF*orexample,:}thefillstatementinFigure21buildsaclosedpathbyextendingGtheroughlysemicircularpathp.Thispathhasacounter-cloGckwiseorientation,˥butthatdoGesnotGmatterUUbGecausethefillstatementusesPostScript'snon-zerowindingnumbGerrule[1@].!GTheUUgeneralfillstatementyfill`hpathUUexpressionD1жi7withcolorĶhcolorUUexpressionEU]iGspGeci esUUashadeofgrayor(ifyouhaveacolorprinter)somerainbGowcolor.!GFigure22illustratesseveralapplicationsofthe llcommandto llareaswithshadesofgray*. GThepathsinvolvedareintersectingcirclesaandbandapathabthatbGoundstheregioninsidebothGcircles.8tCirclesaandbarederivedfromaprede nedpathfullcirclethatapproximatesacircleGof+unitdiametercenteredontheorigin.SThereisalsoaprede nedpathhalfcirclethatisthepart{fT@PGAUUUser'sManualforMetaPost!í24/wYǟ&VqeEbeginfig(21); eEpath?p;eEp?=(-1cm,0)..(0,-1cm)..(1cm,0);eEfill?p{up}..(0,0){-1,-2}..{up}cycle;eEdraw?p..(0,1cm)..cycle;eEendfig;6D6PSfile=manfig.21 llx=-29 lly=-29 urx=29 ury=29 rwi=5808mǯFigureUU21:qMetaPostcoGdeandthecorrespondingoutput._׍ǟtVqS=beginfig(22); S=path?a,b,aa,ab;S=a?=fullcirclescaled2cm;S=b?=ashifted(0,1cm);S=aa?=halfcirclescaled2cm;S=ab?=buildcycle(aa,b);S=picture?pa,pb;S=pa?=thelabel(btex$A$etex,(0,-.5cm));S=pb?=thelabel(btex$B$etex,(0,1.5cm));S=fill?awithcolor.7white;S=fill?bwithcolor.7white;S=fill?abwithcolor.4white;S=unfill?bboxpa;S=draw?pa;S=unfill?bboxpb;S=draw?pb;S=label.lft(btex?$U$etex,(-1cm,.5cm));S=draw?bboxcurrentpicture;S=endfig;*9=y6PSfile=manfig.22 llx=-42 lly=-31 urx=31 ury=59 rwi=730mǯFigureUU22:qMetaPostcoGdeandthecorrespondingoutput.^T@PGAUUUser'sManualforMetaPost!í25@PGofʲfullcircleabGovethexaxis.S%Pathabistheinitializedusingaprede nedmacrobuildcycle GthatUUwillbGediscussedshortly*.!GFillingcircleawiththelightgraycolor.7whiteandthendoingthesamewithcirclebdoublyG lls theregionwherethedisksoverlap.VThe ruleisthateachfillstatementassignsthegivencolorGto!>allpGointsintheregioncovered,T8wipingoutwhateverwastherepreviouslyincludinglinesandGtext'aswellas lledregions.bThusitisimpGortanttogivefillcommandsintherightorder.bIntheGabGoveGexample,JwtheoverlapGregiongetsthesamecolortwice,leavingGitlightgrayafterthe rsttwoGfillUUstatements.qThethird llstatementassignsthedarkercolor.4whitetotheoverlapregion.!GAtthispGointthecirclesandtheoverlapregionhavetheir nalcolorsbuttherearenocutoutsGforYthelabGels.~ThecutoutsareachievedYbytheunfillstatementsthate ectivelyerasethere-Ggions6ybGoundedbybbox?paandbboxpb.g~Moreprecisely*,toQ.IThisworkspGerfectlywellaslongastheintersectionpGointsareGuniquelyUUde nedbutitcancauseunexpGectedresultswhenpairsofpathsintersectmorethanonce.X|nJ]9qZbeginfig(24);Zh=2in;?w=2.7in;Zpath?p[],q[],pp;Zfor?i=2upto4:ii:=i**2;ep[i]?=(w/ii,h){1,-ii}...(w/i,h/i)...(w,h/ii){ii,-1};ZendforZq0.5?=(0,0)--(w,0.5h);Zq1.5?=(0,0)--(w/1.5,h);Zpp?=buildcycle(q0.5,p2,q1.5,p4);Zfill?ppwithcolor.7white;Zz0=center?pp;Zpicture?lab;lab=thelabel(btex$f>0$etex,z0);Zunfill?bboxlab;drawlab;Zdraw?q0.5;drawp2;drawq1.5;drawp4;Zdotlabel.top(btex?$P$etex,p2intersectionpointq0.5);Zdotlabel.rt(btex?$Q$etex,p2intersectionpointq1.5);Zdotlabel.lft(btex?$R$etex,p4intersectionpointq1.5);Zdotlabel.bot(btex?$S$etex,p4intersectionpointq0.5);Zendfig;􍍟Fݍ7PSfile=manfig.24 llx=-1 lly=-1 urx=195 ury=145 rwi=1960mǯFigureUU24:qMetaPostcoGdeandthecorrespondingoutput.9!GTheUUgeneralruleforthebuildcyclemacroisthatNbuildcycle(`-p1|s, gp2|s,p3|s, :::g, pk됲)GchoGosestheintersectionbGetweeneachpimRandpi+1UtobGeaslateaspossibleonpimRandasearlyasGpGossibleHonpi+1 tO.IThereisnosimpleruleforresolvingcon ictsbetweenHthesetwoHgoals,soyouGshouldavoidcaseswhereoneintersectionpGointoGccurslateronpipeandanotherintersectionpGointGoGccursUUearlieronpi+1 tO.ݠT@PGAUUUser'sManualforMetaPost!í27@P!GThepreferenceforintersectionsaslateaspGossibleonpiY^andasearlyaspossibleonpi+1yaleadsto Gambiguityresolutioninfavorofforward-goingsubpaths.:F*orcyclicpathssuchaspathbinFigure23G\early"dand\late"arerelativetoastart/ nishpGointwhichiswhereyougetbacktowhenyousayG\..cycle".qF*orUUthepathb,thisturnsouttobGetherightmostpointonthecircle.!GAmoredirectwaytodealwithpathintersectionsisviathehsecondarybinopiintersection-Gpointm/that ndsthepGointsPc,&Q,Rǭ,andm/SinFigure24.VThismacro ndsapointwheretwoGgivenHVpathsintersect.mrIfthereismorethanoneintersectionpGoint,JitjustchoGosesone;LifthereisnoGintersection,UUthemacrogeneratesanerrormessage. "G8.20GDealingwithPathsParametrically⍑GThe/intersectionpointmacroisbasedonaprimitiveopGerationcalledintersectiontimes.e>ThisGhsecondary,!binopiisoneofseveralopGerationsthatdealwithpathsparametrically*.*ItlocatesanGintersection)bGetweentwopathsbygivingthe\time"parameteroneachpath.bThisreferstotheGparameterizationschemefromSection3thatdescribGedpathsaspiecewisecubiccurvesbgX(t);Y8(t)bGwheretrangesfromzerotothenumbGerofcurvesegments._Inotherwords,*DwhenapathisspGeci edGasm3passingthroughasequenceofpGoints,s*wheret߭=0m3atthe rstpoint,s*thent߭=1m3atthenext,andGt=2UUatthenext,etc.qTheresultof⍍²a?intersectiontimesbGisOD(1;1)ifthereisnointersection;QJotherwiseyougetapair(tap;tbD),Pzwhereta%isatimeonpatha GwhenUUitintersectspathb,andtbYisthecorrespGondingtimeonpathb.!GF*orexample, suppGosepathaisdenotedbythethinlineinFigure25andpathbisdenotedbyGthethickerline.ZMIfthelabGelsindicatetimevqaluesonthepaths,thepairoftimevaluescomputedby⍍²a?intersectiontimesbGmustUUbGeoneof (0:25;1:77);(0:75;1:40);or (2:58;0:24);TGdepGendingRonwhichofthethreeintersectionpGointsischosenbytheMetaPostinterpreter.j,TheGexactrulesforchoGosingamongmultipleintersectionpGointsarealittlecomplicated,butitturnsoutGthat:yougetthetimevqalues(0:25;1:77)inthisexample.!SmallertimevaluesarepreferredoverGlarger4onessothat(tap;tbD)ispreferredto(t^0፹a;t^0vbD)whenevert^0፹a <:Qta andtb>hpathUUprimary:|iKT@PGAUUUser'sManualforMetaPost!í28@PGanswers1thisquestion.ZIfthehnumericexpressioniislessthanzeroorgreaterthanthetimevqalue GassignedtothelastpGointonthepath, thepoint?ofconstructionnormallyyieldsanendpointofGthe5path.hHence,-itiscommontousetheprede nedconstantinfinity(equalto4095.99998)asGtheUUhnumericexpressioniinapoint?ofconstructionwhendealingwiththeendofapath.!GSuch\in nite"timevqaluesdonotworkforacyclicpath, sincetimevqaluesoutsideofthenormalGrangecanbGehandledbymodulararithmeticinthatcase;*i.e.,"jacyclicpathpthroughpointsz0|s,"jz1,Gz2|s,UU:::,UUzn1Ghasthenormalparameterrange0tNAi!hpGenUUsecondary>NAiHwhtransformer2i`&htransformUUsecondaryYbi`!htransformUUsecondaryYbichtransformer2i`&htransformer2iDF!rotatedhnumericUUprimaryH|iw@jscaledhnumericUUprimaryH|iw@jshiftedhpairUUprimary7\{iw@jslantedhnumericUUprimaryH|iw@jtransformedhtransformUUprimaryPiw@jxscaledhnumericUUprimaryH|iw@jyscaledhnumericUUprimaryH|iw@jzscaledhpairUUprimary7\{iw@jreflectedabout(?hpairUUexpressionAq϶iNx,ShpairUUexpressionAq϶iӲ)w@jrotatedaround(?hpairUUexpressionAq϶iNx,ShnumericUUexpressionRжiqԲ)hFigureUU27:qThesyntaxfortransformsandrelatedopGeratorsq!GThereisalsoaunaryopGeratorinversethattakesatransformand ndsanothertransformthatGundoGesUUthee ectofthe rsttransform.qThusifp=qֲtransformedDT ߠT@PGAUUUser'sManualforMetaPost!í32@PGthen nq"=p?transformedinversen?TV:E!GItdwisnotlegaltotaketheinverseofanunknowntransformbutwehavealreadyseenthatyouGcanUUsayT?=htransformUUexpressionZEihGwhenReTR$hasnotbGeengivenavqalueyet.hItisalsopGossibletoapplyanunknowntransformtoaGknown'pairortransformandusetheresultinalinearequation.b]ThreesuchequationsaresucientGtoUUdetermineatransform.qThustheequationsG ϲ(0,1)?transformedT'=(3,4); (1,1)?transformedT'=(7,1); (1,0)?transformedT'=(4,-3);GallowUUMetaPosttodeterminethatthetransformT'isacombinationofrotationandscalingwithEϛtxx=4;Cty@Lx8=3; ty@Lx=3;Tty@Ly8=4;Xtx=0;'ty8=0:!GEquations"involvinganunknowntransformaretreatedaslinearequationsinthesixparameters GthatUUde nethetransform.qThesesixparameterscanalsobGereferredtodirectlyas]Kxpart?T ;ypart?T);xxpart?T.;xypart?T;yxpart?T;yypart?T;GwhereUUTisatransform.qF*orinstance,Figure28usestheequationsڲxxpart?T=yypartT;yxpartT=-xypartTGto|8spGecifythatT{isshapepreserving;i.e.,itisacombinationofrotating,shifting,anduniformGscaling.!n+G8.40GDashedLinesGTheMetaPostlanguageprovidesmanywaysofchangingtheappGearanceofalinebesidesjustGchanging"itswidth.`OnewayistousedashedlinesaswasdoneinFigures5and23.`ThesyntaxforGthisUUisndrawhpathUUexpressionD1жidashed 笶hdashUUpattern7ihGwhere]ahdashpatterniisreallyaspGecialtypeofhpictureexpressioni.Thereisaprede nedhdashGpatternivcalledevenlythatmakesdashes3PostScriptpGointslongseparatedbygapsofthesameGsize.HSAnotherprede neddashpatternwithdotsproGducesdottedlineswithdots5PostScriptpointsGapart.^9 dF*ordotsfurtherapartorlongerdashesfurtherapart,|thehdashpatternicanbGescaledasGshownUUinFigure29O!GAnotherwaytochangeadashpatternistoalteritsphasebyshiftingithorizontally*.ShiftingGtoS]therightmakesthedashesmoveforwardalongthepathandshiftingtotheleftmovesthemGbackward.nFigureTR30illustratesthise ect.ThedashpatterncanbGethoughtofasanin nitelyGrepGeatingpatternstrungoutalongahorizontallinewheretheportionofthelinetotherightoftheGy.axisUUislaidoutalongthepathtobGedashed.!GWhen Ayoushiftadashpatternsothattheyiaxiscrossesthemiddleofadash,;;the rstdashGgetsWtruncated.yThusthelinewithdashpatterne4startswithadashoflength12bpfollowedbyaG|ffr J= "5-:9LܸwithdotsXisonlyfoundinMetaPÎostversion0.50andhigher.!T@PGAUUUser'sManualforMetaPost!í33ǠUq>jUbeginfig(28); >jUpath?p[];>jUp1?=fullcirclescaled.6in;>jUz1=(.75in,0)=-z3;>jUz2=directionpoint?leftofp1=-z4;>jUp2?=z1..z2..{curl1}z3..z4..{curl1}cycle;>jUfill?p2withcolor.4[white,black];>jUunfill?p1;>jUdraw?p1;>jUtransform?T;>jUz1?transformedT=z2;>jUz3?transformedT=z4;>jUxxpart?T=yypartT; yxpartT=-xypartT;>jUpicture?pic;>jUpic?=currentpicture;>jUfor?i=1upto2:HOpic:=pic?transformedT;HOdraw?pic;>jUendfor>jUdotlabels.top(1,2,3);?dotlabels.bot(4);>jUendfig;$7PSfile=manfig.28 llx=-57 lly=-32 urx=57 ury=32 rwi=1140h}FigureUU28:qMetaPostcoGdeandtheresulting\fractal" gureBA=@b^{6PSfile=manfig.29 llx=-1 lly=-5 urx=271 ury=59 rwi=2720>FigureUU29:qDashedlineseachlabGeledwiththehdashpatterniusedtocreateit.BM40ύ206PSfile=manfig.30 llx=-8 lly=-4 urx=360 ury=47 rwi=3680GFigure30:Q DashedlinesandtheMetaPoststatementsfordrawingthemwheree4referstothedash GpatternUUevenly?scaled4."JT@PGAUUUser'sManualforMetaPost!í34@PG12bp$gapandanother12bpdash,etc.,while$e4?shifted(-6bp,0)proGducesa6bpdash,a12bp Ggap,thena12bpdash,etc.UBThisdashpatterncouldbGespeci edmoredirectlyviathedashpatternGfunction:ײdashpattern(on?6bpoff12bpon6bp)GThismeans\drawthe rst6bpoftheline,,thenskipthenext12bp,thendrawanother6bpandGrepGeat."Ifqthelinetobedashedismorethan30bplong,xthelast6bpofthe rstcopyofthedashGpatternwillmergewiththe rst6bpofthenextcopytoformadash12bplong.U>ThegeneralsyntaxGforUUthedashpatternfunctionisshowninFigure31.Z,chdashUUpattern7i2o!dashpattern(?hon/o UUlist+yi8#)chon/o UUlist+yiR!hon/o UUlist+yi5hon/o UUclause7㖶ix{jhon/o UUclause7㖶ichon/o UUclause7㖶iro!onhnumericUUtertiaryG1жiQjoffhnumericUUtertiaryG1жi8w}FigureUU31:qThesyntaxforthedashpatternfunction!GSince.adashpatternisreallyjustaspGecialkindofpicture,dthedashpatternfunctionreturnsGaEpicture.TItisnotreallynecessarytoknowthestructureofsuchapicture,sothecasualreaderGwillXeprobablywantXetoskipontoSection8.5.zF*orthosewhowantXetoknow,Y)alittleexpGerimentationGshowsUUthatifdisHdashpattern(on?6bpoff12bpon6bp)E\߱;Gthen$llcorner?dis(0;24)andurcornerdis(24;24).DrawingddirectlywithoutusingitasaGdashUUpatternproGducestwoUUthinhorizontallinesegmentslikethis:&3PSfile=manfig.31 llx=0 lly=24 urx=24 ury=24 rwi=240GThelinesinthisexamplearespGeci edashavingwidthzero,Sbutthisdoesnotmatterbecausethe GlineUUwidthisignoredwhenapictureisusedasadashpattern.!GTheGgeneralruleforinterpretingapicturedasadashpatternisthatthelinesegmentsindareGpro8jected+fontothex-axisandtheresultingpatternisreplicatedtoin nityinbGothdirectionsbyGplacing/gcopiesofthepatternend-to-end.e"Theactualdashlengthsareobtainedbystartingatx=0GandUUscanninginthepGositivexdirection.!GT*omaketheideaof\replicatingtoin nity"moreprecise,letPc(d)bGethepro8jectionofdontoGthe2xaxis,&andletshiftT(Pc(d);x)bGetheresultofshiftingdbyx.^fThepatternresultingfromin niteGreplicationUUis qˍ[ fintegers3ɹnshift(Pc(d);UPn8`(d));uGwhere `(d)measuresthelengthofPc(d).ThemostrestrictivepGossiblede nitionofthislengthisGdmaxz8dmin ,UUwhere[dmin;dmaxA̭]istherangeofxcoGordinatesinPc(d).qInfact,MetaPostusesmax5(jy0|s(d)j;UPdmaxz8dmin );Gwhere y0|s(d)isthey6coGordinateofthecontents ofd.Thecontents ofdshouldlieonahorizontal Gline,UUbutiftheydonot,theMetaPostinterpreterjustpicksay.coGordinatethatoccursind.!GApicture4usedasadashedpatternmustcontainnotextor lledregions,butitcancontainlinesGthatޚarethemselvesdashed.J4ThiscangivesmalldashesinsideoflargerdashesasshowninFigure32#T@PGAUUUser'sManualforMetaPost!í35Nǟ,Vq:Ųbeginfig(32); :draw?dashpattern(on15bpoff15bp)dashedevenly;:picture?p;:p=currentpicture;:currentpicture:=nullpicture;:draw?fullcirclescaled1cmxscaled3dashedp;:endfig; [EW26PSfile=manfig.32 llx=-43 lly=-15 urx=43 ury=15 rwi=860>o+>FigureUU32:qMetaPostcoGdeandthecorrespondingoutput zG8.50GOtherOptions{GY*ou2mighthavenoticedthatthedashedlinesproGducedbydashed?evenlyappGeartohavemore Gblack֤thanwhite.Thisisane ectofthelinecapparameterthatcontrolstheappGearanceoftheGends7 oflinesaswellastheendsofdashes.TherearealsoanumbGerofotherwaystoa ecttheGappGearanceUUofthingsdrawnwithMetaPost.!GThemlinecapparameterhasthreedi erentsettingsjustasinPostScript.PlainMetaPostgivesGthisinternalvqariablethedefaultvalueroundedwhichcauseslinesegmentstobGedrawnwithroundedGendslikethesegmentfromz0toz3inFigure33. Settinglinecap+uv:=9;buttQcutstheendso ushGso^thatdashesproGducedbydashed?evenlyhavelength3bp,a-not3bpplusthelinewidth.4Y*oucanGalsogetsquared-o endsthatextendpastthespGeci edendpointsbysettinglinecap*~:=7squared_}asGwasUUdoneinthelinefromz2toz5inFigure33.WǟJVqAbeginfig(33);Afor?i=0upto2:L~z[i]=(0,40i);?z[i+3]-z[i]=(100,30);AendforApickup?pencirclescaled18;Adraw?z0..z3withcolor.8white;Alinecap:=butt;Adraw?z1..z4withcolor.8white;Alinecap:=squared;Adraw?z2..z5withcolor.8white;Adotlabels.top(0,1,2,3,4,5);Aendfig;?linecap:=rounded;?*8PSfile=manfig.33 llx=-12 lly=-92 urx=112 ury=40 rwi=1240\o+>FigureUU33:qMetaPostcoGdeandthecorrespondingoutput!GAnother]parameterbGorrowed]fromPostScripta ectsthewayadrawstatementtreatssharpGcornersXinthepathtobGedrawn.Thelinejoinparametercanberounded,زbeveled,orXmiteredGasshowninFigure34. ThedefaultvqalueforplainMetaPostisroundedwhichgivesthee ectofGdrawingUUwithacircularbrush.!GWhenlinejoinismitered,6sharpcornersgeneratelongpGointedfeaturesasshowninFigure35.GSincethismightbGeundesirable,-thereisaninternalvqariablecalledmiterlimitthatcontrolshowGextreme@thesituationcangetbGeforethemiteredjoinisreplacedbyabeveledjoin.F*orPlainGMetaPost,5miterlimit-hasadefaultvqalueof10.0andlinejoinsreverttobGeveledwhentheratioofGmiterUUlengthtolinewidthreachesthisvqalue.!GThelinecap,(linejoin,andmiterlimitparametersareespGeciallyimportantbecausetheyalsoGa ectthingsthatgetdrawnbGehindthescenes.F*orinstance,IuPlainMetaPosthasstatementsforGdrawingUarrows,JTandthearrowheadsareslightlyroundedwhenlinejoinisrounded.Thee ectGdepGendsMonthelinewidthandisquitesubtleatthedefaultlinewidthof0.5bpasshowninFigure36.$ rT@PGAUUUser'sManualforMetaPost!í36p_@~Uzq:beginfig(34); :for?i=0upto2:Dz[i]=(0,50i);?z[i+3]-z[i]=(60,40);Dz[i+6]-z[i]=(120,0);:endfor:pickup?pencirclescaled24;:draw?z0--z3--z6withcolor.8white;:linejoin:=mitered;:draw?z1..z4--z7withcolor.8white;:linejoin:=beveled;:draw?z2..z5--z8withcolor.8white;:dotlabels.bot(0,1,2,3,4,5,6,7,8);:endfig;?linejoin:=rounded;Oz 9PSfile=manfig.34 llx=-12 lly=-112 urx=132 ury=52 rwi=1440gAo+>FigureUU34:qMetaPostcoGdeandthecorrespondingoutputՍC_Y^Z9PSfile=manfig.35 llx=-115 lly=-55 urx=165 ury=39 rwi=28006FigureUU35:qThemiterlengthandlinewidthwhoseratioislimitedbymiterlimit.=۟'$^xs8PSfile=manfig.36 llx=-8 lly=-49 urx=220 ury=-11 rwi=2280nFigureUU36:qThreewaysUUofdrawingarrows.%T@PGAUUUser'sManualforMetaPost!í37@P!GDrawingUUarrowsliketheonesinFigure36issimplyamatterofsayingndrawarrowYrhpathUUexpressionD1жiGinsteadofdrawhpathexpressioni.\ThisdrawsthegivenpathwithanarrowheadatthelastpGoint Gon thepath.ZIfyouwantthearrowheadatthebGeginningofthepath,xjustusetheunaryoperatorGreversetotaketheoriginalpathandmakeanewonewithitstimesensereversed;?i.e.,nforapathpGwithUUlength?p=n,}YgpointTt?ofreversepN?ڭandh\Ppoint=n8t?ofpGareUUsynonymous.!GAsUUshowninFigure36,astatementbGeginningdrawdblarrow9mhpathUUexpressionD1жiGdrawsadouble-headedarrow.ThesizeofthearrowheadisguaranteedtobGelargerthantheline Gwidth,butitmightneedadjustingifthelinewidthisverygreat.ThisisdonebyassigninganewGvqalueatotheinternalvariableahlengththatdeterminesarrowheadlengthasshowninFigure37.GIncreasingahlengthfromthedefaultvqalueof4PostScriptpGointsto1.5centimetersproGducestheGlarge:arrowheadinFigure37.WiThereisalsoanahangleparameterthatcontrolstheangleatthetipGofUUthearrowhead.qThedefaultvqalueofthisangleis45degreesasshowninthe gure.A5TOo6PSfile=manfig.37 llx=-3 lly=-3 urx=143 ury=80 rwi=1460GFigure{37:(A{|largearrowheadwithkeyparameterslabGeledandpathsusedtodrawitmarkedwithGwhiteUUlines.9!GThe)arrowheadiscreatedby llingthetriangularregionthatisoutlinedinwhiteinFigure37andGthendrawingarounditwiththecurrentlypickeduppGen.>Thiscombinationof llinganddrawingGcanUUbGecombinedintoasinglefilldrawstatement:4@Ʋfilldraw_VhpathUUexpressionD1жihoptionalUUdashedandwithcolorandwithpenclausescYic;GTheFնhpathexpressionishouldbGeaclosedcyclelikethetriangularpathinFigure37.FFThispath GshouldVLnotbGeconfusedwiththepathargumenttodrawarrowwhichisindicatedbyawhitelineinGtheUU gure.!GWhitelinesliketheonesinthe gurecanbGecreatedbyanundrawstatement.RThisisanerasingGversionofdrawthatdrawswithcolor?backgroundjustastheunfillstatementdoGes.BThereisalsoGanUUunfilldrawstatementjustincasesomeone ndsauseforit.!GThefilldraw,CundrawandunfilldrawstatementsandallthearrowdrawingstatementsarelikeGtheɲfillanddrawstatementsinthattheytakedashed,withpen,andɲwithcoloroptions.`"WhenGyouhavealotofdrawingstatementsitisnicetobGeabletoapplyanoptionsuchaswithcolorG0.8white٭toallofthemwithouthavingtotypGethisrepeatedlyaswasdoneinFigures33and34.GTheUUstatementforthispurpGoseis%drawoptions(htextid")& 2T@PGAUUUser'sManualforMetaPost!í38@PGwherexthehtextiargumentgivesasequenceofdashed,withcolor,andxwithpenoptionstobGe GappliedUUautomaticallytoalldrawingstatements.qIfyouspGecify> ۲drawoptions(withcolor?.5[black,white])GandUUthenwantUUtodrawablackline,youcanoverridethedrawoptionsbyspGecifyingYdrawInfact,ڄthereisevenanopGeratorcalledGmakepenthattakesaconvex-pGolygon-shapedpathandmakesapGenthatshapeandsize.PIfthepathGis˕notexactlyconvex˕orpGolygonal,"themakepenoperatorwillstraightentheedgesand/ordropsomeGofUUthevertices.qInparticular,pensquareisequivqalentto_J] makepen((-.5,-.5)--(.5,-.5)--(.5,.5)--(-.5,.5)--cycle)!GThe!WinverseofmakepenisthemakepathopGeratorthattakesahpGenprimaryiandreturnstheGcorrespGondingqdpath.Thusmakepath?pencircleproducesacircularpathidenticaltofullcircle.GThisUUalsoworksforapGolygonalpensothatmakepath?makepenghpathUUexpressionD1жiGwillUUtakeanycyclicpathandturnitintoaconvexpGolygon.!@G8.70GClippingandLow-LevelDrawingCommands5 GDrawingstatementssuchasdraw,tfill,filldraw,andunfillarepartofthePlainmacropackqageGand>arede nedintermsofmoreprimitivestatements.'Themaindi erencebGetweenthedrawingGstatementsdiscussedinprevioussectionsandthemoreprimitiveversionsisthattheprimitive(;РT@PGAUUUser'sManualforMetaPost!í40@PGdrawing)OstatementsallrequireyoutospGecifyapicturevqariabletoholdtheresults.cF*orfill,2draw, GandQIrelatedstatements,Ftheresultsalwaysgotoapicturevqariablecalledcurrentpicture.eTheGsyntax.fortheprimitivedrawingstatementsthatallowyoutospGecifyapicturevqariableisshowninGFigureUU39.܍9ODaddtohpictureUUvqariableD{iK㙲alsohpictureUUexpressionN%iVChoptionUUlist,if VjaddtohpictureUUvqariableD{iK㙲contourhpathUUexpressionD1жiKhoptionUUlist,if VjaddtohpictureUUvqariableD{iK㙲doublepathhpathUUexpressionD1жiKhoptionUUlist,iOD>?3.1 >>?y3aGindicatingthatx23hasreturnedtoitsformervqalueof3.1andy3aiscompletelyunknownasitwas GatUUbeginfig(17).s!GTheUUloGcalityofxandyvqariablesisachievedbythestatementலsave?x,yGinUUthehreplacementtextiforbeginfig.qIngeneral,vqariablesaremadeloGcalbythestatementsaveK?hsymbGolicUUtokenlistRDiGwhereUUhsymbGolictokenlistiisacomma-separatedlistoftokens:Z hsymbGolicUUtokenlistRDi9!hsymbGolicUUtokenAU_id'jhsymbGolicUUtokenAU_iK㕲,Q#hsymbGolicUUtokenlistRDi$ZGAllBvqariableswhosenamesbGeginwithoneofthespeci edsymbolictokensbecomeunknownnumericsGand2theirpresentvqaluesaresavedforrestorationattheendofthecurrentgroup.4]IfthesaveGstatementUUisusedoutsideofagroup,theoriginalvqaluesaresimplydiscarded.+gT@PGAUUUser'sManualforMetaPost!í43@P!GThebFmainpurpGoseofthesavestatementistoallowmacrostousevqariableswithoutinterfering Gwith-existingvqariablesorvariablesinothercallstothesamemacro.PF*orexample,theprede nedGmacroUUwhateverhasthehreplacementtexti ϲbegingroup?save?;? endgroupGThis3returnsanunknownnumericquantity*,mbutitisnolongercalledquestionmarksincethatname GwasUUloGcaltothegroup.qAskingthenameviashow?whateveryields_>>?%CAPSULEЬnnnnGwherennnnisanidenti cationnumbGerthatischosenwhensavemakesthenamequestionmarkGdisappGear.!GInGspiteoftheversatilityGofsave,JitcannotbGeusedtomakelocalchangestoanyofMetaPost'sGinternalUUvqariables.qAstatementsuchas`save?linecapGwouldvcauseMetaPosttotempGorarilyforgetthespecialmeaningofthisvqariableandjustmakeitGanRunknownnumeric."Ifyouwanttodrawonedashedlinewithlinecap:=buttandthengobackGtoUUthepreviousvqalue,youcanusetheinterimstatementasfollows:Ybegingroup?interimlinecap:=butt;YdrawHhpathUUexpressionD1жi޲dashed?evenly;endgroupGThisvsavesthevqalueoftheinternalvqariablelinecapandtempGorarilygivesitanewvqaluewithoutGforgettingUUthatlinecapisaninternalvqariable.qThegeneralsyntaxiszinterim9vhinternalUUvqariableG*ia:=9shnumericUUexpressionRжi!6G9.20GParameterizedMacrosuTGThebasicideabGehindparameterizedmacrosistoachievegreater exibilitybyallowingauxiliaryGinformation\*tobGepassedtoamacro.EW*ehave\*alreadyseenthatmacrode nitionscanhave\*formalGparametersthatrepresentexpressionstobGegivenwhenthemacroiscalled.;F*orinstanceade nitionGsuchUUas`Ydef?rotatedaround(exprz,d)=]hreplacementUUtextI\ziU睲enddefGallowsUUtheMetaPostinterpretertounderstandmacrocallsoftheform=%rotatedaround(?hexpression,wi9㒲,?#hexpression,wis$)!GThekeywordexprinthemacrode nitionmeansthattheparameterscanbGeexpressionsofGanytypGe.5Whenthede nitionspeci es(expr?z,d),theformalparameterszanddbGehavelikeGvqariablesoftheappropriatetypGes.bWithinthehreplacementtexti,theycanbGeusedinexpressionsGjustHClikevqariables,buttheycannotbGeredeclaredorassignedto.JThereisnorestrictionagainstGunknownUUorpartiallyknownarguments.qThusthede nition|def?midpoint(expra,b)=(.5[a,b])enddefGworksUUpGerfectlywellwhenaandbareunknown.qAnequationsuchasŲmidpoint(z1,z2)?=(1,1),tT@PGAUUUser'sManualforMetaPost!í44@PGcouldUUbGeusedtohelpdeterminez1andz2.!GNoticethattheabGovede nitionformidpointworksfornumerics,Spairs,orcolorsaslongasbGoth GparametersNhavethesametypGe.oIfforsomereasonwewantamiddlepointmacrothatworksforaGsinglex>?2."!GIfUUthehidemacrowerenotprede ned,itcouldbGede nedlikethis:qPdef?ignore(expra)=enddef; Pdef?hide(textt)=ignore(begingroupt;0endgroup)enddef;GThe>statementsrepresentedbythetextparametertwouldbGeevqaluatedaspartofthegroupthat Gformsstheargumenttoignore.v!Sinceignorehasanemptyhreplacementtexti,,{expansionoftheGhideUUmacroultimatelyproGducesnothing./hT@PGAUUUser'sManualforMetaPost!í47aݍ)sa@rWangle_radius=8pt; Wdef?mark_angle(expra,b,c,n)=b`begingroupb`save?s,p;pathp;b`p?=unitvector(a-b){(a-b)rotated90}..unitvector(c-b);b`s?=.9marksize/length(point1ofp-point0ofp);b`if?sbuttheirgeneralitysometimesgetsintheway*.`IfyoujustGwanttopassavqariablenametoamacro,itisbGettertodeclareitasasuxparameter.stropGeratorisgenerallyforemergencyuseonly*.ԁItisbettertousesuxparametersonlyGasdjvqariablenamesorsuxes.ThebGestexampleofavardefmacroinvolvingdjsuxesisthezmacroGthatmde nesthezconvention.Themde nitioninvolvesmaspGecialtoken@#thatreferstothesuxGfollowingUUthemacroname:`̲vardef?z@#=(x@#,y@#)enddef;GThismmeansthatanyvqariablenamewhose rsttokeniszisequivqalenttoapairofvqariableswhoseGnamesGareobtainedbyreplacingzwithxandy.ImF*orinstance,}z.a1callsthezmacrowiththesuxGparameterUU@#settoa1.!GInUUgeneral,vardefD$hgenericUUvqariableDzi'@#GisNanalternativetovardefhgenericvqariableithatcausestheMetaPostinterpretertoloGokforaGsuxfollowingthenamegiveninthemacrocallandmakesthisavqailableasthe@#suxparameter.!GT*oBsummarizethespGecialfeaturesofvqardefmacros,FQtheyallowabroadclassofmacronamesasGwellasmacronamesfollowedbyaspGecialsuxparameter.1.F*urthermore,KbegingroupandendgroupGare0automaticallyaddedtothehreplacementtextiofavqardefmacro.eThususingvardefinsteadofGdeftode nethejoinupmacroinFigure45wouldhaveavoidedtheneedtoincludebegingroupGandUUendgroupexplicitlyinthemacrode nition.!GInifact,o(mostofthemacrode nitionsgiveninpreviousexamplescouldequallywellusevardefGinstead9Xofdef.ItusuallydoGesnotmatterverymuchwhichyouuse,rYbutagoGod9XgeneralruleisGtousevardefifyouintendthemacrotobGeusedlikeafunctionorasubroutine.ThefollowingGcomparisonUUshouldhelpindecidingwhentousevardef.!F+GV*ardefUUmacrosareautomaticallysurroundedbybegingroupandendgroup.!F+GTheUUnameofavqardefmacrocanbGemorethanonetokenlonganditcancontainsubscripts.!F+GAyevqardefyomacrocanhaveyoaccesstothesuxthatfollowsthemacronamewhenthemacrois +Gcalled.!F+GWhen_asymbGolictokenisusedinthenameofavqardefmacroitremainsatagandcanstill+GbGeusedinothervqariablenames."iThusp5dirisalegalvariablenameeventhoughdirisa+Gvqardef*macro,3@ iKhundelimitedUUpartI\}i].jvardefhgenericUUvqariableDziM@hdelimitedUUpart>@ ifhundelimitedUUpartI\}i].jvardefhgenericUUvqariableDziM@@#X:hdelimitedUUpart>@ i`hundelimitedUUpartI\}i].jhbinaryUUdef,xi7!hparameter,ikNEhsymbGolicUUtokenAU_ijhparameter,iFghdelimitedUUpart>@ i5!hempty8i].jhdelimitedUUpart>@ iH?(N0UUandicUUifi<0.!GItisbGesttousethisfeatureonlywhenthestepsizeisanintegerorsomenumbGerthatcanbeGrepresentedexactlyin xedpGointarithmeticasamultipleof 멳1ß&fe?655365.?Otherwise,݄errorwillaccumulateGandUUtheloGopindexmightnotreachtheexpGectedterminationvqalue.qF*orinstance,޲for?i=0step.1until1: showi;endfor5T@PGAUUUser'sManualforMetaPost!í53@PGshowsUUtenivqaluesthelastofwhichis0.90005.!GTheFstandardwayFofavoidFtheproblemsassoGciatedwithnon-integerstepsizesistoiterateover Ginteger$vqaluesandthenmultiplybyascalefactorwhenusingtheloGopindexaswasdoneinFiguresG2UUand40.!GAlternatively*,thevqaluestoiterateovercanbGegivenexplicitly*./\AnysequenceofzeroormoreGexpressions#separatedbycommascanbGeusedinplaceofa?stepbuptoc.I In#fact,theexpressionsGneedUUnotallbGethesametypeandtheyneednothaveUUknownvqalues.qThus\gfor?t=3.14,2.78,(a,2a),"hello": showa;endforGshowsUUthefourvqalueslisted.!GNoteXpthattheloGopbodyintheaboveXpexampleisastatementfollowedbyasemicolon.{Itis GcommonBforthebGodyBofaloGoptobeoneormorestatements,Lbutthisneednotbethecase.ÏAGloGopHislikeamacrode nitionfollowedbycallstothemacro.jTheloGopbodycanbevirtuallyanyGsequenceUUoftokensaslongastheymakesensetogether.qThus,the(ridiculous)statement\M`draw?forp=(3,1),(6,2),(7,5),(4,6),(1,3): p--endforcycle;GisUUequivqalentto r draw?(3,1)--(6,2)--(7,5)--(4,6)--(1,3)--cycle;荑G(SeeUUFigure18foramorerealisticexampleofthis.)!GIfcaloGopislikeamacrode nition,theloopindexislikeanexprparameter.TItcanrepresentanyGvqalue,8but1itisnotavariableanditcannotbGechangedbyanassignmentstatement.eInordertodoGthat,youneedaforsuffixesloGop.oAforsuffixesloopisalotlikeaforloop,excepttheloopGindexUUbGehaveslikeasuxparameter.qThesyntaxis\^},forsuffixes粶hsymbGolicUUtokenAU_iײ=|hsuxUUlist'[i :mhloGopUUtext'qζi7endforGwhereahsuxlistiisacomma-separatedlistofsuxes.Ifsomeofthesuxesarehemptyi,the GhloGopUUtextigetsexecutedwiththeloopindexparametersettotheemptysux.!GAUUgoGodexampleofaforsuffixesloopisthede nitionofthedotlabelsmacro:􍍟G] vardef?dotlabels@#(textt)=b`forsuffixes?$=t:dotlabel@#(str$,z$);endfor enddef;GThisshouldmakeitclearwhytheparametertodotlabelshastobGeacomma-separatedlistGofsuxes.Mostmacrosthatacceptvqariable-lengthcomma-separatedlistsusetheminfororGforsuffixesUUloGopsinthisfashionasvqaluestoiterateover.!GWhenUUtherearenovqaluestoiterateover,UUyoucanuseaforeverloGop:\ٙforeverљ:؄)hloGopUUtext'qζi gendforGT*oUUterminatesuchaloGopwhenabooleanconditionbecomestrue,useanexitclause:exitif篶hbGooleanUUexpressionRai%.;GWhenFtheMetaPostinterpreterencountersanexitclause,#itevqaluatesthehbGooleanFexpressioniand GexitspthecurrentloGopiftheexpressionistrue.sIfitismoreconvenienttoexittheloGopwhenanGexpressionUUbGecomesfalse,usetheprede nedmacroexitunless.!GThusUUMetaPost'sversionofa"V cmbx10whileloGopis\\forever: exitunlessǠhbGooleanUUexpressionRai!};(ghloGopUUtext'qζiYK=endfor6àT@PGAUUUser'sManualforMetaPost!í54@PGTheexitclausecouldequallywellcomejustbGeforeendfororanywhereinthehloGoptexti.Infact GanyUUfor,forever,orforsuffixesloGopcancontainanynumbGerofexitclauses.5!GThezsummaryofloGopsyntaxshowninFigure47doGesnotmentionexitclausesexplicitlybGecauseGahloGoptexticanbevirtuallyanysequenceoftokens.O8TheonlyrestrictionisthatahloGoptextimustGbGem{balancedwithrespecttoforandendfor.9OfcoursethisbalancingprocesstreatsforsuffixesGandUUforeverjustlikefor. &r99ThloGopviV!hloGopUUheader2yi=j:DUThloGopUUtext'qζis@endfor9ThloGopUUheader2yiw!forhsymbGolicUUtokenAU_iLqͲ=S\rhprogression1?iPrnjforhsymbGolicUUtokenAU_iLqͲ=S\rhforUUlist˶iPrnjforsuffixeshsymbGolicUUtokenAU_iLqͲ=S\rhsuxUUlist'[iPrnjforever9Thprogression1?iuG!hnumericUUexpressionRжi_*uptohnumericUUexpressionRжiPrnjhnumericUUexpressionRжi_*downtohnumericUUexpressionRжiPrnjhnumericUUexpressionRжi_*stephnumericUUexpressionRжi^>untilhnumericUUexpressionRжi9ThforUUlist˶i`U!hexpression,wi:1jhforUUlist˶i'@,.*hexpression,wi9ThsuxUUlist'[il!hsuxvi$qjhsuxUUlist'[i2c,9N6hsuxviGFigureUU47:qThesyntaxforloGops*)G113/MakingBo=xesPGThis{sectiondescribGesauxiliarymacrosnotincludedinPlainMetaPostthatmakeitconvenienttoGdoXthingsthatpicisgoGodXat[3@].|WhatfollowsisadescriptionofhowtousethemacroscontainedGinqthe leboxes.mp.eThis leisincludedinaspGecialdirectoryreservedforMetaPostmacrosandGsuppGortNsoftware^10 ֭andcanbGeaccessedbygivingtheMetaPostcommandinput?boxesbGeforeanyG guresUUthatusethebGoxmakingmacros.qThesyntaxfortheinputcommandiscNinput9zh leUUname'q̶iGwherena nal\.mp"canbGeomittedfromthe lename.ZTheinputcommandlooks rstinthe GcurrentdirectoryandtheninthespGecialmacrodirectory*.{UsersinterestedinwritingmacrosmayGwantUUtoloGokattheboxes.mp leinthisdirectory*.!bG11.17GRectangularBoxes6GTheUUmainideaofthebGox-makingmacrosisthatoneshouldsaycd3boxit:kAhsuxviNղ(ݎҶhpictureUUexpressionN%i4)GwherethehsuxidoGesnotstartwithasubscript.^11 Thiscreatespairvqariableshsuxi.c,϶hsuxi.n, Ghsuxi.e,ݳ:::othatmcanthenbGeusedforpositioningthepicturebeforedrawingitwithaseparateGcommandUUsuchas2vdrawboxed(XhsuxUUlist'[iNѲ)ύGTherZargumenttodrawboxedshouldbGeacomma-separatedlistofboxnames,ywhereaboxnameisGaUUhsuxiwithwhichboxithasbGeencalled.Gffr J=w-:10LܴTheXnameofthisdirectoryislikÎelytobw-:11LܴSomeXearlyvÎersionsoftheb>".In_thiscasethexcoGordinateofz1isjusttheunknownvqariablex1,!sotheinterpreterprintsGtheUUvqariablenamex1justasitwouldifitweretoldto\show?x1"atthispGoint.ƍ69Ў9l>>?x1l!?Undefinedxcoordinatehasbeenreplacedby0.lР{l--->{ curl1}..{curl1}ll.17?drawz1-- z2;l?H FigureUU53:qAnexampleofanerrormessage.9!GThe8contextlistingmayseemalittleconfusingat rst,)>butitreallyjustgivesafewlinesoftextGshowingvfhowmuchofeachlinehasbGeenreadsofar.EachlineofinputisprintedontwolineslikeGthis:xNҶhdescriptor+q̶iT*extUUreadsofarlT*extUUyettobGereadGThe9hdescriptoriidenti estheinputsource.ItiseitheralinenumbGerlike\l.17"forline17of Gthecurrent le;oritcanbGeamacronamefollowedby\->";oritisadescriptivephraseinangleGbrackets.lThus,ItheFmeaningofthecontextlistinginFigure53isthattheinterpreterhasjustreadGlinec17oftheinput leupto\--,"theexpansionofthe--macrohasjuststarted,andtheinitialG\{"UUhasbGeenreinsertedtoallowforuserinputbeforescanningthistoken.!GAmongUUthepGossibleresponsestoa?qǭpromptarethefollowing:Gx# terminatesUUtherunsothatyoucan xyouinput leandstartover.GhtӭprintsUUahelpmessagefollowedbyanother?qǭprompt.Ghreturni>֕causesUUtheinterpretertoproGceedasbestitcan.G?~printsUUalistingoftheoptionsavqailable,followedbyanother?qǭprompt.!GErrortymessagesandrespGonsestoshowcommandsarealsowrittenintothetranscript lewhose Gname isobtainedfromthenameofthemaininput lebychanging\.mp"to\.log".Whenthe=GT@PGAUUUser'sManualforMetaPost!í61@PGinternal3vqariabletracingonlineisatitsdefaultvalueofzero,j~someshowcommandsprinttheir GresultsUUinfulldetailonlyintranscript le.!GOnlyonetypGeofshowcommandhasbeendiscussedsofar:?+=+GApplyingUUshowtokentoavqariableoravardefmacroyields+[>ȫUhtoken㒶iV=variable!GT*ogetmoreinformationabGoutavqariable,8useshowvariableinsteadofshowtoken.OTheargu- Gment[toshowvariableisacomma-separatedlistofsymbGolictokensandtheresultisadescriptionGofߍallthevqariableswhosenamesbGeginwithoneofthelistedtokens.pThisevenworksforvardefGmacros.qF*orUUexample,showvariable?zyields_z@#=macro:->begingroup(x(SUFFIX2),y(SUFFIX2))endgroup!GThere9isalsoashowdependenciescommandthattakesnoargumentsandprintsalistofallGdep}'endentvqariablesandhowthelinearequationsgivensofarmakethemdepGendonothervqariables.GThusUUafterɲz2-z1=(5,10);?z1+z2=(a,b);Gshowdependencies printswhatisshowninFigure54.`MThiscouldbGeusefulinansweringaquestionGlike\WhatdoGesitmean`!?Undefinedxcoordinate?'XIIthoughttheequationsgivensofarwouldGdetermineUUx1."SqǍx2=0.5a+2.5y2=0.5b+5x1=0.5a-2.5y1=0.5b-5+rA5FigureUU54:qTheresultofz2-z1=(5,10);?z1+z2=(a,b);showdependencies;!GWhenYallelsefails,theprede nedmacrotracingallcausestheinterpretertoprintadetailedGlistingt:ofeverythingitisdoing.vSincethetracinginformationisoftenquitevoluminous,{itmaybGeGbGetterytousetheloggingallmacrothatproducesthesameinformationbutonlywritesitintheGtranscriptUU le.qThereisalsoatracingnonemacrothatturnso allthetracingoutput.!GT*racingoutputiscontrolledbythesetofinternalvqariablessummarizedbGelow.xWhenanyoneGof{thesevqariablesisgivenapGositivevqalue,EthecorrespGondingformoftracingisturnedon.:HereisGtheUUsetoftracingvqariablesandwhathappGenswheneachofthemispositive:GtracingcapsuleseshowsUUthevqaluesoftempGoraryquantities(capsules)whentheybGecomeknown.Gtracingchoices`showsUUtheBGeziercontrolpGointsofeachnewpathwhentheyarechosen.GtracingcommandseshowsYthecommandsbGeforetheyareperformed.A8settingy̱>s1alsoshowsif +Gtests)andloGopsbeforetheyareexpanded;asettingQ$>( 2showsalgebraicoperationsbefore+GtheyUUarepGerformed.>TXT@PGAUUUser'sManualforMetaPost!í62@PGtracingequationskshowsUUeachvqariablewhenitbGecomesknown.GtracinglostcharskwarnsabGoutcharactersomittedfromapicturebGecausetheyarenotinthefont +GbGeingUUusedtotypesetlabels.Gtracingmacros[Q showsUUmacrosbGeforetheyareexpanded.Gtracingoutput[Q showsUUpicturesastheyarebGeingshippedoutasPostScript les.GtracingrestoreseshowssymbGolsandinternalvqariablesastheyarebGeingrestoredattheendofa+Ggroup.GtracingspecsV#showsUUtheoutlinesgeneratedwhendrawingwithapGolygonalpen.GtracingstatsV#showsinthetranscript leattheendofthejobhowmanyoftheMetaPostinter-+Gpreter'sUUlimitedrescourceswereused.'čGAc=knowledgementGIwould"liketothankDonKnuthformakingthisworkpGossiblebydevelopingMETAF9ONTandGplacingitinthepublicdomain.^Iamalsoindebtedtohimforhelpfulsuggestions,'particularlywithGregardUUtothetreatmentofincludedTU>'ExXmaterial.GA/%ReferenceMan=ualGT*ables3{11summarizethebuilt-infeaturesofPlainMetapGostandthefeaturesde nedintheGboxes.mp-macro le.NAsexplainedinSection11,theboxes.mpmacro leisnotautomaticallyGpreloadedUUandthemacrosde nedtherearenotaccessibleuntilyouaskforthemviathecommandinput?boxes!GF*eatures!xthatdepGendonboxes.mparemarkedbyz symbGols.1F*eaturesfromthePlainmacroGpackqagearemarkedaremarkedbyy ửsymbGols,ФandMetaPostprimitivesarenotmarkedbyz ửory).GThebdistinctionbGetweenbprimitivesandplainmacroscanbGeignoredbythecasualuser,BbutitisGimpGortantvtoremembGerthatfeaturesmarkedbyaz canonlybGeusedafterreadingintheboxes.mpGmacroUU le.!GTheggtablesinthisappGendixgivethenameeachfeature,kthepagenumbGerwhereitisexplained,Gandqashortdescription.YAfewfeaturesarenotexplainedelsewhereandhaveqnopagenumbGerGlisted.Thesec>featuresexistprimarilyforcompatibilitywithMETAF9ONTbandareintendedtobGeGself-explanatory*.CertainotherfeaturesfromMETAF9ONTareomittedentirelybGecausetheyareofGlimitedl!interesttotheMetaPostusersand/orwouldrequirelongexplanations.,AlloftheseareGdoGcumentedUUinTheMETAF9ONTb}'ookUU[4@]asUUexplainedinAppendixB.!GT*ableZ3listsinternalvqariablesthattakeonnumericvqalues.T*able4listsprede nedvariablesofGothertypGes.9=T*able5listsprede nedconstants.9=SomeoftheseareimplementedasvqariableswhoseGvqaluesUUareintendedtobGeleftunchanged.!GT*ablesH6{9summarizeMetaPostopGeratorsandlistthepossibleargumentandresulttypGesforeachGone.;A\{"entryfortheleftargumentindicatesaunaryopGerator;h\{"entriesforbGothargumentsGindicate`!anullaryopGerator.+Operators`!thattakesuxparametersarenotlistedinthesetablesGbGecauseUUtheyaretreatedas\function-likemacros".?baT@PGAUUUser'sManualforMetaPost!í63@P!GThenlasttwontablesareT*able10forcommandsandTable11macrosthatbGehavenlikefunctions GorproGcedures.kSuchmacrostakeparenthesizedargumentlistsand/orsuxparameters,returningGeitheravqaluewhosetypGeislistedinthetable,ornothing.P9ThelattercaseisformacrosthatbehaveGlikeUUproGcedures.qTheirreturnvqaluesarelistedas\{".!GThem[ guresinthisappGendixpresentthesyntaxoftheMetaPostlanguagestartingwithexpres-GsionsinFigures55{57.3AlthoughtheproGductionssometimesspecifytypesforexpressions,primaries,Gsecondaries,andUtertiaries,noattemptismadetogiveseparatesyntaxesforhnumericexpressioni,Ghpair/expressioni,eqetc.ThesimplicityoftheproGductionsinFigure58isduetothislackoftypGeGinformation.qTypGeUUinformationcanbefoundinT*ables3{11.!GFigures*)59and60givethesyntaxforMetaPostprograms,2includingstatementsandcommands.GThey0donotmentionloGopsandiftestsbecausetheseconstructionsdonotbehave0likestatements.GTheUsyntaxgiveninFigures55{11appliestotheresultofexpandingallconditionalsandloGops.GConditionalsandloGopsdohaveasyntax,buttheydealwithalmostarbitrarysequencesoftokens.GFigurep61spGeci esconditionalsintermsofhbalancedtokensiandloopsintermsofhlooptexti,GwhereٟhbalancedtokensiisanysequenceoftokensbalancedwithrespGecttoifandfi,andhloopGtextiUUisasequenceoftokensbalancedwithrespGecttofor,forsuffixes,forever,andendfor.@q(T@PGAUUUser'sManualforMetaPost!í64k)3BzT*ableUU3:qInternalvqariableswithnumericvqalues ^@#ff?fd͟ ff#)%fdName_̝ ff͟fdPageł ffsWfdExplanation ffff?ffff?롍ͤ ff͟fdy >fdahangle0롄 ffp37͟ ffangleUUforarrowheadsindegrees(default:q45)R ffff?롍ͤ ff͟fdy >fdahlength+Z ffp37͟ ffsizeUUofarrowheads(default:q4bp)[ ffff?롍ͤ ff͟fdy >fdbboxmargin ffp22͟ ffextraUUspaceallowedUUbybbox(default2bp)^ ffff?롍ͤ ff͟fdcharcode/̵ ffp41͟ fftheUUnumbGerofthenextcharactertobGeoutputJb# ffff?롍ͤ ff͟fdz >fdcircmargin ffp58͟ ffclearanceUUaroundcontentsUUofacircularorovqalbGox8Ű ffff?롍ͤ ff͟fddayJ ffu{͟ fftheUUcurrentdayofthemonth ffff?롍ͤ ff͟fdz >fddefaultdx& ffp55͟ ffusualUUhorizontalspacearoundbGoxcontents(default3bp) ffff?롍ͤ ff͟fdz >fddefaultdy& ffp55͟ ffusualUUverticalspacearoundbGoxcontents(default3bp)("% ffff?롍ͤ ff͟fdy >fddefaultpen ffp39͟ ffnumericUUindexusedbypickuptoselectdefaultpGen4 ffff?롍ͤ ff͟fdy >fddefaultscaleZ ffp20͟ fffontUUscalefactorforlabGelstrings(default1)Vx ffff?롍ͤ ff͟fdy >fdlabeloffset ffp19͟ ffo setUUdistanceforlabGels(default3bp)pb- ffff?롍ͤ ff͟fdlinecap5 ffp35͟ ff0UUforbutt,1forround,2forsquarezS ffff?롍ͤ ff͟fdlinejoin/̵ ffp35͟ ff0UUformitered,1forround,2forbGeveledg~ ffff?롍ͤ ff͟fdmiterlimit%L ffp35͟ ffcontrolsUUmiterlengthasinPostScriptqӟ ffff?롍ͤ ff͟fdmonth? ffu{͟ fftheUUcurrentmonth(e.g,3March)yS ffff?롍ͤ ff͟fdpausing5 ffu{͟ ffͱ>0UUtodisplaylinesontheterminalbGeforetheyareread"' ffff?롍ͤ ff͟fdprologues* ffp22͟ ffͱ>0UUtooutputconformingPostScriptusingbuilt-infontsv ffff?롍ͤ ff͟fdshowstopping ffu{͟ ffͱ>0UUtostopaftereachshowcommandm͟ ffff?롍ͤ ff͟fdtimeD̩ ffu{͟ fftheUUnumbGerofminutespastmidnightwhenthisjobstarted ffff?롍ͤ ff͟fdtracingcapsules ʡ ffp61͟ ffͱ>0UUtoshowcapsulestoGo> ffff?롍ͤ ff͟fdtracingchoicesLǡ ffp61͟ ffͱ>0UUtoshowthecontrolpGointschosenforpathsC> ffff?롍ͤ ff͟fdtracingcommands ʡ ffp61͟ ffͱ>0UUtoshowcommandsandopGerationsastheyareperformed͟ ffff?롍ͤ ff͟fdtracingequations ffp62͟ ffͱ>0UUtoshoweachvqariablewhenitbGecomesknown7)I ffff?롍ͤ ff͟fdtracinglostchars ffp62͟ ffͱ>0UUtoshowcharactersthataren'tinfontY ffff?롍ͤ ff͟fdtracingmacrosġ ffp62͟ ffͱ>0UUtoshowmacrosbGeforetheyareexpandedJ ffff?롍ͤ ff͟fdtracingonlineġ ffp12͟ ffͱ>0UUtoshowlongdiagnosticsontheterminalN ffff?롍ͤ ff͟fdtracingoutputġ ffp62͟ ffͱ>0UUtoshowdigitizededgesastheyareoutputG7 ffff?롍ͤ ff͟fdtracingrestores ʡ ffp62͟ ffͱ>0UUtoshowwhenavqariableorinternalisrestored5 ؟ ffff?롍ͤ ff͟fdtracingspecs ffp62͟ ffͱ>0UUtoshowpathsubGdivisionwhenusingapolygonalapen i< ffff?롍ͤ ff͟fdtracingstats ffp62͟ ffͱ>0UUtoshowmemoryusageatendofjobab. ffff?롍ͤ ff͟fdtracingtitlesġ ffu{͟ ffͱ>0UUtoshowtitlesonlinewhentheyappGearVٟ ffff?롍ͤ ff͟fdtruecorners ffp23͟ ffͱ>0UUtomakellcorneretc.qignoresetboundsKw ffff?롍ͤ ff͟fdwarningcheck ffp12͟ ffcontrolsUUerrormessagewhenvqariablevalueislarge8 ffff?롍ͤ ff͟fdyearD̩ ffu{͟ fftheUUcurrentyear(e.g.,1992)~ ffff?뎎^AxT@PGAUUUser'sManualforMetaPost!í65 xT*ableUU4:qOtherPrede nedVariables @+Qhffjfd͟ ff " fdNameYj ff xfdTypGeSŸ ff͟fdPageL ff^)HfdExplanation ffffjffffjͤ ff͟fdy >fdbackground ff_color> ff25͟ ffColorUUforunfillandundraw(usuallywhite)&)o ffffjͤ ff͟fdy >fdcurrentpen ff_pGenΟ ff40͟ ffLastUUpGenpickedUUup(forusebythedrawcommand)  ffffjͤ ff͟fdy >fdcurrentpicture͡ ff_picture͟ ff40͟ ffAccumulateUUresultsofdrawandfillcommands> ffffjͤ ff͟fdy >fdcuttings%L ff_pathb" ff28͟ ffsubpathUUcuto bylastcutbeforeorcutafterE ffffjͤ ff͟fdy >fddefaultfontġ ff_string L͟ ff19͟ ffF*ontUUusedbylabGelcommandsfortypGesettingstrings͟ ffffjͤ ff͟fdy >fdextraEff&fǫbeginfigE ff_string L͟ ff81͟ ffCommandsUUforbeginfigtoscan[K ffffjͤ ff͟fdy >fdextraEff&fǫendfig ff_string L͟ ff81͟ ffCommandsUUforendfigtoscanf"E ffffj;BT@PGAUUUser'sManualforMetaPost!í66RkBYT*ableUU5:qPrede nedConstants ^"+ffj/fd͟ ff fdNameT~m fffdTypGe ff͟fdPageˤ ffW|fdExplanation ffffj/ffffj/ͤ ff͟fdy >fdbeveled%L ffZnumeric B ffF35͟ ffFlinejoinUUvqalueforbGeveledjoins[2]Bh ffffj/ͤ ff͟fdy >fdblack/̵ ffZcolorE ffF12͟ ffFEquivqalentUUto(0,0,0)| ffffj/ͤ ff͟fdy >fdblue5 ffZcolorE ffF12͟ ffFEquivqalentUUto(0,0,1)| ffffj/ͤ ff͟fdy >fdbp? ffZnumeric B ffF2͟ ffFOneUUPostScriptpGointinbpunits[1]AF ffffj/ͤ ff͟fdy >fdbutt5 ffZnumeric B ffF35͟ ffFlinecapUUvqalueforbuttendcaps[0]CY ffffj/ͤ ff͟fdy >fdcc? ffZnumeric B ffF{͟ ffFOneUUciceroinbpunits[12.79213]O ffffj/ͤ ff͟fdy >fdcm? ffZnumeric B ffF2͟ ffFOneUUcentimeterinbpunits[28.34645]:) ffffj/ͤ ff͟fdy >fddd? ffZnumeric B ffF{͟ ffFOneUUdidotpGointinbpunits[1.06601]<  ffffj/ͤ ff͟fdy >fdditto/̵ ffZstringS ffF{͟ ffFTheUU"characterasastringoflength16(ԟ ffffj/ͤ ff͟fdy >fddown5 ffZpair)C ffF6͟ ffFDownwardUUdirectionvector(0;1)G ffffj/r̍ͤ hff͟fdy >fdepsilon%L hffZnumeric B hffF{͟ hffFSmallestUUpGositiveMetaPostnumbGer[ ,133&fe?65536T]$b` hffffj/ͤ ff͟fdy >fdevenly* ffZpicture ffF32͟ ffFDashUUpatternforequallengthdashes=/ ffffj/ͤ ff͟fdfalse4>| ffZbGoolean ffF13͟ ffFTheUUbGooleanvqaluefalsewq ffffj/ͤ ff͟fdy >fdfullcircleġ ffZpathiB ffF23͟ ffFCircleUUofdiameter1centeredon(0;0)8( ffffj/ͤ ff͟fdy >fdgreen/̵ ffZcolorE ffF12͟ ffFEquivqalentUUto(0,1,0)| ffffj/ͤ ff͟fdy >fdhalfcircleġ ffZpathiB ffF23͟ ffFUppGerUUhalfofacircleofdiameter1D ffffj/ͤ ff͟fdy >fdidentity ffZtransform͟ ffF31͟ ffFIdentityUUtransformationxS{ ffffj/ͤ ff͟fdy >fdin? ffZnumeric B ffF2͟ ffFOneUUinchinbpunits[72]rS ffffj/ͤ ff͟fdy >fdinfinity ffZnumeric B ffF28͟ ffFLargeUUpGositivevqalue[4095.99998]Nu ffffj/ͤ ff͟fdy >fdleft5 ffZpair)C ffF6͟ ffFLeftwardUUdirection(1;0)m! ffffj/ͤ ff͟fdy >fdmitered%L ffZnumeric B ffF35͟ ffFlinejoinUUvqalueformiteredjoins[0]Ax ffffj/ͤ ff͟fdy >fdmm? ffZnumeric B ffF2͟ ffFOneUUmillimeterinbpunits[2.83464]A! ffffj/ͤ ff͟fdnullpicture ffZpicture ffF14͟ ffFEmptyUUpictureo ffffj/ͤ ff͟fdy >fdorigin* ffZpair)C ffF{͟ ffFTheUUpair(0;0) ffffj/ͤ ff͟fdy >fdpc? ffZnumeric B ffF{͟ ffFOneUUpicainbpunits[11.95517]VӀ ffffj/ͤ ff͟fdpencircle> ffZpGen  ffF38͟ ffFCircularUUpGenofdiameter1j( ffffj/ͤ ff͟fdy >fdpensquare ffZpGen  ffF39͟ ffFsquareUUpGenofheight1andwidth1E@ ffffj/ͤ ff͟fdy >fdpt? ffZnumeric B ffF2͟ ffFOneUUprinter'spGointinbpunits[0.99626].& ffffj/ͤ ff͟fdy >fdquartercircle͡ ffZpathiB ffF{͟ ffFFirstUUquadrantofacircleofdiameter13[ ffffj/ͤ ff͟fdy >fdred:L ffZcolorE ffF12͟ ffFEquivqalentUUto(1,0,0)| ffffj/ͤ ff͟fdy >fdright/̵ ffZpair)C ffF6͟ ffFRightwardUUdirection(1;0)n>+ ffffj/ͤ ff͟fdy >fdrounded%L ffZnumeric B ffF35͟ ffFlinecapUUandlinejoinvqalueforroundjoins ff ͟ ffTK: ff ff˟ ffFandUUendcaps[1]I ffffj/ͤ ff͟fdy >fdsquared%L ffZnumeric B ffF35͟ ffFlinecapUUvqalueforsquareendcaps[2]:Z ffffj/ͤ ff͟fdtrue9~y ffZbGoolean ffF13͟ ffFTheUUbGooleanvqaluetruevS ffffj/ͤ ff͟fdy >fdunitsquareġ ffZpathiB ffF{͟ ffFTheUUpath(0,0)--(1,0)--(1,1)--(0,1)--cycle͟ ffffj/ͤ ff͟fdy >fdup? ffZpair)C ffF6͟ ffFUpwardUUdirection(0;1)y~, ffffj/ͤ ff͟fdy >fdwhite/̵ ffZcolorE ffF12͟ ffFEquivqalentUUto(1,1,1)| ffffj/ͤ ff͟fdy >fdwithdots ffZpicture ffF32͟ ffFDashUUpatternthatproGducesdottedlines/= ffffj/^CT@PGAUUUser'sManualforMetaPost!í67P)T*ableUU6:qOpGerators(Part1) :n荍}ffbfd͟ ff0fdName;  ff{fdArgument/resultUUtypGes ff͟fdPage ff?嵟fdExplanation ff;?ff͟ ff: ffA?Leftŵ ffw^Right  ffxResult  ff ffb. ffffbffffbͤ ff͟fd&/̵ ffA?stringS ffw^stringS ffxstringwx ff114͟ ff1Concatenation|worksUUforpathsl2`&r]rrifx ff ͟ ff: ffA?pathiB ffw^pathiB ffxpath͟ ff ff1rrstartsUUexactlywherethelends j ffffbͤ ff͟fd*/̵ ffA?numeric B ffw^colorE ffxcolori@ ff113͟ ff1Multiplicationq> ff ͟ ff: ffq+ ffw^numeric B ffxnumeric͟ ff ffb. ff͟ ff: ffq+ ffw^pair)C ffxpairLΟ ff ffb. ffffbͤ ff͟fd*/̵ ffA?colorE ffw^numeric B ffxcolori@ ff113͟ ff1Multiplicationq> ff͟ ff: ffA?numeric B ffE ffxnumeric͟ ff ffb. ff͟ ff: ffA?pair)C ffE ffxpairLΟ ff ffb. ffffbͤ ff͟fd*** ffA?numeric B ffw^numeric B ffxnumeric͟ ff113͟ ff1ExpGonentiationl  ffffbͤ ff͟fd+/̵ ffA?colorE ffw^colorE ffxcolori@ ff113͟ ff1Addition ff ͟ ff: ffA?numeric B ffw^numeric B ffxnumeric͟ ff ffb. ff͟ ff: ffA?pair)C ffw^pair)C ffxpairLΟ ff ffb. ffffb "ͤ ff͟fd++* ffA?numeric B ffw^numeric B ffxnumeric͟ ff114͟ ff1PythagoreanUUadditionp fe*UUl2`r2糭+8rGr2PLϟ ffffbͤ ff͟fd+-+%L ffA?numeric B ffw^numeric B ffxnumeric͟ ff114͟ ff1PythagoreanUUsubtractionp fe*UUl2`r2糶8rGr2B$ ffffbfdͤ ff͟fd-/̵ ffA?colorE ffw^colorE ffxcolori@ ff113͟ ff1Subtraction| ן ff ͟ ff: ffA?numeric B ffw^numeric B ffxnumeric͟ ff ffb. ff͟ ff: ffA?pair)C ffw^pair)C ffxpairLΟ ff ffb. ffffbͤ ff͟fd-/̵ ffA?{+iE ffw^colorE ffxcolori@ ff113͟ ff1Negation ff͟ ff: ffq+ ffw^numeric B ffxnumeric͟ ff ffb. ff͟ ff: ffq+ ffw^pair)C ffxpairLΟ ff ffb. ffffbͤ ff͟fd//̵ ffA?colorE ffw^numeric B ffxcolori@ ff113͟ ff1Divisionpg ff͟ ff: ffA?numeric B ffE ffxnumeric͟ ff ffb. ff͟ ff: ffA?pair)C ffE ffxpairLΟ ff ffb. ffffbͤ ff͟fd<?=> ffA?stringS ffw^stringS ffxbGoolean< ff113͟ ff1ComparisonUUopGeratorsN  ffͤ ff͟fd<=?>= ffA?numeric B ffw^numeric B ff ff ffb. ffͤ ff͟fd<>* ffA?pair)C ffw^pair)C ff ff ffb. ff͟ ff: ffA?colorE ffw^colorE ff ff ffb. ff͟ ff: ffA?transform͟ ffw^transform͟ ff ff ffb. ffffbͤ ff͟fdy >fdabs ffA?{+iE ffw^numeric B ffxnumeric͟ ff115͟ ff1AbsoluteUUvqaluene ff͟ ff: ffq+ ffw^pair)C ff ff ffb. ffffbͤ ff͟fdand%L ffA?bGoolean ffw^bGoolean ffxbGoolean< ff113͟ ff1LogicalUUand|~ ffffbͤ ff͟fdangle ffA?{+iE ffw^pair)C ffxnumeric͟ ff115͟ ff12argumentUUarctangent(indegrees)w ffffbͤ ff͟fdarclength ffA?{+iE ffw^pathiB ffxnumeric͟ ff130͟ ff1ArcUUlengthofapathU ffffbͤ ff͟fdarctimeLǡ ffA?numeric B ffw^pathiB ffxnumeric͟ ff130͟ ff1TimeUUonapathwherearclengthfrom b" ff ͤ ff͟fdof* ffq+ ffE ff ff ff1theUUstartreachesagivenvqalue*> ffffbͤ ff͟fdASCII ffA?{+iE ffw^stringS ffxnumeric͟ ff1{͟ ff1ASCIGIUUvqalueof rstcharacterinstring͟ ffffbͤ ff͟fdy >fdbbox ffA?{+iE ffw^picture ffxpath͟ ff122͟ ff1AUUrectangularpathforthebGounding ff ͟ ff: ffq+ ffw^pathiB ff ff ff1bGox[ ff͟ ff: ffq+ ffw^pGen  ff ff ffb. ffffbͤ ff͟fdbluepart ʡ ffA?{+iE ffw^colorE ffxnumeric͟ ff116͟ ff1ExtractsUUthethirdcompGonent,@ ffffbͤ ff͟fdbooleanLǡ ffA?{+iE ffw^any  ffxbGoolean< ff116͟ ff1IsUUtheexpressionoftypGeboolean?b# ffffbͤ ff͟fdbot%L ffA?{+iE ffw^numeric B ffxnumeric͟ ff138͟ ff1BottomUUofcurrentpGenwhencentered Ο ff ͟ ff: ffq+ ffw^pair)C ffxpairLΟ ff ff1atUUthegivencoGordinate(s)> џ ffffbͤ ff͟fdy >fdceiling ffA?{+iE ffw^numeric B ffxnumeric͟ ff115͟ ff1LeastUUintegergreaterthanorequalto p] ffffbͤ ff͟fdy >fdcenter ffA?{+iE ffw^picture ffxpairLΟ ff122͟ ff1CenterUUofthebGoundingbox6 ϟ ff ͟ ff: ffq+ ffw^pathiB ff ff ffb. ff͟ ff: ffq+ ffw^pGen  ff ff ffb. ffffb5n莎DT@PGAUUUser'sManualforMetaPost!í68P)T*ableUU7:qOpGerators(Part2) 5bhmffwfd͟ fffdNameDv ff{fdArgument/resultUUtypGesk ff͟fdPageQ ff<]fdExplanation ffDff͟ ffDC ffJLeft@ ffyRight  ffN%Resultp` ffQ ffC ffffwffffwͤ ff͟fdchar) ffJ{#П ffynumeric B ffN%stringS ff22͟ ffCharacterUUwithagivenASCIGIcode ffffwͤ ff͟fdcolor$~ ffJ{#П ffyany  ffN%bGoolean ff16͟ ffIsUUtheexpressionoftypGecolor? x ffffwͤ ff͟fdcosd) ffJ{#П ffynumeric B ffN%numeric B ff15͟ ffCosineUUofangleindegrees7 ffffwͤ ff͟fdy >fdcutafterLǡ ffJpath͟ ffypathiB ffN%pathiB ff28͟ ffLeftUUargumentwithpartafterthe,ɟ ff ͟ ffDC ffs~z ff ffk ffQ ffintersectionUUdroppGedOW{ ffffwͤ ff͟fdy >fdcutbefore ʡ ffJpath͟ ffypathiB ffN%pathiB ff28͟ ffLeftUUargumentwithpartbGeforethe: ff ͟ ffDC ffs~z ff ffk ffQ ffintersectionUUdroppGedOW{ ffffwͤ ff͟fdcycle$~ ffJ{#П ffypathiB ffN%bGoolean ff15͟ ffDeterminesUUwhetherapathiscyclic ͟ ffffwͤ ff͟fddecimal ffJ{#П ffynumeric B ffN%stringS ff15͟ ffTheUUdecimalrepresentation1 ffffwͤ ff͟fdy >fddir* ffJ{#П ffynumeric B ffN%pair)C ff6͟ ff(cos7G;sinn)UUgivenrindegrees$f ffffwͤ ff͟fdy >fddirection ʡ ffJnumeric͟ ffypathiB ffN%pair)C ff28͟ ffTheUUdirectionofapathatagivenB ff ͤ ff ʟfdof. ffs~z ff ffk ffQ ffㄭ`time'废 ffffwͤ ff͟fdy >fddirection-͡ ffJpairLΟ ffypathiB ffN%numeric B ff30͟ ffPointUUwhereapathhasagiven [ ff ͤ ff͟fdpoint?of ffs~z ff ffk ffQ ffㄭdirectionG ffffwͤ ff͟fddirection- > ffJpairLΟ ffypathiB ffN%numeric B ff28͟ ff`Time'UUwhenapathhasagiven! ff ͤ ff͟fdtime?of ffs~z ff ffk ffQ ffㄭdirectionG ffffwͤ ff͟fdy >fddiv* ffJnumeric͟ ffynumeric B ffN%numeric B ff{͟ ffIntegerUUdivisionbl2`=rGcL/ ffffwͤ ff͟fdy >fddotprodġ ffJpairLΟ ffypair)C ffN%numeric B ff13͟ ffvectorUUdotproGductV崟 ffffwͤ ff͟fdfloor$~ ffJ{#П ffynumeric B ffN%numeric B ff15͟ ffGreatestUUintegerlessthanorequalto͟ ffffwͤ ff͟fdfontsize ffJ{#П ffystringS ffN%numeric B ff20͟ ffTheUUpGointsizeofafontBW{ ffffwͤ ff͟fdgreenpart~ ffJ{#П ffycolorE ffN%numeric B ff16͟ ffExtractUUthesecondcompGonent#Y ffffwͤ ff͟fdhex. ffJ{#П ffystringS ffN%numeric B ff{͟ ffInterpretUUasahexadecimalnumbGer ffffwͤ ff͟fdinfont> ffJstringwx ffystringS ffN%picture ff22͟ ffTypGesetUUstringingivenfont/^ ffffwͤ ff͟fdy >fdintersec- ʡ ffJpath͟ ffypathiB ffN%pair)C ff27͟ ffAnUUintersectionpGointL B ff ͤ ff ʟfdtionpoint > ffs~z ff ffk ffQ ffC ffffwͤ ff͟fdintersec-~ ffJpath͟ ffypathiB ffN%pair)C ff27͟ ffTimesUU(tlȱ;trm)onpathslandr$ ff ͤ ff͟fdtiontimes~ ffs~z ff ffk ffQ ffㄭwhenUUthepathsintersect=B' ffffwͤ ff͟fdy >fdinverseġ ffJ{#П ffytransform͟ ffN%transform͟ ff31͟ ffInvertUUatransformationBB" ffffwͤ ff͟fdknown$~ ffJ{#П ffyany  ffN%bGoolean ff16͟ ffDoGesUUargumenthaveaknownvqalue? ; ffffwͤ ff͟fdlength> ffJ{#П ffypathiB ffN%numeric B ff28͟ ffNumbGerUUofarcsinapath:; ffffwͤ ff͟fdy >fdlft* ffJ{#П ffynumeric B ffN%numeric B ff38͟ ffLeftUUsideofcurrentpGenwhenits\ ff ͟ ffDC ffs~z ffypair)C ffN%pair)C ffQ ffcenterUUisatthegivencoGordinate(s) ffffwͤ ff͟fdllcorner ffJ{#П ffypicture ffN%pair)C ff22͟ ffLower-leftUUcornerofbGoundingbox: ff ͟ ffDC ffs~z ffypathiB ffk ffQ ffC ff͟ ffDC ffs~z ffypGen  ffk ffQ ffC ffffwͤ ff͟fdlrcorner ffJ{#П ffypicture ffN%pair)C ff22͟ ffLower-leftUUcornerofbGoundingbox: ff͟ ffDC ffs~z ffypathiB ffk ffQ ffC ff͟ ffDC ffs~z ffypGen  ffk ffQ ffC ffffwͤ ff͟fdmakepath ffJ{#П ffypGen  ffN%pathiB ff39͟ ffCyclicUUpathbGoundingthepenshape  ffffwͤ ff͟fdmakepen ffJ{#П ffypathiB ffN%pGen  ff39͟ ffAUUpGolygonalpenmadefromthe% ff ͟ ffDC ffs~z ff ffk ffQ ffconvexUUhullofthepathknots(< ffffwͤ ff͟fdmexp) ffJ{#П ffynumeric B ffN%numeric B ff{͟ ffTheUUfunctionexpt(x=256)fdmod* ffJ{#П ffynumeric B ffN%numeric B ff{͟ ffTheUUremainderfunctionlk@8rGbl2`=rcة ffffwͤ ff͟fdnormal- ffJ{#П ffy{+iE ffN%numeric B ff{͟ ffChoGoseUUarandomnumberUUwith!; ff ͤ ff͟fddeviate ffs~z ff ffk ffQ ffㄭmeanUU0andstandarddeviation1q ffffw0EނT@PGAUUUser'sManualforMetaPost!í69P)T*ableUU8:qOpGerators(Part3) 3`G׀ffxfd͟ ff -fdNameE ff{fdArgument/resultUUtypGesᅡ ff͟fdPage~ ff ff[Resultp` ff~ ffD ffffxffffxͤ ff͟fdnot/̵ ffK߭{+iE ff\WbGoolean< ff[bGoolean ff13͟ ffLogicalUUnegationa)F ffffxͤ ff͟fdnumeric ffK߭{+iE ff\Wany ff[bGoolean ff16͟ ffIsUUtheexpressionoftypGenumeric?LП ffffxͤ ff͟fdoct/̵ ffK߭{+iE ff\Wstringwx ff[numeric B ff{͟ ffInterpretUUastringasanoGctalnumbGerx ffffxͤ ff͟fdodd/̵ ffK߭{+iE ff\Wnumeric͟ ff[bGoolean ff{͟ ffIsUUtheclosestintegeroGddoreven?  ffffxͤ ff͟fdor5 ffK߭bGoolean ff\WbGoolean< ff[bGoolean ff13͟ ffLogicalUUinclusiveorT ffffxͤ ff͟fdpair* ffK߭{+iE ff\Wany ff[bGoolean ff16͟ ffIsUUtheexpressionoftypGepair?$џ ffffxͤ ff͟fdpath* ffK߭{+iE ff\Wany ff[bGoolean ff16͟ ffIsUUtheexpressionoftypGepath?" П ffffxͤ ff͟fdpen/̵ ffK߭{+iE ff\Wany ff[bGoolean ff16͟ ffIsUUtheexpressionoftypGepen?&7| ffffxͤ ff͟fdpenoffsetLǡ ffK߭pair)C ff\WpGeny ff[pair)C ff{͟ ffPointUUonthepGenfurthesttothe0] ff ͤ ff͟fdof5 ff|)% ff( ffᅡ ff~ ffrightUUofthegivendirection3_ ffffxͤ ff͟fdpicture ffK߭{+iE ff\Wany ff[bGoolean ff16͟ ffIsUUtheexpressionoftypGepicture?w{ ffffxͤ ff͟fdpoint?ofġ ffK߭numeric B ff\Wpath͟ ff[pair)C ff27͟ ffPointUUonapathgivenatimevqalue! ffffxͤ ff͟fdpostcontrol ffK߭numeric B ff\Wpath͟ ff[pair)C ff{͟ ffFirstUUBGeziercontrolpGointonpath~ ff ͤ ff͟fdof5 ff|)% ff( ffᅡ ff~ ffsegmentUUstartingatthegiventime ffffxͤ ff͟fdprecontrol ʡ ffK߭numeric B ff\Wpath͟ ff[pair)C ff{͟ ffLastUUBGeziercontrolpGointonpathwx ff ͤ ff͟fdof5 ff|)% ff( ffᅡ ff~ ffsegmentUUendingatthegiventime ffffxͤ ff͟fdredpart ffK߭{+iE ff\Wcolori@ ff[numeric B ff16͟ ffExtractUUthe rstcompGonent.ų ffffxͤ ff͟fdreverse ffK߭{+iE ff\Wpath͟ ff[pathiB ff37͟ ff`time'-reversedUUpathwithbGeginning  ff ͟ ffEYy ff|)% ff( ffᅡ ff~ ffswappGedUUwithendingLb ffffxͤ ff͟fdrotated ffK߭picture ff\Wnumeric͟ ff[picture ff30͟ ffRotateUUcountercloGckwiseagiven ff ͟ ffEYy ffKpathiB ff( ff[pathiB ff~ ffnumbGerUUofdegreesYiI ff͟ ffEYy ffKpair)C ff( ff[pair)C ff~ ffD ff͟ ffEYy ffKpGen  ff( ff[pGen  ff~ ffD ff͟ ffEYy ffKtransform͟ ff( ff[transform͟ ff~ ffD ffffxͤ ff͟fdy >fdround ffK߭{+iE ff\Wnumeric͟ ff[numeric B ff15͟ ffroundUUeachcompGonenttothenearest͟ ff͟ ffEYy ff|)% ff\WpairLΟ ff[pair)C ff~ ffinteger7 ffffxͤ ff͟fdy >fdrt0롄 ffK߭{+iE ff\Wnumeric͟ ff[numeric B ff38͟ ffRightUUsideofcurrentpGenwhen!)D ff͟ ffEYy ff|)% ff\WpairLΟ ff[pair)C ff~ ffcenteredUUatgivencoGordinate(s)!LП ffffxͤ ff͟fdscaled ffK߭picture ff\Wnumeric͟ ff[picture ff30͟ ffScaleUUallcoGordinatesbythegiven~ ff͟ ffEYy ffKpathiB ff( ff[pathiB ff~ ffamountJ ff͟ ffEYy ffKpair)C ff( ff[pair)C ff~ ffD ff͟ ffEYy ffKpGen  ff( ff[pGen  ff~ ffD ff͟ ffEYy ffKtransform͟ ff( ff[transform͟ ff~ ffD ffffxͤ ff͟fdshifted ffK߭picture ff\WpairLΟ ff[picture ff30͟ ffAddUUthegivenshiftamounttoeach [ ff͟ ffEYy ffKpathiB ff( ff[pathiB ff~ ffpairUUofcoGordinatesW0b ff͟ ffEYy ffKpair)C ff( ff[pair)C ff~ ffD ff͟ ffEYy ffKpGen  ff( ff[pGen  ff~ ffD ff͟ ffEYy ffKtransform͟ ff( ff[transform͟ ff~ ffD ffffxͤ ff͟fdsind* ffK߭{+iE ff\Wnumeric͟ ff[numeric B ff15͟ ffSineUUofanangleindegrees4~ ffffxͤ ff͟fdslanted ffK߭picture ff\Wnumeric͟ ff[picture ff30͟ ffApplyUUtheslantingtransformation[ ff ͟ ffEYy ffKpathiB ff( ff[pathiB ff~ ffthatUUmaps(x;y[٭)into(x8+sy;y),,ٟ ff͟ ffEYy ffKpair)C ff( ff[pair)C ff~ ffwhereUUsisthenumericargument@a ff͟ ffEYy ffKpGen  ff( ff[pGen  ff~ ffD ff͟ ffEYy ffKtransform͟ ff( ff[transform͟ ff~ ffD ffffxͤ ff͟fdsqrt* ffK߭{+iE ff\Wnumeric͟ ff[numeric B ff15͟ ffSquareUUroGotu؟ ffffxͤ ff͟fdstr/̵ ffK߭{+iE ff\Wsuxp[ ff[stringS ff50͟ ffStringUUrepresentationforasux͟ ffffx.`FLT@PGAUUUser'sManualforMetaPost!í70P)T*ableUU9:qOpGerators(Part4) 9LǍGfffd͟ ff -fdNameE ffŵfdArgument/resultUUtypGesb ff͟fdPage Z ff8DfdExplanation ffE߄ffk͟ ffEYy ffKLeftŵ ff\WRight  ffResultp` ff Z ffż ffffffff𦍍ͤ ff͟fdstring ffK߭{+iE ff\Wany  ffbGoolean ff-16͟ ff/IsUUtheexpressionoftypGestring?7~ ffff𦍍ͤ ff͟fdsubpath ffK߭pair)C ff\WpathiB ffpathiB ff-28͟ ff/PortionUUofapathforgivenrange ff ͤ ff͟fdof5 ff|)% ffŝ ffb ff Z ff/ofUUtimevqaluesd ffff𦍍ͤ ff͟fdsubstringLǡ ffK߭pair)C ff\WstringS ffstringS ff-14͟ ff/SubstringUUbGoundedbygivenindices͟ ff ͤ ff͟fdof5 ff|)% ffŝ ffb ff Z ffż ffff𦍍ͤ ff͟fdy >fdtop+Z ffK߭{+iE ff\Wnumeric B ffnumeric B ff-38͟ ff/T*opUUofcurrentpGenwhencentered  ff ͟ ffEYy ff|)% ff\Wpair)C ffpair)C ff Z ff/atUUthegivencoGordinate(s)0 ffff𦍍ͤ ff͟fdtransformLǡ ffK߭{+iE ff\Wany  ffbGoolean ff-16͟ ff/IsUUtheargumentoftypGetransform?"$ ffff𦍍ͤ ff͟fdtransformed ffK߭picture ff\Wtransform͟ ffpicture ff-31͟ ff/ApplyUUthegiventransformtoall)@ ff ͟ ffEYy ffKpathiB ffŝ ffpathiB ff Z ff/coGordinatesoiM ff͟ ffEYy ffKpair)C ffŝ ffpair)C ff Z ffż ff͟ ffEYy ffKpGen  ffŝ ffpGen  ff Z ffż ff͟ ffEYy ffKtransform͟ ffŝ fftransform͟ ff Z ffż ffff𦍍ͤ ff͟fdulcornerġ ffK߭{+iE ff\Wpicture ffpair)C ff-22͟ ff/UppGer-leftUUcornerofboundingbox "" ff͟ ffEYy ff|)% ff\WpathiB ffb ff Z ffż ff͟ ffEYy ff|)% ff\WpGen  ffb ff Z ffż ffff𦍍ͤ ff͟fduniform-ġ ffK߭{+iE ff\Wnumeric B ffnumeric B ff.{͟ ff/RandomUUnumbGerbetweenzeroandҟ ffͤ ff͟fddeviate ff|)% ffŝ ffb ff Z ff/theUUvqalueoftheargument0") ffff𦍍ͤ ff͟fdy >fdunitvector ffK߭{+iE ff\Wpair)C ffpair)C ff-15͟ ff/RescaleUUavectorsoitslengthis1E ffff𦍍ͤ ff͟fdunknown ffK߭{+iE ff\Wany  ffbGoolean ff-16͟ ff/IsUUthevqalueunknown?? ffff𦍍ͤ ff͟fdurcornerġ ffK߭{+iE ff\Wpicture ffpair)C ff-22͟ ff/UppGer-leftUUcornerofboundingbox "" ff ͟ ffEYy ff|)% ff\WpathiB ffb ff Z ffż ff͟ ffEYy ff|)% ff\WpGen  ffb ff Z ffż ffff𦍍ͤ ff͟fdy >fdwhatever ffK߭{+iE ff\W{+iE ffnumeric B ff-10͟ ff/CreateUUanewanonymousunknown[ ffff𦍍ͤ ff͟fdxpart%L ffK߭{+iE ff\Wpair)C ffnumbGerS ff-16͟ ff/xUUortx^9compGonentP)L ff ͟ ffEYy ff|)% ff\Wtransform͟ ffb ff Z ffż ffff𦍍ͤ ff͟fdxscaled ffK߭picture ff\Wnumeric B ffpicture ff-30͟ ff/ScaleUUallxcoGordinatesbytheΜ ff ͟ ffEYy ffKpathiB ffŝ ffpathiB ff Z ff/givenUUamountf ٟ ff͟ ffEYy ffKpair)C ffŝ ffpair)C ff Z ffż ff͟ ffEYy ffKpGen  ffŝ ffpGen  ff Z ffż ff͟ ffEYy ffKtransform͟ ffŝ fftransform͟ ff Z ffż ffff𦍍ͤ ff͟fdxxpart ffK߭{+iE ff\Wtransform͟ ffnumbGerS ff-32͟ ff/txx entryUUintransformationmatrix > ffff𦍍ͤ ff͟fdxypart ffK߭{+iE ff\Wtransform͟ ffnumbGerS ff-32͟ ff/txy entryUUintransformationmatrix Û ffff𦍍ͤ ff͟fdypart%L ffK߭{+iE ff\Wpair)C ffnumbGerS ff-16͟ ff/y.orUUty#ܭcompGonentP͟ ff ͟ ffEYy ff|)% ff\Wtransform͟ ffb ff Z ffż ffff𦍍ͤ ff͟fdyscaled ffK߭picture ff\Wnumeric B ffpicture ff-30͟ ff/ScaleUUally.coGordinatesbythe B ff ͟ ffEYy ffKpathiB ffŝ ffpathiB ff Z ff/givenUUamountf ٟ ff͟ ffEYy ffKpair)C ffŝ ffpair)C ff Z ffż ff͟ ffEYy ffKpGen  ffŝ ffpGen  ff Z ffż ff͟ ffEYy ffKtransform͟ ffŝ fftransform͟ ff Z ffż ffff𦍍ͤ ff͟fdyxpart ffK߭{+iE ff\Wtransform͟ ffnumbGerS ff-32͟ ff/ty@Lx entryUUintransformationmatrix Û ffff𦍍ͤ ff͟fdyypart ffK߭{+iE ff\Wtransform͟ ffnumbGerS ff-32͟ ff/ty@Ly rcentryUUintransformationmatrix  ffff𦍍ͤ ff͟fdzscaled ffK߭picture ff\Wpair)C ffpicture ff-30͟ ff/RotateUUandscaleallcoGordinatesso` ff ͟ ffEYy ffKpathiB ffŝ ffpathiB ff Z ff/thatUU(1;0)ismappGedintothe~ ff͟ ffEYy ffKpair)C ffŝ ffpair)C ff Z ff/givenUUpair;i.e.,docomplex+"( ff͟ ffEYy ffKpGen  ffŝ ffpGen  ff Z ff/multiplication.a ff͟ ffEYy ffKtransform͟ ffŝ fftransform͟ ff Z ffż ffff4LǎG/T@PGAUUUser'sManualforMetaPost!í71Ӎfr GT*ableUU10:qCommands Lƍ5WUffj*fd͟ ff#)%fdName_̝ ff͟fdPageł ffY՟fdExplanation ffffj*ffffj*ͤ ff͟fdaddto? ffp40͟ ffLow-levelUUcommandfordrawingand lling' ffffj*ͤ ff͟fdclipD̩ ffp40͟ ffAppliesUUaclippingpathtoapictureF ffffj*ͤ ff͟fdy >fdcutdraw0롄 ffp52͟ ffDrawUUwithbuttendcapsuS ffffj*ͤ ff͟fdy >fddraw@Z⡄ ffu3͟ ffDrawUUalineorapictureyŸ ffffj*ͤ ff͟fdy >fddrawarrow& ffp37͟ ffDrawUUalinewithanarrowheadattheend* ffffj*ͤ ff͟fdy >fddrawdblarrowZ ffp37͟ ffDrawUUalinewitharrowheadsatbGothends*7 ffffj*ͤ ff͟fdy >fdfill@Z⡄ ffp23͟ ffFillUUinsideacyclicpath| ffffj*ͤ ff͟fdy >fdfilldraw+Z ffp37͟ ffDrawUUacyclicpathand llinsideitH ן ffffj*ͤ ff͟fdinterim5 ffp43͟ ffMakeUUaloGcalchangetoaninternalvqariable%Ŵ ffffj*ͤ ff͟fdletJ ffu{͟ ffAssignUUonesymbGolictokenthemeaningofanotherv ffffj*ͤ ff͟fdy >fdloggingall ffp61͟ ffT*urnUUonalltracing(log leonly)Qc ffffj*ͤ ff͟fdnewinternal ffp18͟ ffDeclareUUnewinternalvqariables_S ffffj*ͤ ff͟fdy >fdpickup5衄 ffp13͟ ffSpGecifyUUnewpenforlinedrawingS ffffj*ͤ ff͟fdsaveD̩ ffp42͟ ffMakeUUvqariablesloGcalL۟ ffffj*ͤ ff͟fdsetbounds* ffp23͟ ffMakeUUapicturelieabGoutitsboundingbox)@ ffffj*ͤ ff͟fdshipout5 ffp41͟ ffLow-levelUUcommandtooutputa gure;S ffffj*ͤ ff͟fdshowD̩ ffp12͟ ffprintUUoutexpressionssymbGolicallyNb) ffffj*ͤ ff͟fdshowdependencies ffp61͟ ffprintUUoutallunsolvedequationsW ffffj*ͤ ff͟fdshowtoken* ffp61͟ ffprintUUanexplanationofwhatatokenis7 ffffj*ͤ ff͟fdshowvariable ffp61͟ ffprintUUvqariablessymbGolicallyj ffffj*ͤ ff͟fdspecial5 ffp81͟ ffprintUUastringdirectlyinthePostScriptoutput le͟ ffffj*ͤ ff͟fdy >fdtracingall ffp61͟ ffT*urnUUonalltracing2 ffffj*ͤ ff͟fdy >fdtracingnone ffp61͟ ffT*urnUUo alltracing ffffj*ͤ ff͟fdy >fdundraw5衄 ffp37͟ ffEraseUUalineorapicturey)P ffffj*ͤ ff͟fdy >fdunfill5衄 ffp25͟ ffEraseUUinsideacyclicpathsS ffffj*ͤ ff͟fdy >fdunfilldraw ffp37͟ ffEraseUUacyclicpathanditsinsideQg ffffj*LƎHWT@PGAUUUser'sManualforMetaPost!í72*~T*ableUU11:qFunction-LikeMacros Rf#mff{fd͟ ffBfdNameIs ff џfdArgumentsZ ff 0\fdResult ff͟fdPageۤ fffdboxit%L ffP1sux,UUpicture&[  ff${#П ffG 54͟ ffGDe neUUabGoxcontainingthepicture  ffff{ͤ ff͟fdz >fdboxit%L ffP1sux,UUstring+  ff${#П ffG 57͟ ffGDe neUUabGoxcontainingtext, ӟ ffff{ͤ ff͟fdz >fdboxit%L ffP1sux,UUhemptyi!^ ff${#П ffG 57͟ ffGDe neUUanemptybGoxMb- ffff{ͤ ff͟fdz >fdboxjoin ffP1equations8 ff${#П ffG 55͟ ffGGiveUUequationsforconnectingbGoxes џ ffff{ͤ ff͟fdz >fdbpath%L ffP1suxK ֟ ff$path͟ ffG 55͟ ffGAUUbGox'sboundingcircleorrectangle & ffff{ͤ ff͟fdy >fdbuildcycle ʡ ffP1listUUofpaths.  ff$path͟ ffG 25͟ ffGBuildUUacyclicpathU ffff{ͤ ff͟fdz >fdcircleitġ ffP1sux,UUpicture&[  ff${#П ffG 57͟ ffGPutUUpictureinacircularbGox+"* ffff{ͤ ff͟fdz >fdcircleitġ ffP1sux,UUpicture&[  ff${#П ffG 57͟ ffGPutUUastringinacircularbGox(Lԟ ffff{ͤ ff͟fdz >fdcircleitġ ffP1sux,UUhemptyi!^ ff${#П ffG 57͟ ffGDe neUUanemptycircularbGox)7 ffff{ͤ ff͟fdy >fddashpattern͡ ffP1on/o UUdistances& ff$picture x ffG 34͟ ffGCreateUUapatternfordashedlinesE ffff{ͤ ff͟fdy >fddecr* ffP1numericUUvqariable& ff$numeric͟ ffG 51͟ ffGDecrementUUandreturnnewvqalue[ ffff{ͤ ff͟fdy >fddotlabelġ ffP1sux,UUpicture,pair ff${#П ffG 19͟ ffGMarkUUpGointanddrawpicturenearby> ffff{ͤ ff͟fdy >fddotlabelġ ffP1sux,UUstring,pair~ ff${#П ffG 19͟ ffGMarkUUpGointandplacetextnearby ffff{ͤ ff͟fdy >fddotlabelsLǡ ffP1sux,UUpGointnumbGers͟ ff${#П ffG 19͟ ffGMarkUUzpGointswiththeirnumbGers ffff{ͤ ff͟fdz >fddrawboxedLǡ ffP1listUUofsuxes&ӟ ff${#П ffG 54͟ ffGDrawUUthenamedbGoxesandtheirŷ ff ͟ ffI@ ffZ ff ff۟ ffGcontentsw ffff{ͤ ff͟fdz >fddrawboxesLǡ ffP1listUUofsuxes&ӟ ff${#П ffG 57͟ ffGDrawUUthenamedbGoxesD". ffff{ͤ ff͟fdy >fddrawoptions͡ ffP1drawingUUoptions[  ff${#П ffj??͟ ffGSetUUoptionsfordrawingcommandsϟ ffff{ͤ ff͟fdz >fddrawunboxed͡ ffP1listUUofsuxes&ӟ ff${#П ffG 57͟ ffGDrawUUcontentsofnamedbGoxes"w ffff{ͤ ff͟fdz >fdfixpos ffP1listUUofsuxes&ӟ ff${#П ffG 57͟ ffGSolveUUforthesizeandpGositionofthe7{ ff ͟ ffI@ ffZ ff ff۟ ffGnamedUUbGoxesp0j ffff{ͤ ff͟fdz >fdfixsize ffP1listUUofsuxes&ӟ ff${#П ffG 57͟ ffGSolveUUforsizeofnamedbGoxes(pc ffff{ͤ ff͟fdy >fdincr* ffP1numericUUvqariable& ff$numeric͟ ffG 51͟ ffGIncrementUUandreturnnewvqalueE ffff{ͤ ff͟fdy >fdlabel%L ffP1sux,UUpicture,pair ff${#П ffG 18͟ ffGDrawUUpictureneargivenpGoint$ ffff{ͤ ff͟fdy >fdlabel%L ffP1sux,UUstring,pair~ ff${#П ffG 18͟ ffGPlaceUUtextneargivenpGoint1 ffff{ͤ ff͟fdy >fdlabels ffP1sux,UUpGointnumbGers͟ ff${#П ffG 19͟ ffGDrawUUzpGointnumbGers;nodotsf ffff{ͤ ff͟fdy >fdmax/̵ ffP1listUUofnumerics[  ff$numeric͟ ffG {͟ ffGFindUUthemaximumTS ffff{ͤ ff͟fdy >fdmax/̵ ffP1listUUofstrings) ff$stringwx ffG {͟ ffGFindUUthelexicographicallylaststring~ ffff{ͤ ff͟fdy >fdmin/̵ ffP1listUUofnumerics[  ff$numeric͟ ffG {͟ ffGFindUUtheminimumVE ffff{ͤ ff͟fdy >fdmin/̵ ffP1listUUofstrings) ff$stringwx ffG {͟ ffGFindUUthelexicographically rststring͟ ffff{ͤ ff͟fdz >fdpic/̵ ffP1suxK ֟ ff$picture x ffG 57͟ ffGBoxUUcontentsshiftedintopGosition  ffff{ͤ ff͟fdy >fdthelabelġ ffP1sux,UUpicture,pair ff$picture x ffG 19͟ ffGPictureUUshiftedasiftolabGelapoint { ffff{ͤ ff͟fdy >fdthelabelġ ffP1sux,UUstring,pair~ ff$picture x ffG 19͟ ffGtextUUpGositionedasiftolabelapoint  ffff{ͤ ff͟fdy >fdz:L ffP1suxK ֟ ff$pairLΟ ffG 17͟ ffGTheUUpairxhsuxvi㔱;yhsuxvi).1 ffff{Ih{T@PGAUUUser'sManualforMetaPost!í73{9J hatom8ij!hvqariable"1Ͷi/jhargument)ji `jhnumbGerUUorfractionRNDi`jhinternalUUvqariableG*i`j(hexpression,wi<)`緶jbegingrouphstatementUUlist;\iCzhexpression,wix@endgroup`緶jhnullaryUUop,xi`jbtexhtypGesettingUUcommandsb*iiײetex`緶jhpseudoUUfunctionE8iJ hprimary"#iwu!hatom8i`j(hnumericUUexpressionRжib,hhnumericUUexpressionRжi¸)`緶j(hnumericUUexpressionRжib,hhnumericUUexpressionRжi¸,hnumericUUexpressionRжi"ز)`緶jhofUUopGerator0ci:hexpression,wioaofhprimary"#i`jhunaryUUop'1ζi1hprimary"#i`jstrhsuxvi`jzhsuxvi`jhnumericUUatomDi|,hprimary"#i`jhsecondary+#i5htransformer2iJ htertiary!wiuJ!hsecondary+#i`jhtertiary!wi+hsecondaryUUbinopF굶iz\hsecondary+#iJ hsubGexpression<1϶i!htertiary!wi`jhpathUUexpressionD1жiNhpathUUjoin'i~@hpathUUknot+AiJ hexpression,wiI!hsubGexpression<1϶i`jhexpression,wi7jhtertiaryUUbinop<㘶i|chtertiary!wi`jhpathUUsubGexpressionS(i^^hdirectionUUspGeci erMAi`jhpathUUsubGexpressionS(i^^hpathUUjoin'ifcycleJ hpathUUknot+Ai!htertiary!wiJ hpathUUjoin'i|g!`jhdirectionUUspGeci erMAiWwhbasicUUpathjoin@&i*hdirectionUUspGeci erMAiJ hdirectionUUspGeci erMAi!hempty8i`jfcurlhnumericUUexpressionRжiZg`jfhpairUUexpressionAq϶iI8g`jfhnumericUUexpressionRжiZ,_hnumericUUexpressionRжigJ hbasicUUpathjoin@&iu!..*j...N'j.. Ghtension*i48߲..Aj.. Ghcontrols"@i7N4..J htension*isق!tensionhnumericUUprimaryH|i`jtensionhnumericUUprimaryH|iPandhnumericUUprimaryH|iJ hcontrols"@iv!controlshpairUUprimary7\{i`jcontrolshpairUUprimary7\{i?#andhpairUUprimary7\{iJ hargument)ji~!hsymbGolicUUtokenAU_iJ hnumbGerUUorfractionRNDi!hnumbGer!Zi+/0㍶hnumbGer!Zi`jhnumbGerUUnotfollowedUUby`/?hnumbGeri'\iJ hscalarUUmultiplicationopg#io!+j`jh`hnumbGerUUorfractioni'notfollowedUUby`haddopihnumbGeri'qiGFigureUU55:qPart1ofthesyntaxforexpressionsJUT@PGAUUUser'sManualforMetaPost!í74>9Dhtransformer2i(&!rotatedhnumericUUprimaryH|i [h jscaledhnumericUUprimaryH|i[h jshiftedhpairUUprimary7\{i[h jslantedhnumericUUprimaryH|i[h jtransformedhtransformUUprimaryPi[h jxscaledhnumericUUprimaryH|i[h jyscaledhnumericUUprimaryH|i[h jzscaledhpairUUprimary7\{i[h jreflectedabout(?hpairUUexpressionAq϶iNx,ShpairUUexpressionAq϶iӲ)[h jrotatedaround(?hpairUUexpressionAq϶iNx,ShnumericUUexpressionRжiqԲ)DhnullaryUUop,xi{'!falsejnormaldeviatejnullpicturejpencircle[h jtruejwhateverDhunaryUUop'1ζiva !htypGe*i[h jabsjanglejarclengthjASCIIjbboxjbluepartjbotjceiling[h jcenterjcharjcosdjcyclejdecimaljdirjfloorjfontsize[h jgreenpartjhexjinversejknownjlengthjlftjllcorner[h jlrcornerjmakepathjmakepenjmexpjmlogjnotjoctjodd[h jredpartjreversejroundjrtjsindjsqrtjtopjulcorner[h juniformdeviatejunitvectorjunknownjurcornerjxpartjxxpart[h jxypartjypartjyxpartjyypartDhtypGe*ibY!booleanjcolorjnumericjpair[h jpathjpenjpicturejstringjtransformDhprimaryUUbinop>Di!* -j/j***jand[h jdotprodjdivjinfontjmodDhsecondaryUUbinopF굶i!+jj+8+j++jor[h jintersectionpointjintersectiontimesDhtertiaryUUbinop<㘶i!& -jj= -j>j>=[h jcutafterjcutbeforeDhofUUopGerator0ci!arctimejdirectionjdirectiontimejdirectionpoint[h jpenoffsetjpointjpostcontroljprecontroljsubpath[h jsubstringDhvqariable"1Ͷiqa !htag 㑶iqhsuxviDhsuxvifK!hempty8i(6jhsuxvi!hsubscript'ZiS9G=hprogram$iv'!hstatementUUlist;\iFcend G=hstatementUUlist;\i!hempty8i(6jhstatementUUlist;\iFc;Khstatement+wiG=hstatement+wi|!hempty8i^!jhequation%i2Tjhassignment0*i^!jhdeclaration0\yi=jhmacroUUde nitionG#i^!jhcompGound-G%i:sjhpseudoUUproGcedureL i^!jhcommand*8iG=hcompGound-G%ib!begingrouphstatementUUlist;\iCzendgroup^!jbeginfig(?hnumericUUexpressionRжi_);jxhstatementUUlist;\i^;U[endfigG=hequation%iwKC!hexpression,wi7j=@ i#hundelimitedUUpartI\}i^!jvardefhgenericUUvqariableDziKhdelimitedUUpart>@ ihundelimitedUUpartI\}i^!jvardefhgenericUUvqariableDziK㘲@#VchdelimitedUUpart>@ ijhundelimitedUUpartI\}i^!jhbinaryUUdef,xi7!hparameter,ikNEhsymbGolicUUtokenAU_ijhparameter,iG=hdelimitedUUpart>@ i E!hempty8i^!jhdelimitedUUpart>@ iH?(N9ODaddtohpictureUUvqariableD{iK㙲alsohpictureUUexpressionN%iVChoptionUUlist,if VjaddtohpictureUUvqariableD{iK㙲contourhpathUUexpressionD1жiKhoptionUUlist,if VjaddtohpictureUUvqariableD{iK㙲doublepathhpathUUexpressionD1жiKhoptionUUlist,iOD69=hifUUtestUXi`2!ifhbGooleanUUexpressionRaiY:_|hbalancedUUtokensE ichalternatives2iUfi =halternatives2iz2o!hempty8iSǾjelse:?hbalancedUUtokensE iSǾjelseifhbGooleanUUexpressionRaiY:_|hbalancedUUtokensE ichalternatives2i=hloGopviZ+P!hloGopUUheader2yi=j:BhloGopUUtext'qζiq㘲endfor=hloGopUUheader2yizkS!forhsymbGolicUUtokenAU_iI}=N\zhprogression1?iSǾjforhsymbGolicUUtokenAU_iI}=N\zhforUUlist˶iSǾjforsuffixeshsymbGolicUUtokenAU_iI}=N\zhsuxUUlist'[iSǾjforever=hprogression1?ix!hnumericUUexpressionRжi]uptohnumericUUexpressionRжiSǾjhnumericUUexpressionRжi]downtohnumericUUexpressionRжiSǾjhnumericUUexpressionRжi]stephnumericUUexpressionRжiZuntilhnumericUUexpressionRжi=hforUUlist˶id@!hexpression,wi:1jhforUUlist˶i'@,,hexpression,wi=hsuxUUlist'[iod5!hsuxvi$qjhsuxUUlist'[i2c,7hsuxviFigureUU61:qThesyntaxforconditionalsandloGopsOνT@PGAUUUser'sManualforMetaPost!í79@PGB.hEMetaP=ostVersusMETAF=ONTGSincettheMETAF9ONTEandMetaPostlanguageshavesomuchincommon,expGertusersofMETAF9ONT GwillZwanttoskipmostoftheexplanationsinthisdoGcumentandconcentrateonconceptsthatareGuniquetoMetaPost.2ThecomparisonsinthisappGendixareintendedtohelpexpGertsthatarefamiliarGwith The̯METAF9ONTb}'ookaswellasotherusersthatwanttobGene tfromKnuth'smoredetailedGexplanationsUU[4@].!GSince METAF9ONTisintendedformakingTU>'ExXfonts,ithasanumbGerofprimitivesforgeneratingGthe{tfm lesthatTU>'ExXneedsforcharacterdimensions,܄spacinginformation,ligaturesandkerning.GMetaPostJmcanalsobGeusedforgeneratingfonts,LanditalsohasMETAF9ONT'sprimitivesformakingGtfmκ les.DThesearelistedinT*able12.ExplanationscanbGefoundintheMETAF9ONTdocumentationG[4@,X7\]|㌍t.NV*gff9fdͤ ff͟fdcommands$"& ff^ charlist,UUextensible,fontdimen,headerbyte͟ ff͟ ffX ff^ kern,UUligtableEe ffff9򦍍ͤ ff͟fdligtableUUopGerators ff^ ::,UU=:,=:|,=:|>,|=:,|=:>,Z ff͟ ffX ff^ |=:|,UU|=:|>,|=:|>>,||:i ffff9򦍍ͤ ff͟fdinternalUUvqariables0\ ff^ boundarychar,UUchardp,charext,charht," ff͟ ffX ff^ charic,UUcharwd,designsize,fontmaking  ffff9򦍍ͤ ff͟fdotherUUopGerators7z ff^ charexistsџ ffff9򎎎@qƍyT*ableUU12:qMetaPostprimitivesformakingtfm les.!GEven=~thoughMetaPosthastheprimitivesforgeneratingfonts,uvmanyofthefont-makingprimitivesGand҃internalvqariablesthatarepartofPlainMETAF9ONTbarenotde nedinPlainMetaPost.F,Instead,Gthere-isaseparatemacropackqagecalledmfplainthatde nesthemacrosrequiredtoallowMetaPostGtoproGcessKnuth'sComputerModernfontsasshowninT*able13[6@].*Toloadthesemacros, putG\&mfplain"AbGeforethenameoftheinput le.TkThiscanbedoneatthe**promptafterinvokingAtheGMetaPostUUinterpreterwithnoarguments,oronacommandlinethatloGokssomethinglikethis:^12mp?'&mfplain'cmr10GTheUUanalogofaMETAF9ONTcommandlinelikeݲmf?'\mode=lowres;mag=1.2;inputcmr10'Gis lmp?'&mfplain\mode=lowres;mag=1.2;inputcmr10'GTheresultisasetofPostScript les,KGoneforeachcharacterinthefont. SomeeditingwouldbGeGrequiredUUinordertomergethemintoadownloadableTypGe3PostScriptfont[1@].!GAnotherlimitationofthemfplainpackqageisthatcertaininternalvqariablesfromPlainMETA-GF9ONTcannotbGegivenreasonableMetaPostde nitions.4^Theseincludedisplaying,currentwindow,Gscreen_rows,and_gscreen_colswhichdepGendonMETAF9ONT'sabilitytodisplayimagesontheGcomputermscreen.Inaddition,pixels_per_inchisirrelevqantsinceMetaPostuses xedunitsofGPostScriptUUpGoints.!GThereasonwhysomemacrosandinternalvqariablesarenotmeaningfulinMetaPostisthatGMETAF9ONT0kprimitivecommandscull,g0display,openwindow,numspecial0kandtotalweightareGnotAimplementedinMetaPost.AlsonotimplementedareanumbGerofinternalvqariablesaswellasGX-ffr ;zw-:12LܴCommandlinesynÎtaxissystemdepmakeboxdefine_whole_pixelshmakegriddefine_whole_vertical_blacker_pixelsmaketicksdefine_whole_vertical_pixels9mode_defendcharmode_setupextra_beginchar}o_correctionextra_endcharproofruleextra_setupproofrulethicknessfont_coding_schemen?rulepenfont_extra_spacexsmode<UVfftff<Rͤ ffBZfdDe nedUUasno-opsinthemfplainpackqage ffff<R<͟7tUVffͲcullit?proofoffset currenttransformxscreencharsgfcornersscreenrulegrayfontscreenstrokeshround?showitimagerules?slantfontlowres_fix?titlefontnodisplays?unitpixelnotransformsvroundopenit<tUVff8ff<RA'T*ableUU13:qMacrosandinternalvqariablesde nedonlyinthemfplainpackqage.QJT@PGAUUUser'sManualforMetaPost!í81@PGthe;hdrawingoptioniwithweight.-Hereisacompletelistingoftheinternalvqariableswhoseprimitive GmeaningsUUinMETAF9ONTdonotmakesenseinMetaPost:֍qǍM`autorounding?fillin$proofing?tracingpensxoffsetM`chardx$granularity smoothingturningcheckyoffsetM`chardy$hppp/?tracingedges?vppp$0!GThereDisalsooneMETAF9ONTprimitivethathasaslightlydi erentmeaninginMetaPost.lRBothGlanguagesUUallowstatementsoftheformd9special̶hstringUUexpressionIG%i#;GbutӮMETAF9ONTcopiesthestringintoits\genericfont"output le,3whileMetaPostinterpretsthe Gstring8,asasequenceofPostScriptcommandsthataretobGeplacedatthebeginningofthenextGoutputUU le.(!GAlletheotherdi erencesbGetweeneMETAF9ONTandMetaPostarefeaturesfoundonlyinMetaPost.GThesearelistedinT*able14.tTheonlycommandslistedinthistablethattheprecedingsectionsGdoGnotdiscussareextra_beginfig,òextra_endfig,andGmpxbreak.ǜThe rsttwoGarestringsthatGcontainuextracommandstobGeprocessedbybeginfigandendfigjustasextra_begincharandGextra_endchar=areproGcessedbybegincharandendchar.i(The leboxes.mpusesthesefeatures).!GThe 3othernewfeaturelistedinT*able14notlistedintheindexismpxbreak.aThisisusedtoGseparatebloGcksoftranslatedTU>'ExXortro commandsinmpx les.M ItshouldbeofnoconcerntousersGsinceUUmpx lesaregeneratedautomatically*.5m|cTavffjfdͤ ff$fdMetaPostUUprimitivesnotfoundinMETAF9ONT$ ffffj0͟+\UVffͲbluepart/?infont9redpartbtexD?linecap4setboundsclipD?linejoin/?tracinglostcharscolor>llcorner/?truecornersdashed9lrcorner/?ulcorneretexD?miterlimit$urcornerfontsize/?mpxbreakverbatimtexgreenpart)prologueswithcolor\UVff,ffjͤ ff!ɟfdV*ariablesUUandMacrosde nedonlyinPlainMetaPost ffffjN͟IUVffmͲahangle4cutbefore)extra_beginfigahlength/?cuttingsextra_endfigbackground$dashpatterngreenbboxD?defaultfontlabelbboxmargin$defaultpenlabeloffsetbeginfig/?defaultscale?miteredbeveled4dotlabel/?redblack>dotlabels)roundedblueD?drawarrow)squaredbuildcycle$drawdblarrow?thelabelbuttD?drawoptionswhitecenter9endfigcutafter/?evenlyUVffJffj7gT*ableUU14:qMacrosandinternalvqariablesde nedinMetaPostbutnotMETAF9ONT._DGAtts.GReferencesGIndexR#T@PGAUUUser'sManualforMetaPost!í82@PGReferencesG[1]!AdobGeSystemsInc.fPostScript@PL}'anguageReferenceManual.fAddisonW*esley,?Reading,Mas- !sachusetts,UU1986.G[2]!J.D.Hobby*.TSmoGoth,easytocomputeinterpGolatingsplines.TDiscr}'eteNandComputationalGe-!ometry,UU1(2),1986.G[3]!Brian8W.Kernighan. Pic|agraphicslanguagefortypGesetting.InUnixR}'esearchSystemPapers,!T;enthEdition,UUpages53{77.A*T&TBellLabGoratories,1990.G[4]!D.E.Knuth.TheɯMETAF9ONTb}'ook.AddisonW*esley,Reading,Massachusetts,1986.V*olumeC!ofUUComputersandT;yp}'esetting.G[5]!D.)E.Knuth.]TheʴTKß'E-Xb}'ook.Addison)W*esley,Reading,Massachusetts,1986.V*olume)Aof!ComputersandT;yp}'esetting.G[6]!D.wE.Knuth.ϬComputerMo}'dernT;ypefaces.ϬAddisonwW*esley,Reading,Massachusetts,1986.!V*olumeUUEofComputersandT;yp}'esetting.G[7]!D.7E.Knuth.%7ThenewversionsofTU>'ExXandMETAF9ONT.%7TUGb}'oat,theyTKß'E-XUser'sGGroup!Newsletter,UU10(3):325{328,NovembGerUU1989.S T@P9. 卑GIndexeэ9.G#@UU49 G&UU14G*UU2G**UU2,13G++UU14G+-+UU14G--UU2G...qǭ7,UU50G:=UU9,18G<UU13G<=UU13G<>UU13G=UU9G>UU13G>=UU13G@UU49G@#UU50GabsUU15Gaddto?alsoUU40Gaddto?contourUU40Gaddto?doublepathUU40GahangleUU37GahlengthUU37GandUU13{14GangleUU15GarcUUlength30,44GarclengthUU30,44GarctimeUU44Garctime?ofUU30GarithmeticUU12,16,52GarraysUU17&GmultidimensionalUU18GarrowsUU35&Gdouble-headedUU37GASCIIUU67GassignmentUU9,18,53GbackgroundUU25,37GhbalancedUUtokensi44,78GbboxUU22,25GbboxmarginUU22GbeginfigUU3,17,38{39,41{42,81GbegingroupUU42,49GbeveledUU35GblackUU12GblueUU12GbluepartUU16GbooleanUU16GbGooleanUUtype13GbotUU18,38{399.`bGoxUUname54 `boxes.mpUU54,62,81`boxitUU54`boxjoinUU55,57`bpUU2`bpathUU55,57{58`btexUU20{21,23`buildcycleUU24{26`buttUU35,52`CAPSULEUU43`ccUU66`ceilingUU15`centerUU22`charUU22`charcodeUU41`circleitUU57`circmarginUU58`clipUU40`cmUU2`colorUU16`colorUUtypGe12`commentsUU17`comparisonUU13`compGoundUUstatement42`concatenationUU14`controlUUpGoints5,61`controlsUU5`convexUUpGolygons39`cornersUU35`cosdUU15`curlUU7`currentpenUU38,40`currentpictureUU13,25,40{41`curvqatureUU5{7`cutafterUU28,55`cutbeforeUU28,55`cutdrawUU52`cuttingsUU28`cycleUU4,15`hdashUUpatterni32,34`recursiveUU34`dashedUU32,37,40`dashpatternUU47`dayUU64`ddUU66`decimalUU15`declarationsUU18`decrUU51`defUU4183T-T@PGAUUUser'sManualforMetaPost!í84@PGdefaultdxUU55 GdefaultdyUU55GdefaultfontUU19GdefaultpenUU39GdefaultscaleUU20GdirUU6Gdirection?ofUU28,51Gdirectionpoint?ofUU30Gdirectiontime?ofUU28GdittoUU66GdivUU68GdotlabelUU19GdotlabelsUU19,53GdotprodUU13,50{51GdotsUU3GdownUU6GdowntoUU52GdrawUU2,13,25,50GdrawarrowUU37,55GdrawboxedUU54,57{58GdrawboxesUU57{58GdrawdblarrowUU37GhdrawingUUoptioni40GdrawoptionsUU37,40GdrawshadowedUU58GdrawunboxedUU57{58GdrawEff&fǫmarkUU44GdrawEff&fǫmarkedUU44GdvipsUU1,22GelseUU44GelseifUU44GendUU2{3,51GenddefUU41GendfigUU3,41{42,81GendforUU3,52GendgroupUU42,49,51Gepsf.texUU3GepsilonUU66GerasingUU25,37GetexUU20{21,23GevenlyUU32,35GexitifUU53GexitunlessUU53GexpGonentiationUU13GexprUU41,43GhexpressioniUU13,51,73GextraEff&fǫbeginfigUU81GextraEff&fǫendfigUU81GfalseUU13GfiUU44G les&GinputUU1@P`mpxUU21,81 `outputUU3`tfmUU20,79`transcriptUU2,12,60{61`fillUU23,41,50{51`filldrawUU37`fixposUU57`fixsizeUU57`floorUU15`fontsizeUU20`forUU3,52`foreverUU53`forsuffixesUU53`fractionsUU15`fullcircleUU23{24,39`functionsUU42`hgenericUUvqariablei49,76`getmidUU47`greenUU12`greenpartUU16`halfcircleUU23{24`hexUU68`hideUU46`identityUU31`ifUU44,61,63`inUU2`Inconsistent?equationUU9,11`incrUU47,51`indexingUU14`inequalityUU13`infinityUU28`in ectionsUU7`infontUU22`inputUU54,62`interimUU43,52`internalvqariables12,18{19,22{23,35,37,41,$`43,UU55,58,61,79`intersectionUU26{27`intersectionpointUU27,50`intersectionsUU25`intersectiontimesUU27`inverseUU31`joinupUU47,50`kerningUU20,79`knownUU16`labelUU18`hlabGelUUsuxi18,75{76`labeloffsetUU19`labelsUU19`leftUU6`lengthUU28`letUU71U T@PGAUUUser'sManualforMetaPost!í85@PGlftUU18,38{39 GligaturesUU20,79GlinecapUU35,43,52GlinejoinUU35GllcornerUU22GllftUU18GloGcalityUU18,42GloggingallUU61GloGopsUU3,52,63GlrcornerUU22GlrtUU18GmakepathUU39GmakepenUU39GmarkEff&fǫangleUU46GmarkEff&fǫrtEff&fangleUU46GmaxUU72GmediationUU10{11,15GMETAF9ONTUU1,19,39{41,52,60,62,79GmexpUU68GmfplainUU79GmiddlepointUU44GmidpointUU43{44GminUU72GmiteredUU35GmiterlimitUU35GmlogUU68GmmUU2GmodUU68GmonthUU64GmpUU1GmpxbreakUU81Gmpxerr.logUU21Gmpxerr.texUU21Gmultiplication&GimplicitUU2,16GnewinternalUU18GnormaldeviateUU68GnotUU13GhnullaryUUopi14,73{74GnullpictureUU14GnumericUU16GhnumericUUatomi15GnumericUUtypGe12GoctUU69GoddUU69GhofUUopGeratori51,73{74GhoptionUUlisti40,77GorUU13{14GoriginUU66GpairUU16GpairUUtypGe12Gparameter@P`exprUU43,51,53 `suxUU47,49{51,53`textUU46,49,51`parameterizationUU5`parsingUUirregularities13,15{16`pathUU16,44`hpathUUknoti14,73`pathUUtypGe12`pausingUU64`pcUU66`penUU16`pGenUUtype13`pencircleUU2,38`penoffsetUU69`pGens`ellipticalUU38`pGolygonalUU39,62`pensquareUU39`picUU57{58`pickupUU2,13`pictureUU16`pictureUUtypGe13`hpictureUUvqariablei23,77`PlainUUmacros2,18{19,39,41,62,79`point?ofUU27`pGoint`PostScriptUU2`printer'sUU2`postcontrolUU69`PostScriptUU1{2,13,22{23,41`pGointUU2`structuredUU22`precontrolUU69`hprimaryiUU13,73`hprimaryUUbinopi14,22,51,73{74`primarydefUU51`prologuesUU22`ptUU2`quartercircleUU66`redUU12`redpartUU16`Redundant?equationUU11`reflectedaboutUU31`hreplacementUUtexti41,51,76`reverseUU37`rightUU6`\rlapUU23`rotatedUU20,30`rotatedUUtext20`rotatedaroundUU31,41`roundUU15,50`roundedUU35VLT@PGAUUUser'sManualforMetaPost!í86@PGroundo UUerror11 GrtUU18,38GsaveUU42GscaledUU2,22,30,32GhsecondaryiUU13,51,73GhsecondaryUUbinopi14,27,51,73{74GsecondarydefUU51GselfUU59GsemicolonUU51GsetboundsUU23GshiftedUU30GshipoutUU41GshowUU9,12,42{43,60{61GshowdependenciesUU61GshowstoppingUU64GshowtokenUU61GshowvariableUU61GsindUU15GsizeUU22GslantedUU30GspecialUU81GsqrtUU15GsquaredUU35GstepUU52GstrUU50,53GstringUU16GstringUUconstants13,16GstringUUtypGe13G\strutUU23GsubpathUU28GsubroutinesUU41GhsubscriptiUU17,47,74Gsubscript&GgenericUU18,49Gsubstring?ofUU14GhsuxiUU16{17,46{47,50{51,73{74,76,78GtagsUU17,49{50GtensionUU7GhtertiaryiUU13,51,73GhtertiaryUUbinopi14,28,51,73{74GtertiarydefUU51GTU>'ExXUU1,3,20,23,81&GerrorsUU21&GfontsUU22GtextUU46,51GtextUUandgraphics18GtfmUU le20,79GthelabelUU19,25GtimeUU64GtokensUU16&GsymbGolicUU16,42GtopUU18,38{39@P`tracingallUU61 `tracingcapsulesUU61`tracingchoicesUU61`tracingcommandsUU61`tracingequationsUU62`tracinglostcharsUU62`tracingmacrosUU62`tracingnoneUU61`tracingonlineUU12,61`tracingoutputUU62`tracingrestoresUU62`tracingspecsUU62`tracingstatsUU62`tracingtitlesUU64`transcriptUU le2`transformUU16`transformUUtypGe12,30`transformation`unknownUU32`transformedUU12,31`tro UU1,3,21,81`trueUU13`truecornersUU23`typGeUUdeclarations18`typGesUU12`ulcornerUU22`ulftUU18`hunaryUUopi14,73{74`undrawUU37`unfillUU25`unfilldrawUU37`uniformdeviateUU70`unitsquareUU66`unitvectorUU15,50`Unix^Ҏ ]21`unknownUU16`untilUU52`upUU6`uptoUU52`urcornerUU22`urtUU18`vardefUU49`vqariables`internalv12,>18{19,22{23,35,37,41,43,$`55,UU58,61,79`loGcalUU18,42`verbatimtexUU21`warningcheckUU12`whateverUU10,43`whiteUU12`windingUUnumbGer23`withcolorUU23,37,40W!T@PGAUUUser'sManualforMetaPost!í87@PGwithdotsUU32 GwithpenUU37,40GxpartUU16,32GxscaledUU30GxxpartUU32GxypartUU32GyearUU64GypartUU16,32GyscaledUU30GyxpartUU32GyypartUU32GzUUconvention9,17,50GzscaledUU30,46G[]UU18,49->;G ["Vff cmbx10': cmti10K`y cmr10o> logo10o> logosl10p0J cmsl10 b> cmmi10