<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%  
%  \begin{funclist}
%  \item  A \go
%  BBBBBBBBBBBBBBBBBB
%  good luck good luck good luck good luck good luck good luck good luck good luck
%  good luck good luck good luck good luck good luck good luck good luck good luck
%  good luck good luck good luck good luck good luck good luck good luck good luck
%  
%  \item  BBB  \go
%  DDDDDDDDDDDDDD BBBBBBBBBBBBBBBBBB sd good luck 
%  good luck good luck good luck good luck good luck good luck good luck good luck
%  good luck good luck good luck good luck good luck good luck good luck good luck
%  \end{funclist}
%  
%  \begin{lstlisting}
%  size(10cm);
%  path a=(0,0)--(1,1);
%  draw(a,red);
%  //ćŠ„ĺ˝•ä»Łç&nbsp;çŽŻĺ˘
%  //comments
%  \end{lstlisting}
%  
\include{preamble_newnew}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{wasysym}

\newlength{\deffboxsep}
\setlength{\deffboxsep}{\fboxsep}

\newcommand{\qref}[1]{~\framebox{\bfseries é—®é˘\ref{#1}}~}
\newcommand{\myfig}[1]{\par{ \setlength{\fboxsep}{0pt}
     \centering\colorbox{yellow!10!white}{
     \parbox{0.9\textwidth}{\vspace{-2mm}\begin{center}\colorbox{white}{\includegraphics{figures/#1}}\end{center}\vspace{-2mm}}
     }\\\rule{0.92\textwidth}{0.3pt}\\[-3mm]
     \setlength{\fboxsep}{\deffboxsep} }}
\begin{document}
\title{\bfseries Asymptoteä¸­çš„ĺ¸¸č§é—®é˘ďĽFAQďĽ‰}
\author{čŻ‘č€…ďĽšgoodluck@bbs.ctex.org}
\maketitle
\begin{center}
\colorbox{gray!30!white}{\parbox{0.9\textwidth}{
{\bfseries čŻ´ćŽďĽš}
\begin{itemize}
\item č‹±ć–‡ĺŽźç‰FAQčŻ·ĺŹ‚č§ \url{http://asymptote.sourceforge.net/FAQ/}ă€‚
\item ĺŻąĺş”1.57ç‰ć—¶çš„FAQďĽŚä¸Ťčż‡FAQéšŹç‰ćś¬ĺŹĺŠ¨ä¸Ťĺ¤§\raisebox{-1pt}{\Large\smiley}ă€‚
\item ç›´čŻ‘ć„ŹčŻ‘ç»“ĺďĽŚĺ°˝é‡ŹäżťćŚĺŽźć„ŹďĽ›ä¸şéżĺ…Ťć··ć·†ďĽŚćś‰äş›čŻŤćŻ”ĺ¦‚pictureç­‰ćś‰ć—¶ć˛ˇćś‰çż»čŻ‘ă€‚
\item ä¸şäş†ć–ąäľżç†č§ŁďĽŚč˝ç”źćĺ›ľçš„ä»Łç&nbsp;é˝é™„ćś‰ĺ…¶ç”źćçš„ĺ›ľĺ˝˘ă€‚
\item ćŽ’ç‰ç»†čŠ‚ä¸ŠďĽŚćś‰äş›ä¸Ťä¸€č‡´çš„ĺś°ć–ąďĽŚčŻ·čŻ»č€…č§č°…ă€‚
\item č„šćł¨ä¸şčŻ‘č€…çš„ä¸€äş›ç†č§ŁďĽŚä»…äľ›ĺŹ‚č€ă€‚
\item ç”±äşŽčŻ‘č€…č°ć°´ĺąłćś‰é™ďĽŚçż»čŻ‘ä¸Ťĺ‡†ç”šč‡łé”™čŻŻçš„ĺś°ć–ąĺś¨ć‰€éšľĺ…ŤďĽŚć¬˘čżŽĺ¤§ĺ®¶ćŚ‡ć­Łă€‚
\item é‡Ťç‚ąć„źč°˘CTEXč®şĺť›ä¸Š cvgmt ĺ’Ś milksea ćŹäľ›çš„čµ„ćşä»ĄĺŹŠćś‰ç›Šč®¨č®şĺ’Śĺ¸®ĺŠ©ă€‚
\end{itemize}
}}
\end{center}

\section{\label{Q1}ĺ…łäşŽAsymptote}
\subsection{\label{Q1.1}ä»€äąćŻAsymptote}
AsymptotećŻä¸€ç§Ťä¸şäş†ç»ĺ¶ćŠ€ćśŻĺ›ľĺ˝˘č€Śč®ľč®ˇçš„çź˘é‡Źĺ›ľčŻ­č¨€ďĽŚĺ…¶çµć„źćťĄč‡ŞMetaPostďĽŚĺ®ĺ…·ćś‰IEEEć&nbsp;‡ĺ‡†çš„ćµ®ç‚ąć•°ć”ŻćŚă€ĺŽźç”źçš„ä¸‰ç»´ĺ›ľĺ˝˘ć”ŻćŚă€
ç°ĺş¦/RGB/CMYKç­‰ä¸ŤĺŚč‰˛ĺ˝©ćŚ‡ĺ®šć–ąĺĽŹä»ĄĺŹŠç±»äĽĽC++çš„čŻ­ćł•ă€‚ä¸ŽMetaPostä¸ŤĺŚďĽŚAsymptoteĺŽźç”źçš„ć”ŻćŚĺ¤šć®µč·Żĺľ„
ďĽĺ›&nbsp;ć­¤ä¸Ťĺ±€é™äşŽĺŤ•čżžé€šĺŚşĺźźďĽ‰ă€ĺˇ«ĺ……ĺ›ľćˇă€Gouraud çť€č‰˛ďĽshadingďĽ‰ä»ĄĺŹŠPostScriptĺ›ľĺŹă€‚

\subsection{\label{Q1.2}ĺ¦‚ä˝•čŽ·ĺľ—AsymptoteďĽź}
ĺ®Ść•´çš„ćşä»Łç&nbsp;ä»ĄĺŹŠĺźşäşŽLinuxă€MacOS Xä»ĄĺŹŠĺľ®č˝ŻWindowsĺąłĺŹ°çš„äşŚčż›ĺ¶ä»Łç&nbsp;é˝ĺŹŻä»Ąĺś¨ç˝‘ĺť€
\url{http://asymptote.sourceforge.net/}ć‰ľĺ°ă€‚č®¸ĺ¤šLinuxĺŹ‘čˇŚç‰ďĽćŻ”ĺ¦‚RedHatĺ’ŚDebianďĽ‰
ĺ·˛ç»ŹĺŚ…ĺ«ćś‰Asymptoteč˝Żä»¶ĺŚ…ďĽčż›ä¸€ć­ĄäżˇćŻčŻ·ĺŹ‚č€ä˝&nbsp;ć‰€ä˝żç”¨ĺŹ‘čˇŚç‰çš„ć–‡ćˇŁďĽ‰ă€‚

\subsection{\label{Q1.3}ć‘ĺś¨ĺ“Şé‡Śč˝é—®ĺ…łäşŽAsymptoteçš„é—®é˘ďĽź}
ĺ¦‚ćžść‚¨ćś‰ç–‘é—®ďĽŚčŻ·ĺ°ťčŻ•ä»Žčż™ä¸Şâ€śĺ¸¸č§é—®é˘â€ťĺŻ»ć‰ľç­”ćˇďĽŚĺ¦‚ćžśä¸ŤčˇŚçš„čŻťĺŹŻä»ĄĺŹ‚č€ć‰©ĺ±•ć–‡ćˇŁ
\url{http://asymptote.sourceforge.net/doc/}ć–ćśç´˘č®şĺť›ďĽš
\url{http://sourceforge.net/forum/forum.php?forum_id=409349}ă€‚

\subsection{\label{Q1.4}ä¸şä»€äąé€‰ć‹©Asymptote\protect\footnotemark ä˝śä¸şĺŤĺ­—ďĽź}
\footnotetext{čŻ‘č€…ćł¨ďĽšasymptoteĺś¨č‹±čŻ­ä¸­ä¸şâ€ść¸čż‘çşżâ€ťçš„ć„Źć€ťă€‚}
ĺ›&nbsp;ä¸şĺ®čżä¸ŤćŻä¸€ä¸Şĺ®ŚçľŽçš„ĺ›ľĺ˝˘ĺŚ…ďĽŚä˝†ćŻć‘ä»¬çˇ®ĺ®žĺ¸Śćś›ĺ®ć¸čż›çš„č¶‹äşŽĺ®ŚçľŽâ€¦â€¦

\subsection{\label{Q1.5}ĺś¨Asymptoteçš„ĺ†…é¨ćşä»Łç&nbsp;ä¸­ďĽŚcampčż™ä¸ŞĺŤĺ­—ćŚ‡çš„ćŻä»€äąďĽź}
é‚ŁćŻć‘ä»¬ĺś¨Asymptotečż™ä¸Şéˇąç›®ä¸­ćś€ĺťĺŹ–çš„ä¸€ä¸Şćµ‹čŻ•ç”¨çš„ĺŤĺ­—ďĽŚĺ®ä»Łčˇ¨â€śC's Answer to MetaPostâ€ť\footnote{%
čŻ‘č€…ćł¨ďĽšçż»čŻ‘ćä¸­ć–‡ĺ°±ćŻâ€śMetaPosté—®é˘çš„CčŻ­č¨€ç­”ćˇâ€ť}ďĽAsymptoteçš„çµć„źćťĄćşäşŽMetaPostčŻ­č¨€ďĽ‰ă€‚
ä¸Ťčż‡ďĽŚć‘ä»¬ćś€ç»ĺ†łĺ®šç”¨Asymptotečż™ä¸ŞĺŤĺ­—ďĽŚĺ›&nbsp;ä¸şĺ®ć›´ĺĄ˝çš„ĺĽşč°äş†čż™ä¸ŞčŻ­č¨€çš„ć•°ĺ­¦ĺŹŠĺ›ľĺ˝˘ćś¬č´¨ă€‚

\section{\label{Q2}ĺ…łäşŽĺ®‰čŁ…ĺ’Śč®ľç˝®çš„é—®é˘}
\subsection{\label{Q2.1}č˝ĺś¨MacOS Xä¸Šĺ®‰čŁ…Asymptoteĺ—ďĽź}
ĺľç®€ĺŤ•ďĽŚä»Ž~\url{http://sourceforge.net/project/showfiles.php?group_id=120000}čŽ·ĺŹ–ćşä»Łç&nbsp;ĺą¶ç›´ćŽĄçĽ–čŻ‘ĺŤłĺŹŻă€‚
ć‘ä»¬ćŽ¨čŤć‚¨é¦–ĺ…ĺ°†ć‚¨çš„GNU readlineĺş“ć›´ć–°ĺ°ćś€ć–°ďĽŚé™¤éťžć‚¨ä¸Ťéś€č¦readlinećŹäľ›çš„äş¤äş’ĺĽŹć”ŻćŚďĽĺ®‰čŁ…ć—¶configureäĽšč‡ŞĺŠ¨
ćŁ€ćµ‹ĺą¶ç¦ç”¨čż‡ć—¶çš„readlineĺş“ç‰ćś¬ďĽ‰ă€‚Marius Schamschulaäąźç»´ćŠ¤çť€ä¸€ä¸Şé€‚ç”¨äşŽĺ„ç§ŤMacOS XĺąłĺŹ°çš„äşŚčż›ĺ¶ĺŚ…
\url{http://www.hmug.org/pub/MacOS_X/X/Applications/Publishing/asymptote}ă€‚

\subsection{\label{Q2.2}ĺ˝“ć‘ç”¨äşŚčż›ĺ¶ĺŚ…ĺś¨MAC OSä¸Šĺ®‰čŁ…Asymptoteć—¶ďĽŚä¸şä»€äąĺľ—ĺ°čż™ć&nbsp;·ä¸€ä¸Şé”™čŻŻďĽšBad CPU type in executableďĽź}
čż™ć„Źĺ‘łçť€č¦äąä˝&nbsp;çš„äşŚčż›ĺ¶ĺŚ…ćŻé€‚ç”¨äşŽĺŹ¦ä¸€MACä˝“çł»ç»“ćž„çš„ďĽŚč¦äąďĽć&nbsp;ąćŤ®Marius Schamschulaçš„č§Łé‡ŠďĽ‰ćŻä˝&nbsp;çĽşĺ°‘ćźä¸Şĺş“ă€‚
ćś€ç®€ĺŤ•çš„č§Łĺ†łĺŠžćł•ćŻç›´ćŽĄä»Žĺ®ć–ąćş~\url{http://sourceforge.net/project/showfiles.php?group_id=120000}čŽ·ĺľ—
ĺą¶çĽ–čŻ‘ćşä»Łç&nbsp;ă€‚

\subsection{\label{Q2.3}ĺ˝“ć‘ç”¨./configure --enable-gc=systemčż›čˇŚé…Ťç˝®ć—¶ďĽŚä¸şä»€äąĺľ—ĺ°čż™ä¸Şé”™čŻŻďĽš can't locate file for: -lgccpp ďĽź}
čż™čŻ´ćŽä˝&nbsp;çł»ç»źé‡Śçš„Boehmĺžĺśľĺ›žć”¶ĺ™¨ç‰ćś¬ä¸Ťĺ®Ść•´ă€‚čŻ·ć&nbsp;ąćŤ®INSTALLć–‡ä»¶ä¸­çš„ćŚ‡ä»¤ĺŽ»ĺšďĽšä»Ž~\url{http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source}
čŽ·ĺľ—ćś€ć–°çš„gcç‰ćś¬ďĽŚĺą¶ćŠŠĺ®ć”ľĺ°Asymptotećşä»Łç&nbsp;ç›®ĺ˝•çš„ćś€ä¸Šĺ±‚ďĽŚç„¶ĺŽ ./configure ďĽä¸Ťč¦ĺŠ&nbsp; --enable-gc=system é€‰éˇąďĽ‰ă€‚

\subsection{\label{Q2.4}ĺ¦‚ćžśĺ‡şçŽ°čż™ä¸Şé”™čŻŻć€ŽäąĺŠžďĽšError: pdfetex (file pdftex.cfg): 
cannot open config files...texinfo.tex appears to be broken}
ĺŹŞéś€ćŠŠ~\url{http://asymptote.sourceforge.net/asymptote.pdf}ć”ľĺ°docç›®ĺ˝•ä¸‹ç„¶ĺŽé‡Ťĺ¤Ťć‰§čˇŚmake allă€‚
ć–č€…ĺ¦‚ćžśä˝&nbsp;ä¸Ťćłĺ›ĺ»şćś¬ĺś°ć–‡ćˇŁďĽŚĺŹŞéś€čż›čˇŚ make install-asyă€‚

\subsection{\label{Q2.5}ĺ¦‚ćžśĺľ—ĺ°čż™ä¸Şé”™čŻŻć€ŽäąĺŠžďĽš! Undefined control sequence. l.6 @copying?}
č¦äąĺŤ‡çş§ä˝&nbsp;çš„texinfoĺŚ…ďĽŚč¦äąćŚ‰\qref{Q2.4}ä¸­çš„ć–ąćł•ç®€ĺŤ•ĺ¤„ç†ă€‚

\subsection{\label{Q2.6}č˝ćŠŠAsymptoteé›†ćĺ° LaTeX ä¸­ĺ—ďĽź}
ĺŹŻä»ĄďĽŚčŻ·ĺŹ‚č€äľ‹ĺ­latexusage.texă€‚Dario Teixeira äąźĺ†™äş†ä¸€ä¸Şĺ…łäşŽć­¤čŻťé˘çš„čŻ¦ç»†ćŚ‡ĺŻĽă€‚ä˝&nbsp;ĺŹŻä»Ąä»Ž
\url{http://dario.dse.nl/projects/asylatex/}ä¸‹č˝˝ĺ°ă€‚

Philippe Ivaldi ä¸şEmacsç”¨ć·ćŹäľ›äş†ä¸€ä¸ŞAsymptoteć¨ˇĺĽŹ~\url{http://asymptote.sourceforge.net/doc/Editing-modes.html}ďĽŚĺ®
ĺŚ…ĺ«ä¸€ä¸Şlasy-modeďĽŚĺ…č®¸ç”¨ć·ä¸€ć¬ˇçĽ–čŻ‘ä¸€ä¸Ş~\verb|\begin{asy}...\end{asy}|~çŽŻĺ˘ĺą¶ćźĄçś‹ç»“ćžśă€‚

\subsection{\label{Q2.7}č˝ćŠŠAsymptoteé›†ćĺ°latexć–pdflatex ä¸­ĺ—ďĽź}
ćŻçš„ďĽŚč‡Şä»Ž1.14ç‰ćś¬čµ·ďĽŚAsymptoteĺ°±ĺĽ€ĺ§‹ć”ŻćŚlatexĺ’ŚpdflatexďĽEPS/PDFĺ’Śĺ†…ĺµŚć¨ˇĺĽŹé˝ć”ŻćŚďĽ‰ďĽŚĺ¦‚äľ‹ĺ­ latexusage.texä¸­ć‰€ç¤şďĽš
\begin{verbatim}
pdflatex latexusage
asy latexusage
pdflatex latexusage
\end{verbatim}

\subsection{\label{Q2.8}ĺ˝“ć‘ĺ®‰čŁ…Asymptoteçš„rpmäşŚčż›ĺ¶ĺŚ…ć—¶ćŻĺ¦éś€č¦tkinterĺŚ…ďĽź}
ä¸Ťéś€č¦tkinterĺŚ…ďĽŚé™¤éťžä˝&nbsp;ćłĺ°ťčŻ•ĺ›ľĺ˝˘ç•Śéť˘xasyă€‚čŻ·ĺ°ťčŻ•
\begin{verbatim}
rpm -Uvh --nodeps asymptote-x.xx-1.i386.rpm
\end{verbatim}
ĺ…¶ä¸­ x.xx ä»Łčˇ¨ç‰ćś¬ĺŹ·ă€‚ 

\subsection{\label{Q2.9}č·Żĺľ„ \%USERPROFILE\%$\backslash$.asy$\backslash$config.asy ćŻä»€äąć„Źć€ťďĽź}
é‚ŁćŻĺľ®č˝ŻWindowsĺŻąç”¨ć·é…Ťç˝®ç›®ĺ˝•çš„ĺĽ•ç”¨ă€‚čż™ä¸Şĺ®žĺś¨ć˛ˇä»€äąéś€č¦äş†č§Łçš„ďĽŚĺŹŞéś€č¦ćŠŠä˝&nbsp;çš„é…Ťç˝®ĺ‘˝ä»¤
ĺ†™ĺ…Ąć–‡ä»¶config.asyĺą¶ĺ°†čŻĄć–‡ä»¶ć”ľĺ…Ąä¸€ä¸Şć–°çš„ç›®ĺ˝•~\verb|%USERPROFILE%\.asy|~ä¸­ĺŤłĺŹŻă€‚

\subsection{\label{Q2.10}ĺ˝“ć‘ĺ°ťčŻ•č®ľç˝® settings.dir="C:$\backslash$asymptote$\backslash$"; ć—¶ä¸şä»€äąĺľ—ĺ°é”™čŻŻ 
       "string not terminated"ďĽź}
čż™é‡ŚĺŹŤć–śćť&nbsp;ćŻä¸€ä¸Şč˝¬äą‰ĺ­—ç¬¦ďĽŚĺ›&nbsp;ć­¤ \verb|\"| č§Łé‡Šä¸şĺĽ•ĺŹ·ćś¬čş«ďĽŚĺŻĽč‡´ĺ­—ç¬¦ä¸˛ć˛ˇćś‰ç»“ćťźçš„ĺŹŚĺĽ•ĺŹ·ďĽŚĺą¸čżçš„ćŻďĽŚĺŹŤć–śćť&nbsp;ćŻ
ç”¨ĺŹŚĺĽ•ĺŹ·ĺ®šç•Śçš„ĺ­—ç¬¦ä¸˛ä¸­ĺ”Żä¸€çš„č˝¬äą‰ĺ­—ç¬¦ă€‚čż™é‡ŚďĽŚćś€ĺŽçš„é‚Łä¸ŞĺŹŤć–śćť&nbsp;ćŻä¸Ťéś€č¦çš„ďĽŚä˝†ĺ¦‚ćžśä˝&nbsp;çˇ®ĺ®žéś€č¦ä¸€ä¸ŞĺŹŤć–śćť&nbsp;ďĽŚĺŹŻä»Ą
čż™ć&nbsp;·ĺ†™ďĽš\verb|settings.dir="C:\asymptote"+'\\';|ă€‚

\subsection{\label{Q2.11}ĺś¨ĺľ®č˝ŻWindowsä¸‹ć‘ĺ¦‚ä˝•ć”ąĺŹçŽŻĺ˘ĺŹé‡ŹďĽŚćŻ”ĺ¦‚ďĽŚč¦ĺ¦‚ä˝•ć”ąĺŹé»č®¤çš„PostScriptćźĄçś‹ĺ™¨ďĽź}
ĺ…¶ĺ®žĺś¨ä˝&nbsp;çš„config.asyć–‡ä»¶ä¸­č®ľç˝®ç›¸ĺş”çš„Asymptoteé…Ťç˝®ĺŹé‡ŹäĽšć›´ĺ®ąć“ä¸€äş›ă€‚ĺ¦‚ćžśč¦ć”ąĺŹWindowsçŽŻĺ˘ĺŹé‡ŹďĽŚĺŹŻćŚ‰ĺ¦‚ä¸‹ć­ĄéŞ¤ďĽš
\begin{itemize}
\item ĺŹłĺ‡»â€ść‘çš„ç”µč„‘â€ť
\item ä»ŽĺĽąĺ‡şčŹśĺŤ•ä¸­é€‰ć‹©ĺ±žć€§
\item ĺŤ•ĺ‡»â€śé«çş§â€ťć&nbsp;‡ç­ľ
\item ĺŤ•ĺ‡»â€ťçŽŻĺ˘ĺŹé‡Źâ€śćŚ‰é’®
\end{itemize}

\subsection{\label{Q2.12}ĺś¨ĺľ®č˝ŻWindows XPä¸‹ďĽŚä¸şä»€äąć‘ĺľ—ĺ°čż™ć&nbsp;·çš„é”™čŻŻďĽš"Invalid Parameter - 432x432"ďĽź}
čż™ć„Źĺ‘łçť€ImageMagickć˛ˇćś‰ĺ®‰čŁ…ć­Łçˇ®ďĽŚä˝&nbsp;ĺś¨ä˝żç”¨çš„ćŻMSDOSçš„covertç¨‹ĺşŹč€Śä¸ŤćŻImageMagickä¸­çš„convertă€‚
äąźćś‰ĺŹŻč˝č™˝ç„¶ä˝&nbsp;ć­Łçˇ®ĺ®‰čŁ…äş†ImageMagickĺŤ´ćŻĺś¨ä¸€ä¸ŞçŽ°ćś‰çš„MSDOSçŞ—ĺŹŁä¸­čżčˇŚçš„Asymptoteă€‚ĺ¦‚ćžśćŻčż™ç§Ťć…ĺ†µďĽŚ
ĺŹŞéś€ć‰“ĺĽ€ä¸€ä¸Şć–°çŞ—ĺŹŁé‡ŤčŻ•ă€‚ĺ¦‚ćžśčżä¸ŤčˇŚďĽŚčŻ·ćŁ€ćźĄĺ¦‚ä¸‹ĺ‘˝ä»¤
\begin{verbatim}
convert --version
\end{verbatim}
ćŻĺ¦čż”ĺ›žç±»äĽĽčż™ć&nbsp;·çš„äżˇćŻďĽš Version: ImageMagick 6.2.8 06/27/06 Q16 http://www.imagemagick.org ă€‚

\subsection{\label{Q2.13}ĺľ®č˝ŻWindowsä¸‹čŁ…ćś‰MikTeXďĽŚä¸şä»€äąĺ˝“čŻ•ĺ›ľç”»ä¸€ä¸Şlabelć—¶Asymptoteć˛ˇĺŹŤĺş”äş†ďĽź}
čż™ćś‰ĺŹŻč˝ć„Źĺ‘łçť€latexĺ’Śdvipsä¸Ťĺś¨ä˝&nbsp;çš„é»č®¤č·Żĺľ„ä¸­ďĽŚĺ°ťčŻ•ĺ°†ĺ¦‚ä¸‹čˇŚĺŠ&nbsp;ĺ…Ąĺ°ä˝&nbsp;çš„config.asyć–‡ä»¶ä¸­ďĽš

\begin{verbatim}
import settings;
latex="C:\texmf\miktex\bin\latex.exe";
dvips="C:\texmf\miktex\bin\dvips.exe";
\end{verbatim}

\section{\label{Q3}ĺ…łäşŽč·Żĺľ„ďĽpathďĽ‰çš„é—®é˘}
\subsection{\label{Q3.1}ĺ˝“ć‘ä¸şpath tesnsion ćŚ‡ĺ®šä¸€ä¸Şć•´ć•°ĺ€Ľć—¶ďĽŚä¸şä»€äąäĽšĺ‡şçŽ°čŻ­ćł•é”™čŻŻďĽź}
čż™é‡ŚĺŹ‘ç”źçš„ćŻďĽŚĺ¦‚ä¸‹ä¸€ĺŹĄ
\begin{lstlisting}
draw((0,0)..tension 2..(0,50)..(100,100));
\end{lstlisting}
č˘«ç†č§Łä¸ş
\begin{lstlisting}
draw((0,0)..tension 2. .(0,50)..(100,100));
\end{lstlisting}
ĺ›&nbsp;ć­¤2ĺŽéť˘çš„ç¬¬ä¸€ä¸Ş~.~č˘«ĺ˝“ćäş†ĺ°Źć•°ç‚ąă€‚ć•´ć•°çš„tensionĺ€Ľäą‹ĺŽĺŠ&nbsp;ä¸Şç©şć&nbsp;Ľĺ°±ĺĄ˝äş†ă€‚ 
\begin{lstlisting}
draw((0,0)..tension 2 ..(0,50)..(100,100));
\end{lstlisting}

\subsection{\label{Q3.2}ç‚ąä¸Ťĺş”čŻĄäżťćŚä¸€ć&nbsp;·ĺ¤§ĺ°Źĺ—ďĽź}
ć–‡ćˇŁä¸­ćŹĺ°ďĽš\\
â€śplainć¨ˇĺť—ä¸­ĺ®šäą‰çš„dotĺ‘˝ä»¤ç”»çš„ç‚ąĺ…·ćś‰ç”±penĺŹ‚ć•°ćŽçˇ®ćŚ‡ĺ®šçš„çşżĺ®˝ć–č€…ćŻé»č®¤çşżĺ®˝äąä»Ąä¸€ä¸Ş
çĽ©ć”ľĺ›&nbsp;ĺ­dotfactorďĽé»č®¤ĺ€Ľä¸ş6ďĽ‰ă€‚â€ť\\
ĺ›&nbsp;ć­¤ďĽŚĺ˝“ä˝&nbsp;ä˝żç”¨é»č®¤ç”»ç¬”ďĽpenďĽ‰ć—¶ďĽŚç‚ąçš„ĺ°şĺŻ¸ä¸ş 6*linewidthďĽŚä˝†ćŻĺ˝“ä˝&nbsp;ćŚ‡ĺ®šĺ…·ćś‰ćŽçˇ®çşżĺ®˝çš„ç”»ç¬”ć—¶ďĽŚ
ä˝&nbsp;ĺľ—ĺ°çš„ç‚ąçš„ĺ¤§ĺ°Źĺ°±ćŻä˝&nbsp;ćŚ‡ĺ®šçşżĺ®˝ă€‚ĺ¦‚ćžśä˝&nbsp;ĺ¸Śćś›ç¬¬ä¸€ç§Ťć…ĺ†µĺ’Śç¬¬äşŚç§Ťć…ĺ†µçš„čˇŚä¸şä¸€ć&nbsp;·ďĽŚĺŹŻä»Ąč®ľç˝® dotfactor=1ă€‚

\section{\label{Q4}ĺ…łäşŽć&nbsp;‡ćł¨ďĽlabelsďĽ‰çš„é—®é˘}
\subsection{\label{Q4.1}ĺ¦‚ä˝•ĺś¨ć&nbsp;‡ćł¨ä¸­ä˝żç”¨ĺ¸Śč…Šĺ­—ćŻŤďĽŚćŻ”ĺ¦‚~$\omega$}
ĺś¨(La)TeXä¸­ďĽŚĺ¸Śč…Šĺ­—ćŻŤĺŹŻä»Ąĺś¨ć•°ĺ­¦ć¨ˇĺĽŹä¸­ĺ®žçŽ°ďĽŚé€ščż‡ĺś¨ĺ…¶č‹±ć–‡ĺŤç§°ĺ‰ŤĺŠ&nbsp;ä¸€ä¸ŞĺŹŤć–śćť&nbsp;ĺľ—ĺ°ă€‚
ĺ›&nbsp;ć­¤ďĽŚ$\omega$~ç¬¦ĺŹ·ä˝żç”¨~\verb|"$\omega$"|~ĺľ—ĺ°ă€‚ä¸¤ä¸ŞçľŽĺ…ç¬¦ĺŹ·äą‹é—´çš„ä»»ä˝•ä¸śčĄżé˝č˘«ĺ˝“ĺš
ĺ…¬ĺĽŹçś‹ĺľ…ă€‚ĺ¤§ĺ†™ĺ¸Śč…Šĺ­—ćŻŤé€ščż‡ćŠŠĺ…¶ĺŤç§°é¦–ĺ­—ćŻŤĺ¤§ĺ†™ĺľ—ĺ°ďĽš\\
\myfig{4-1}
\begin{lstlisting}
label("$\omega$",(0,0));
label("$\Omega$",(20,0));
\end{lstlisting}

\subsection{\label{Q4.2}AsymptoteĺŹŻä»Ąä˝żç”¨çź©éµä˝śä¸şć&nbsp;‡ćł¨ĺ—ďĽź}
ĺ˝“ç„¶ĺŹŻä»ĄďĽ
\myfig{4-2}
\begin{lstlisting}
usepackage("amsmath");
label("$\begin{matrix} 1 &amp; 2 \\\ 1 &amp; 1 \end{matrix}$",(0,0));
\end{lstlisting}

\subsection{\label{Q4.3}ć‘ĺ¦‚ä˝•č®©AsymptoteĺŠ&nbsp;č˝˝ćŚ‡ĺ®šLaTeXĺ®ŹĺŚ…ďĽŚćŻ”ĺ¦‚mathptmxďĽź}
ćŠŠĺ¦‚ä¸‹ä¸€ĺŹĄĺŠ&nbsp;ĺ°ä˝&nbsp;çš„ć–‡ä»¶ĺĽ€ĺ¤´ĺŤłĺŹŻďĽš
\begin{lstlisting}
usepackage("mathptmx");
\end{lstlisting}
ćł¨ć„ŹďĽšĺ¦‚ćžśćłĺŻąć–‡ćś¬ä˝żç”¨Adobe Times Romanĺ­—ä˝“çš„čŻťďĽŚä˝&nbsp;čżĺş”čŻĄĺŠ&nbsp;ä¸ŠďĽš
\begin{lstlisting}
defaultpen(TimesRoman());
\end{lstlisting}

\subsection{\label{Q4.4}Asymptoteçš„ć&nbsp;‡ćł¨ä¸­ĺ¦‚ä˝•ä˝żç”¨ĺ›˝é™…ĺ­—ä˝“ďĽź}
čŻ·ĺŹ‚č€~\url{http://asymptote.sourceforge.net/doc/unicode.html}ă€‚

\subsection{\label{Q4.5}ć‘ĺ¦‚ä˝•ä˝żç”¨Fourierĺ­—ä˝“ďĽź}

\begin{lstlisting}
usepackage("fourier");
defaultpen(font("T1","fut\textfamilyextension","m","n"));
\end{lstlisting}

\subsection{\label{Q4.6}ćś‰ć˛ˇćś‰ĺŠžćł•ć”ąĺŹĺ°Źć•°ç‚ąçš„çš„ĺ¤–č§‚ďĽŚćŻ”ĺ¦‚ä¸Ťç”¨ç‚ąč€Śç”¨é€—ĺŹ·ďĽź}
ĺŹŞéś€ć­Łçˇ®č®ľĺ®šçł»ç»źçš„locale\footnote{čŻ‘č€…ćł¨ďĽšlocalećŻLinux/UNIXçł»ç»źä¸‹çš„ćśŻčŻ­ďĽŚç”¨äşŽ
čŻ­č¨€ă€ć—Ąćśźă€č´§ĺ¸ç­‰çš„ćś¬ĺśźĺŚ–č®ľç˝®ă€‚}ă€‚čż™ćŻä¸¤ä¸Şäľ‹ĺ­ďĽĺś¨UNIXçš„bash shellä¸‹ďĽ‰ďĽš
\begin{verbatim}
echo "label(format(0.5));" | LC_NUMERIC=it_IT asy -V -

LC_NUMERIC=it_IT asy -V lineargraph 
\end{verbatim}

\subsection{\label{Q4.7}ć‘č¦ĺ¦‚ä˝•ć‰Ťč˝ĺ°†ć&nbsp;‡ćł¨ć—‹č˝¬ďĽŚĺŚć—¶č®©ĺ®çš„ĺ·˛ĺˇ«ĺ……čľąćˇ†äżťćŚĺŚć­Ąć—‹č˝¬ĺ‘˘ďĽź}
\myfig{4-7}
\begin{lstlisting}
frame f;
label(f,"This is some text",white,Fill(blue));
add(rotate(65)*f);
\end{lstlisting}

\subsection{\label{Q4.8}ć‘ĺ¦‚ä˝•ć—‹č˝¬ä¸‰ç»´ĺ›ľä¸­çš„ć&nbsp;‡ćł¨ďĽź}
ä˝&nbsp;éś€č¦é¦–ĺ…ĺ°†tripleç±»ĺž‹ćŠ•ĺ˝±ä¸şpairç±»ĺž‹ďĽŚĺŹčż™ć&nbsp;·ďĽš

\myfig{4-8}
\begin{lstlisting}
import three;
size(100,100);

draw(rotate(90,project(Z))*"A",O--X);
\end{lstlisting}

\subsection{\label{Q4.9}ć‘ĺ¦‚ä˝•ç”»ä¸€äş›ĺ›şĺ®šĺ°şĺŻ¸çš„ć­Łć–ąĺ˝˘ĺ’Śĺś†ĺą¶ćŠŠć&nbsp;‡ćł¨ć”ľĺś¨ĺ®ä»¬çš„ä¸­ĺżďĽź}

ĺ›şĺ®šĺ°şĺŻ¸çš„ĺŻąč±ˇĺş”čŻĄç”»ĺś¨ç‹¬ç«‹çš„pictureä¸ŠďĽŚç„¶ĺŽĺ†ŤćŠŠĺ®ä»¬ć·»ĺŠ&nbsp;ĺ°currentpictureä¸Šă€‚
čż™ćŻä¸€ç§Ťć–ąćł•ďĽäąźĺŹŻĺŹ‚č€~\url{ http://asymptote.sourceforge.net/gallery/subpictures.asy}
ĺ’Ś~\url{http://asymptote.sourceforge.net/gallery/mosquito.asy}ďĽ‰ďĽš

\myfig{4-9}
\begin{lstlisting}
real u=2cm;
 
picture square;
draw(square,scale(u)*shift(-0.5,-0.5)*unitsquare);
 
picture circle;
draw(circle,scale(0.5u)*unitcircle);
 
void add(picture pic=currentpicture, Label L, picture object, pair z) { 
add(pic,object,z);
label(pic,L,z);
} 
 
add("square",square,(0,0));
add("circle",circle,(5cm,0));
\end{lstlisting}

\subsection{\label{Q4.10}äşŚĺ…ç®—ç¬¦ * ĺŹŻä»Ąç”¨ä¸€ä¸Şĺ›&nbsp;ĺ­ćťĄçĽ©ć”ľç”»ç¬”çš„é˘śč‰˛ďĽŚčż™ä¸ŞçĽ©ć”ľĺ›&nbsp;ĺ­ĺż…éˇ»ĺ°ŹäşŽ1ĺ—ďĽź}

çĽ©ć”ľĺ›&nbsp;ĺ­ĺŹŻä»Ąĺ¤§äşŽ1ďĽŚä˝†ćŻć‚¨ĺ›&nbsp;čŻĄč®°ä˝Źrgbé˘śč‰˛ĺ†é‡Źĺ°1ĺ°±éĄ±ĺ’Śäş†ă€‚\\
ĺ°ťčŻ•ĺ¦‚ä¸‹ä»Łç&nbsp;ä˝&nbsp;ĺ°±ĺľĺż«ćŽç™˝ćŻć€Žäąĺ›žäş‹äş†ďĽš
\begin{lstlisting}
write(cyan); write(0.8*cyan); write(1.5*cyan);
\end{lstlisting}
č¦ĺľ—ĺ°ćµ…ä¸€äş›çš„ \verb|cyan| é˘śč‰˛ä˝&nbsp;ĺŹŻä»Ąç”¨ \verb|white+cyan|ďĽŚčż™ĺ°†äş§ç”ź \verb|rgb(0.5,1,1)|ă€‚
ĺ¦‚ćžśä˝&nbsp;ćłč®©ćźç§Ťé˘śč‰˛ć›´ćµ…çš„čŻťďĽŚĺ°±ç›´ćŽĄćŚ‡ĺ®šrgbé˘śč‰˛ĺ§ďĽŚäľ‹ĺ¦‚ \verb|rgb(0.9,1,1)|ă€‚

ä»¤ĺ¤–ďĽŚĺś¨cmyké˘śč‰˛ç©şé—´é‡ŚďĽŚéĄ±ĺ’Śĺş¦ćŻä¸Žč‰˛č°ĺ†ĺĽ€ćťĄç‹¬ç«‹ĺ¤„ç†çš„ďĽŚčż™ć&nbsp;·ć›´ć–ąäľżďĽš
\verb|0.1*Cyan| ćµ…ďĽŚ \verb|0.9*Cyan| ć·±ă€‚ä˝&nbsp;äąźĺŹŻä»Ąčż™äąĺ†™~\verb|0.1*(red+cmyk)|ă€‚


\subsection{\label{Q4.11}ä¸şä»€äąĺś¨ć‘çš„localeä¸‹ďĽŚé€—ĺŹ·ĺ°Źć•°ç‚ąĺŽçš„ç©şç™˝é‚Łäąĺ¤§ďĽź}

LaTeXćŠŠé€—ĺŹ·ĺ˝“ćć&nbsp;‡ç‚ąč€Śä¸ŤćŻĺ˝“ćĺ°Źć•°ç‚ąă€‚č§Łĺ†łĺŠžćł•ĺ°±ćŻĺś¨ć–‡ä»¶ĺĽ€ĺ¤´ĺŠ&nbsp;č˝˝ icomma ĺŚ…ďĽš
\begin{lstlisting}
usepackage("icomma");
\end{lstlisting}

\subsection{\label{Q4.12}ĺ¦‚ä˝•é»ć­˘ texpreamble("$\backslash$usepackage[pdflatex]\{hyperref\}") ć”ąĺŹéˇµéť˘ĺ°şĺŻ¸ďĽź}

\begin{lstlisting}
texpreamble("\\usepackage[pdftex,setpagesize=false]{hyperref}");
\end{lstlisting}

\section{\label{Q5}ĺ…łäşŽç®­ĺ¤´çš„é—®é˘}
\subsection{\label{Q5.1}ć‘ĺ¦‚ä˝•ĺś¨ä¸€ćťˇč·Żĺľ„ä¸Šçš„ä»»ä˝•ä˝Ťç˝®ĺ¤„ç”»ä¸¤ä¸Şç®­ĺ¤´ďĽź}
ĺ‡č®ľč‡łĺ°‘ä¸€ä¸Şç®­ĺ¤´č˘«ĺˇ«ĺ……ďĽŚä˝&nbsp;ĺŹŻä»Ąčż™ć&nbsp;·ĺšďĽš

\myfig{5-1a}
\begin{lstlisting}
size(200); 
path g = (0,0)..(1,3)..(3,0); 
draw(g,Arrow(Relative(0.9))); 
add(arrow(g,invisible,FillDraw(black),Relative(0.5))); 
add(arrow(reverse(g),invisible,FillDraw(white,black),Relative(0.9))); 
\end{lstlisting}

ĺ¦‚ćžśä¸¤ä¸Şç®­ĺ¤´é˝ä˝żç”¨ĺˇ«ĺ……ç±»ĺž‹ \verb|NoFill|ďĽŚä˝&nbsp;ĺ°±éś€č¦ĺś¨ plain\_arrows.asyä¸­ĺ»şä¸€ä¸Şç‰ąĺ®šç‰ćś¬çš„
~\verb|arrow| ç¨‹ĺşŹäş†ďĽš

\begin{lstlisting}
void arrow(frame f, arrowhead arrowhead=DefaultHead,
           path g, pen p=currentpen, real size=0,
           real angle=arrowangle, filltype filltype=arrowhead.defaultfilltype,
           position position=EndPoint, bool forwards=true,
           margin margin=NoMargin, bool center=false);
\end{lstlisting}

\subsection{\label{Q5.2}ć‘ĺ¦‚ä˝•ĺŹŤč˝¬ä¸€ä¸Şç®­ĺ¤´ĺ¤´\protect\footnote{čŻ‘č€…ćł¨ďĽšĺ‘µĺ‘µďĽŚć˛ˇĺ†™é”™ďĽŚćŚ‡ç®­ĺ¤´çš„ĺ¤´é¨ďĽŚĺŤł arrowheadă€‚}çš„ć–ąĺ‘ďĽź}
ĺŹŞéś€ç®€ĺŤ•çš„ĺ°†č·Żĺľ„çš„ć–ąĺ‘ĺŹŤč˝¬ĺŤłĺŹŻă€‚
\myfig{5-2}
\begin{lstlisting}
path g=((0,0)--(5cm,0));
draw(reverse(g),Arrow(Relative(0.55)));
\end{lstlisting}

\subsection{\label{Q5.3}ć‘ĺ¦‚ä˝•ć”ąĺŹć‰€ćś‰ç®­ĺ¤´çš„ĺ¤§ĺ°ŹďĽź}
č¦ćŚ‡ĺ®šç®­ĺ¤´ĺ°şĺŻ¸ďĽŚä˝&nbsp;ĺŹŻä»Ąç»™ćŻŹä¸Şç”»ĺ›ľĺ±žć€§ \verb|Arrow| ćŚ‡ĺ®šä¸€ä¸Şĺ®žĺž‹ĺ°şĺŻ¸ĺŹ‚ć•°ă€‚
ĺ¦‚ćžśćłĺ…¨ĺ±€çš„ć”ąĺŹďĽŚĺŹŻä»Ąĺ¦‚ä¸‹é‡Ťč˝˝äľťčµ–ç”»ç¬”çš„ \verb|arrowsize| ĺ‡˝ć•°ďĽš

\begin{lstlisting}
arrowsize=new real(pen p=currentpen) {return 2mm;};
\end{lstlisting}

\subsection{\label{Q5.4}ć‘č˝ĺ›ĺ»şĺ…¶ĺ®çš„ç®­ĺ¤´ĺ¤´ç±»ĺž‹ĺ—ďĽź}
ä˝&nbsp;ĺŹŻä»Ąčż™ć&nbsp;·ĺ›ĺ»şč‡Şĺ®šäą‰çš„ç®­ĺ¤´ĺ¤´ďĽčż›ä¸€ć­Ąçš„äľ‹ĺ­čŻ·ĺŹ‚çś‹plain\_arrows.asyä¸­é˘„ĺ®šäą‰çš„ç®­ĺ¤´ĺ¤´ç±»ĺž‹ďĽ‰ďĽš

\myfig{5-4}
\begin{lstlisting}
arrowhead DotHead;
DotHead.head=new path(path g, position position=EndPoint, pen p=currentpen,
		      real size=0, real angle=0)
{
  if(size == 0) size=DotHead.size(p);
  bool relative=position.relative;
  real position=position.position.x;
  if(relative) position=reltime(g,position);
  path r=subpath(g,position,0.0);
  pair x=point(r,0);
  real t=arctime(r,size);
  pair y=point(r,t);
  return circle(0.5(x+y),0.5size);
};

size(100);
draw((0,0)..(1,1)..(2,0),Arrow(DotHead));
dot((2,0),red);
\end{lstlisting}
ĺ¦‚ćžśä˝&nbsp;ĺ°†č‡Şĺ®šäą‰çš„ç®­ĺ¤´ĺ¤´ç±»ĺž‹ćŹäş¤ĺ°č®şĺť›ć–čˇĄä¸č·źč¸Şçł»ç»źä¸­ďĽŚć‘ä»¬äĽšč€č™‘
ćŠŠĺ®ä»¬ĺŚ…ć‹¬ĺś¨ä»ĄĺŽçš„ç‰ćś¬ä¸­ă€‚




\section{\label{Q6}äşŚç»´ĺťć&nbsp;‡ĺ›ľçš„é—®é˘}
\subsection{\label{Q6.1}ć˛żçť€$x$č˝´çš„ć­Łĺ‘ďĽŚĺ¦‚ä˝•č˝č®©ĺ»ĺş¦ďĽticksďĽ‰ć&nbsp;‡ĺś¨$x$č˝´çš„ĺŹłäľ§č€Śĺ»ĺş¦çš„ć&nbsp;‡ćł¨ć&nbsp;‡ĺś¨ĺ·¦äľ§
\protect\footnote{čŻ‘č€…ćł¨ďĽščż™é‡Śçš„ĺ·¦ĺŹłĺľ—čż™ć&nbsp;·ç†č§ŁďĽŚĺŤłč§‚ĺŻźč€…çš„čş«ä˝“č¦ä¸Ž$x$č˝´ĺąłčˇŚ}ďĽź}
\myfig{6-1}
\begin{lstlisting}
import graph;

size(250,200,IgnoreAspect);

draw(graph(exp,-1,1),red);

xaxis("$x$",RightTicks(Label(align=left)));
yaxis("$y$",RightTicks);
\end{lstlisting}

\subsection{\label{Q6.2}ĺ¦‚ä˝•é‡Ťĺ®šä˝Ť$x$č˝´ć&nbsp;‡ćł¨ĺ°ć˛żč˝´é•żĺş¦3/4ĺ¤„ďĽź}

\myfig{6-2}
\begin{lstlisting}
import graph;

size(250,200,IgnoreAspect);

draw(graph(exp,-1,1),red);

xaxis(Label("$x$",0.75),LeftTicks);
yaxis("$y$",RightTicks);
\end{lstlisting}

\subsection{\label{Q6.3}ĺ¦‚ä˝•ĺ‘ä¸‹ç§»ĺŠ¨$x$č˝´ć&nbsp;‡ćł¨10bpďĽź}

\myfig{6-3}
\begin{lstlisting}
import graph;
size(250,200,IgnoreAspect);

draw(graph(exp,-1,1),red);

xaxis(shift(0,-10)*"$x$",LeftTicks);
yaxis("$y$",RightTicks);
\end{lstlisting}

\subsection{\label{Q6.4}ć‘č˝ĺŻąĺťć&nbsp;‡č˝´ă€č˝´ć&nbsp;‡ćł¨ĺ’Śĺ»ĺş¦ć&nbsp;‡ćł¨ç”¨ä¸ŤĺŚçš„ç”»ç¬”ĺ—ďĽź}

ĺ˝“ç„¶ĺŹŻä»Ą:
\myfig{6-4}
\begin{lstlisting}
import graph;
size(300,200,IgnoreAspect);

xlimits(-50,50);
ylimits(0,100);

xaxis(Label("$x$",MidPoint,red),Bottom,blue,LeftTicks(green));
yaxis("$y$",Left,RightTicks);
\end{lstlisting}

\subsection{\label{Q6.5}ĺ¦‚ä˝•ć›´ć”ąč˝´ć&nbsp;‡ćł¨çš„ĺ­—ä˝“ďĽź}

\myfig{6-5}
\begin{lstlisting}
import graph;
size(300,200,IgnoreAspect);

xlimits(-50,50);
ylimits(0,100);

xaxis("x",Bottom,Courier("m","n"),LeftTicks);
yaxis("$y$",Left,RightTicks);
\end{lstlisting}

\subsection{\label{Q6.6}ĺ¦‚ä˝•ć”ąĺŹĺťć&nbsp;‡č˝´ä¸Šçš„ĺ»ĺş¦ć&nbsp;‡ćł¨çš„ĺ­—ä˝“ç±»ĺž‹ďĽź}
ĺ»ĺş¦ć&nbsp;‡ćł¨é»č®¤ĺś¨TeXçš„ć•°ĺ­¦ć¨ˇĺĽŹä¸­ćŽ’ç‰ďĽŚĺ›&nbsp;ć­¤č¦ä˝żç”¨ĺ…¶ĺ®ĺ­—ä˝“ďĽŚä˝&nbsp;éś€č¦é‡Ťč˝˝é»č®¤çš„ĺ»ĺş¦ć&nbsp;ĽĺĽŹďĽš

\myfig{6-6}
\begin{lstlisting}
import graph;
size(300,200,IgnoreAspect);

xlimits(-50,50);
ylimits(0,100);

xaxis("$x$",Bottom,LeftTicks("%.4g",Courier("m","n")+fontsize(12)));
yaxis("$y$",Left,RightTicks);
\end{lstlisting}


\subsection{\label{Q6.7}ĺ¦‚ä˝•é»ć­˘č˝´ć&nbsp;‡ćł¨é‡ŤĺŹ&nbsp;ĺś¨ĺ˝Ľć­¤äą‹ä¸ŠďĽź}
%Question 6.7.  How can I prevent axes tick labels from rendering on top of each other?

ä˝&nbsp;ĺŹŻä»ĄďĽš

(1) ä¸ş \verb|LeftTicks/RightTicks/Ticsk| ćŚ‡ĺ®šĺŹ‚ć•° \verb|beginlabel=false| ĺ’Ś$/$ć– \verb|endlabel=false|ďĽ›

(2) ć‰‹ĺŠ¨ĺŽ»ćŽ‰ćŚ‡ĺ®šĺ»ĺş¦ĺŹŠĺ…¶ć&nbsp;‡ćł¨ďĽć‰‹ĺŠ¨ĺŽ»ç”»ďĽ›ĺ…łäşŽ \verb|NoZero| çš„ĺ®šäą‰čŻ·ĺŹ‚çś‹
\url{http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/base/graph.asy}ďĽ‰ďĽš

\myfig{6-7b}
\begin{lstlisting}
import graph;

size(10cm);

real f(real x) {return x^2;}
 
draw(graph(f,-2,2));

xaxis(Ticks(NoZero));
yaxis(Ticks(NoZero));

label("$0$",(0,0),SW);
\end{lstlisting}
(3) ĺŽ»ćŽ‰ćŚ‡ĺ®šĺ»ĺş¦ć&nbsp;‡ćł¨ĺą¶ć‰‹ĺŠ¨ç”»ďĽĺ…łäşŽ~\verb|NoZeroFormat|~çš„ĺ®šäą‰čŻ·ĺŹ‚č€
\url{http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/base/graph.asy}
\myfig{6-7c}
\begin{lstlisting}
import graph;

size(10cm);

real f(real x) {return x^2;}
 
draw(graph(f,-2,2));

xaxis(Ticks(NoZeroFormat));
yaxis(Ticks(NoZeroFormat));

label("$0$",(0,0),SW);
\end{lstlisting}

(4) ä˝żç”¨ĺ›ľĺ˝˘ç•Śéť˘ xasy ćťĄç§»ĺŠ¨é‡ŤĺŹ&nbsp;çš„ć&nbsp;‡ćł¨ă€‚


(5) ć”ąĺŹ~\verb|Label|~çš„ĺŹ‚ć•°~\verb|LeftTicsk|ďĽŚ\verb|RgihtTicks|ďĽŚ\verb|Ticks|~ä¸şďĽš

\begin{lstlisting}
Label(currentpen+overwrite(Move))
\end{lstlisting}

ĺŠžćł•(5)äĽšç§»ĺŠ¨ĺŹŻč˝ĺ’Śĺ‰Ťéť˘ç”»çš„ć&nbsp;‡ćł¨çš„é‡ŤĺŹ&nbsp;çš„ć&nbsp;‡ćł¨ă€‚\verb|overwrite|~çš„ĺ…¶ĺ®ĺŹŻç”¨çš„ĺŹ‚ć•°
ä¸ş~\verb|Allow|ďĽĺ…č®¸ć&nbsp;‡ćł¨é‡ŤĺŹ&nbsp;ďĽŚé»č®¤č®ľç˝®ďĽ‰ďĽŚ\verb|Suppress|ďĽé‡ŤĺŹ&nbsp;çš„ć&nbsp;‡ćł¨ć&nbsp;ąćś¬ä¸Ťç”»ĺ‡şďĽ‰ďĽŚ
\verb|SuppressQuiet|~ĺ’Ś\verb|MoveQuiet|ă€‚ćś€ĺŽä¸¤ä¸Şäş§ç”źĺ’Śç›¸ĺş”ć˛ˇćś‰~\verb|Quiet|~çš„
ĺŹ‚ć•°ĺŚć&nbsp;·çš„ç»“ćžśďĽŚĺŹŞćŻä¸Ťĺ†ŤćŹç¤şĺ“Şäş›ć&nbsp;‡ćł¨é‡ŤĺŹ&nbsp;äş†ă€‚čŻ·çś‹
\url{See:  http://asymptote.sourceforge.net/doc/Pens.html}ă€‚

č‹ĄćŻç”¨ć·ćŚ‡ĺ®š~\verb|tick|~ć•°ç»„çš„ć…ĺ†µä¸‹ďĽŚĺŹŻä»Ąé€ščż‡ć”ąĺŹć•°ç»„ĺ…ç´&nbsp;éˇşĺşŹćťĄć”ąĺŹĺ“Şäş›ć&nbsp;‡ćł¨
č˘«ç¦ć­˘ďĽsuppressedďĽ‰ć–ç§»ĺŠ¨ă€‚

\subsection{\label{Q6.8}ĺ¦‚ä˝•ĺś¨ä¸Ťč€č™‘ć&nbsp;‡ćł¨ĺ’Śĺ›ľäľ‹çš„ć…ĺ†µä¸‹ä˝żĺľ—ć‰€ç”»ĺ›ľçš„ĺŚşĺźźĺ…·ćś‰ĺ›şĺ®šĺ¤§ĺ°ŹďĽź}
ä˝&nbsp;ĺŹŻä»ĄďĽš

(1) ćŚ‡ĺ®šä¸€ä¸ŞćŽçˇ®çš„ĺŤ•ä˝ŤďĽ\verb|unitsize|ďĽ‰ďĽŚčż™ĺ°†ĺŻąä»»ä˝•ĺŻąĺ°şĺŻ¸çš„č°ç”¨ćś‰ć•ďĽš
\begin{lstlisting}
unitsize(x=1cm,y=2cm);
\end{lstlisting}

(2) ćŽçˇ®ĺ‘ŠčŻ‰AsymptoteďĽŚč®©ĺ®ćŠŠç”»ĺ›ľĺŚşĺźźć&nbsp;ĺ°„ĺ°ćŚ‡ĺ®šĺ¤§ĺ°ŹďĽš
\myfig{6-8b}
\begin{lstlisting}
import graph;
real[] x={0,1,2,3};
real[] y=x^2;
draw(graph(x,y),red);
xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks);

size(5cm,5cm,point(SW),point(NE));

label("$f_\mathrm{T}$",point(N),2N);
\end{lstlisting}

(3) ä»Ąç”¨ć·ĺťć&nbsp;‡ćŚ‡ĺ®šç‚ąçš„ä˝Ťç˝®ďĽŚç›¸ĺ˝“äşŽç»™ĺ®šĺ›ľĺŹĺ¤§ĺ°ŹďĽš
\myfig{6-8c}
\begin{lstlisting}
given picture size:

import graph;

size(250,200,IgnoreAspect);

draw(graph(exp,-1,1),red);

xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks);

fixedscaling((-1.5,-0.5),(1.5,3.5));
\end{lstlisting}

ĺś¨čż™ä¸Şäľ‹ĺ­ä¸­ďĽŚç”¨ć·ĺťć&nbsp;‡(-1.5,-0.5)ä˝ŤäşŽĺ›ľçš„ĺ·¦ä¸‹č§’ďĽŚ(1.5,3.5)ä¸şĺŹłä¸Šč§’ă€‚
ĺŹŻä»Ąä˝żç”¨čż™ä¸Şé€‰éˇąćťĄçˇ®äżťĺ¤šä¸Şĺ›ľĺ…·ćś‰ç›¸ĺŚçš„çĽ©ć”ľä»ĄĺŹŠç›¸ĺŚçš„ćś€ç»ĺ°şĺŻ¸ďĽĺŹŞéś€
äżťčŻäĽ&nbsp;ç»™ \verb|fixedscaling()| çš„ä¸¤ä¸Şĺťć&nbsp;‡ç»™ć‰€ćś‰ć&nbsp;‡ćł¨ç•™ćś‰č¶łĺ¤źçš„ç©şé—´ĺŤłĺŹŻďĽ‰ă€‚

čżĺŹŻĺŹ‚č€ \url{http://asymptote.sourceforge.net/doc/Frames-and-pictures.html}ă€‚

\subsection{\label{Q6.9}ĺ¦‚ä˝•ĺś¨ $[0,1]\times[0,2]$ čŚĺ›´ĺ†…ç”»ä¸€ä¸Şĺ‡˝ć•° $f(x)$ďĽŚč€Śä¸”čżä¸Ťç”¨ĺŽ»ç®ˇ $f(x)$ ćŻĺ¦äĽščľľĺ°ĺ›ľçš„čľąç•ŚďĽź}
ĺś¨ç”»ĺ›ľĺ‰Ťč°ç”¨ä¸€ä¸‹ĺ¸¦ćś‰ \verb|Crop| é€‰éˇą \verb|limits| ĺ‡˝ć•°ĺŤłĺŹŻďĽš
\myfig{6-9}
\begin{lstlisting}
import graph;

size(250,200,IgnoreAspect);

draw(graph(exp,-1,1),red);

limits((0,0),(1,2),Crop);

xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks);
\end{lstlisting}

čżĺŹŻĺŹ‚č€ \url{http://asymptote.sourceforge.net/doc/graph.html}ă€‚


\subsection{\label{Q6.10}ĺŹŻä»Ąč‡Şĺ®šäą‰č°č‰˛ćťżĺ—ďĽź}
ćŻçš„ďĽŚä˝&nbsp;ĺŹŻä»Ąäş§ç”źä˝&nbsp;č‡Şĺ·±çš„ \verb|pen[]| ć•°ç»„ă€‚äľ‹ĺ¦‚ďĽš

\begin{lstlisting}
int NColors=32768;
pen[] MyPalette=new pen[NColors];
real step=1/(NColors-1.0);
// Start at black: rgb(0,0,0) 
// End at yellow: rgb(1,1,0) 
for(int i=0; i &lt; NColors; ++i) { 
  real rgval=i*step;
  MyPalette[i]=rgb(rgval,rgval,0.0);
} 
\end{lstlisting}

\subsection{\label{Q6.11}ćś‰ć˛ˇćś‰ç®€ĺŤ•çš„ć–ąćł•ĺŹŻä»Ąç”»ĺ‡şćĽ‚äş®çš„é¶äąĺ‡˝ć•°ĺ›ľďĽź}
ä»Ąä¸‹äľ‹ĺ­ç»™ĺ‡şçš„ćŻčżžç»­ĺ‡˝ć•°ďĽŚĺą¶ç”¨ä¸¤ç§Ťä¸ŤĺŚć–ąćł•ć&nbsp;‡ĺ‡şäş† $x$ çš„ć•´ć•°ĺ€ĽďĽš\\
ďĽčŻ‘č€…ćł¨ďĽšä¸‹éť˘äľ‹ĺ­ä¸­çš„ä¸Šĺ›ľĺŻąĺş”ć–ąćł•ä¸€ďĽŚä¸‹ĺ›ľĺŻąĺş”ć–ąćł•äşŚă€‚ďĽ‰
\myfig{6-11a}
\myfig{6-11b}
\begin{lstlisting}
import graph;
 
size(200,200,IgnoreAspect);
 
real factorial(real t) {return gamma(t+1);} 
 
scale(Linear,Log);
 
// ç”»é¶äąĺ‡˝ć•°ĺ›ľă€‚
draw(graph(factorial,0,10));
 
// ć–ąćł• 1: ĺŹŞç”»ç»“ç‚ąďĽŚćŠŠçşżéšč—Ź
pair F(int t) {return (t,factorial(t));} 
// ä»Ž 0 ĺ° 10 çš„é¶äąĺ›ľ
pair[] z=sequence(F,11);
// čŻ‘č€…ćł¨ďĽšä¸‹éť˘çš„ above=true ĺŹ‚ć•°ĺ¤„ĺś¨ĺŽź FAQ ä¸­ç»™çš„ćŻ Below ďĽŚä˝†çĽ–čŻ‘ä¸Ťé€ščż‡ă€‚
draw(graph(z),invisible,marker(scale(0.8mm)*unitcircle,blue,Fill,above=true));
 
// ć–ąćł• 2: éťžä˝śĺ›ľç¨‹ĺşŹč¦ćŚ‡ĺ®šćŽçˇ®çš„çĽ©ć”ľ (scaling):
pair dotloc(int t) {return Scale(F(t));} 
pair[] dotlocs=sequence(dotloc,11);
dot(dotlocs);
 
xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks);
\end{lstlisting}

\subsection{\label{Q6.12}ĺś¨ä¸€ä¸Şćś‰č‡Şĺ·±ĺ°şĺŻ¸çš„ĺ›ľďĽpictureďĽ‰ä¸­ďĽŚĺ¦‚ä˝•ĺŤ•ç‹¬ćŚ‡ĺ®šćźä¸Şç‰ąĺ®šé•żĺş¦č€Śä¸Ťč˘«çĽ©ć”ľďĽź}
čż™é‡Śćś‰ä¸€ä¸Şç®€ĺŤ•çš„ć–ąćł•ćťĄĺ®žçŽ°\footnote{čŻ‘č€…ćł¨ďĽšćł¨ć„Źç®­ĺ¤´ĺŹŠä¸¤ç«Żçš„ĺ°Źçşżć®µçš„ĺ°şĺŻ¸ä¸ŤéšŹsizeč€Ść”ąĺŹă€‚}ďĽš

\myfig{6-12}
\begin{lstlisting}
size(12cm,0);
 
void distance(picture pic=currentpicture, pair A, pair B, Label L="", real n=0,
	      pen p=currentpen) 
{
  real d=3mm;
  path g=A--B;
  transform T=shift(-n*d*unit(B-A)*I);
  pic.add(new void(frame f, transform t) {
    picture opic;
    path G=T*t*g;
    draw(opic,Label(L,Center,UnFill(1)),G,p,Arrows(NoFill),Bars,PenMargins);
    add(f,opic.fit());
  });
  pic.addBox(min(g),max(g),T*min(p),T*max(p));
} 
 
pair A=(0,0), B=(3,3);
 
dot(A);
dot(B);
 
distance(A,B,"$\ell$",1);
\end{lstlisting}

\subsection{\label{Q6.13}ĺ¦‚ä˝•ä˝ż $y$ ćľç¤şä»Ą2ä¸şĺş•çš„ĺŻąć•°ĺ€ĽďĽź}

ĺŹ‚č€äľ‹ĺ­ \url{http://asymptote.sourceforge.net/gallery/2Dgraphs/log2graph.asy}ă€‚
\subsection{\label{Q6.14}ĺ¦‚ä˝•ĺś¨ĺŚä¸€ĺĽ&nbsp;ĺ›ľä¸­ĺŻąé˝ä¸¤ä¸Şĺťć&nbsp;‡ĺ›ľçš„ $x$ č˝´ďĽź}
ĺ¦‚ćžśĺ°†č¦ĺŻąé˝çš„ä¸¤ä¸Şč˝´ĺ…·ćś‰ĺŚć&nbsp;·çš„ćŻ”äľ‹ďĽscaleďĽ‰ĺŹŠĺ°şĺŻ¸ďĽŚäľ‹ĺ­ä¸­ç»™ĺ‡şäş†ä¸€ä¸Şç®€ĺŤ•çš„ć–ąćł•ďĽŚ
čŻ·ĺŹ‚č§ \url{http://asymptote.sourceforge.net/gallery/2D graphs/alignedaxis.asy}ă€‚

ä¸‹éť˘ç»™ĺ‡şçš„ćŻä¸€ä¸ŞĺŻąé˝ä»»ć„Źä¸¤ä¸Şč˝´çš„ć›´ä¸€č¬çš„ć–ąćł•ă€‚ĺŻąç¬¬äşŚä¸Şpictureč°ç”¨ \verb|fit|
ä˝żäą‹é€‚ĺĺźşäşŽç¬¬ä¸€ä¸Şpictureçš„ć°´ĺąłćŻ”äľ‹çš„ćˇ†ćž¶ďĽframeďĽ‰:

\myfig{6-14}
\begin{lstlisting}
import graph;

real width=15cm;
real aspect=0.3;

picture pic1,pic2;

size(pic1,width,aspect*width,IgnoreAspect);
size(pic2,width,aspect*width,IgnoreAspect);

scale(pic1,false);
scale(pic2,false);

real xmin1=6;
real xmax1=9;
real xmin2=8;
real xmax2=16;

real a1=1;
real a2=0.001;

real f1(real x) {return a1*sin(x/2*pi);}
real f2(real x) {return a2*sin(x/4*pi);}

draw(pic1,graph(pic1,f1,xmin1,xmax1));
draw(pic2,graph(pic2,f2,xmin2,xmax2));

xaxis(pic1,Bottom,LeftTicks());
yaxis(pic1,"$f_1(x)$",Left,RightTicks);

xaxis(pic2,"$x$",Bottom,LeftTicks(Step=4));
yaxis(pic2,"$f_2(x)$",Left,RightTicks);

yequals(pic1,0,Dotted);
yequals(pic2,0,Dotted);

pair min1=point(pic1,SW);
pair max1=point(pic1,NE);

pair min2=point(pic2,SW);
pair max2=point(pic2,NE);

real scale=(max1.x-min1.x)/(max2.x-min2.x);
real shift=min1.x/scale-min2.x;

transform t1=pic1.calculateTransform();
transform t2=pic2.calculateTransform();
transform T=xscale(scale*t1.xx)*yscale(t2.yy);

add(pic1.fit());
//čŻ‘č€…ćł¨ďĽšä¸‹éť˘ truepoint ĺ¤„ĺś¨ĺŽź FAQ ä¸­ä¸ş framepoint ďĽŚä˝†ćŻçĽ–čŻ‘ä¸Ťé€ščż‡ă€‚
real height=truepoint(N).y-truepoint(S).y;
add(shift(0,-height)*(shift(shift)*pic2).fit(T));
\end{lstlisting}

\subsection{\label{Q6.15}ĺ¦‚ä˝•ć”ąĺŹ$y$č˝´çš„ć–ąĺ‘ä˝żĺľ—č´źĺ€Ľĺ‡şçŽ°ĺś¨$y$č˝´çš„ä¸Šé¨ďĽź}
ä»Ąä¸‹ćŻä¸€ä¸Şç®€ĺŤ•çš„äľ‹ĺ­ďĽčżĺŹŻĺŹ‚č€äľ‹ĺ­ \url{http://asymptote.sourceforge.net/gallery/2D graphs/diatom.asy}
ć–ć–‡ćˇŁä¸­ĺŻą \verb|Linear(-1)| çš„č®¨č®şďĽ‰ďĽš

\myfig{6-15}
\begin{lstlisting}
import graph;
size(250,200,IgnoreAspect);

scale(Linear,Linear(-1));

draw(graph(log,0.1,10),red);

xaxis("$x$",LeftTicks);
yaxis("$y$",RightTicks);
\end{lstlisting}

\subsection{\label{Q6.16}ĺ¦‚ä˝•ç”¨ä¸€ä¸Şĺ®šäą‰äş†ä¸ŤĺŚä˝Ťç˝®ĺ¤„é˘śč‰˛çš„ĺ‡˝ć•°ĺˇ«ĺ……ä¸€ćťˇč·Żĺľ„ďĽź}
ä¸€č¬ĺ‡˝ć•°çť€č‰˛ďĽshadingďĽ‰ä»…č˘«PDFć”ŻćŚďĽŚč€Śä¸Ťč˘«PostScriptć”ŻćŚďĽŚĺ›&nbsp;č€Śĺż…éˇ»ç­‰ĺ°ć‘ä»¬
ĺĽ€ĺŹ‘ĺ‡şç›´ćŽĄçš„PDFä»Łç&nbsp;ĺŽć‰ŤčˇŚă€‚

ç›®ĺ‰Ťä¸€ä¸Şčż‘äĽĽçš„ĺ¤„ç†ć–ąćł•ĺ°±ćŻĺ’ĺ†ĺ‡şä¸€ä¸ŞćŻ”čľç»†çš„ç˝‘ć&nbsp;Ľĺą¶ć&nbsp;ąćŤ®ä¸ŤĺŚä˝Ťç˝®ĺ¤„çš„é˘śč‰˛
ĺ®šäą‰ä¸€ä¸Şć•°ç»„ \verb|pen[][]| ç„¶ĺŽĺ†Ťĺ©ç”¨ \verb|latticeshade| č°ç”¨čż™ä¸Şć•°ç»„ćťĄçť€č‰˛ă€‚


\subsection{\label{Q6.17}ćś‰ć˛ˇćś‰ĺŠžćł•ç”»ä¸€ä¸Şć˛ˇćś‰ćľĺĽŹç»™ĺ‡şçš„ĺ‡˝ć•°ďĽŚćŻ”ĺ¦‚ $(y-2)^2=x-1$ ďĽź}
ĺŹŻä»ĄďĽŚä˝żç”¨ĺŹ‚ć•°ĺ˝˘ĺĽŹďĽš

\begin{lstlisting}
y=t 
x=(t-2)^2+1 
\end{lstlisting}

ĺŹ‚č§äľ‹ĺ­ \url{http://asymptote.sourceforge.net/gallery/2Dgraphs/parametricgraph.asy}ă€‚

\subsection{\label{Q6.18}ĺŹŻä»ĄĺŹŤč˝¬ć–ć‹‰äĽ¸ä¸€ä¸Şč˝´ĺ—ďĽź}
\verb|Linear| é€ščż‡ä¸€ä¸Şĺ®žĺž‹çš„çĽ©ć”ľĺŹ‚ć•°ćťĄć‹‰äĽ¸ďĽć–ĺŹŤč˝¬ďĽ‰ĺťć&nbsp;‡č˝´ă€‚č¦çś‹ĺ°ĺťć&nbsp;‡č˝´ć‹‰äĽ¸çš„ć•ćžśďĽŚ
éˇ»çˇ®äżťĺś¨ĺ›ľĺŹçš„ \verb|size| ĺ‘˝ä»¤ä¸­ć˛ˇćś‰ćŚ‡ĺ®š \verb|IgnoreAspect|ă€‚

ç¬¬äşŚč˝´\footnote{čŻ‘č€…ćł¨ďĽšä¸»č˝´ćŚ‡ä¸‹éť˘çš„ć¨Şč˝´ĺ’Śĺ·¦čľąçš„çşµč˝´ďĽŚç¬¬äşŚč˝´ćŚ‡ä¸Šéť˘çš„ć¨Şč˝´ĺ’ŚĺŹłčľąçš„çşµč˝´ă€‚}
ĺ’Śä¸»č˝´ćś‰çť€ç›¸ĺŚçš„é•żĺş¦ďĽŚĺ›&nbsp;ć­¤ć‹‰äĽ¸ć˛ˇćś‰ć•ćžśă€‚ä˝†ćŻä»Ťç„¶ĺŹŻä»Ąé€ščż‡ \verb|Linear(-1)| 
ćťĄčż›čˇŚĺŹŤč˝¬ă€‚

\subsection{\label{Q6.19}ä¸şä»€äąć‘ä¸Ťč˝ç”¨ UnFill é€‰éˇąćťĄç”»ä¸€ä¸Şĺ…·ćś‰ç©şĺżć&nbsp;‡č®°ďĽmarkerďĽ‰çš„ĺ›ľďĽź}

\verb|UnFill| ĺś¨čż™ĺ„żä¸Ťčµ·ä˝śç”¨ćŻĺ›&nbsp;ä¸şĺ®ĺŹŞĺ˝±ĺ“Ťé‚Łä¸Şä¸€ĺĽ€ĺ§‹ĺ°±ĺ·˛ç»ŹćŠŠć&nbsp;‡č®°ç”»ä¸ŠĺŽ»äş†ä¸”ćŻćśŞč˘«
ć·»ĺŠ&nbsp;ĺ° \verb|currentpicture| ä¸Šäą‹ĺ‰Ťçš„ĺ±€é¨ćˇ†ćž¶ďĽlocal frameďĽ‰ă€‚

\myfig{6-19}
\begin{lstlisting}
import graph;
size(10cm,0);
pair[] z={(0,0),(0.5,0.5),(1,1)};
path g=graph(z);
 
draw(shift(0,.5)*g,marker(scale(5)*unitcircle,FillDraw(white)));
//čŻ‘č€…ćł¨ďĽšĺŹŻä»ĄćŻ”čľä¸€ä¸‹ä»Ąä¸‹ĺ‡&nbsp;ĺŹĄçš„ć•ćžśă€‚
//draw(shift(0,.5)*g,marker(scale(5)*unitcircle));
//draw(shift(0,.5)*g,marker(scale(5)*unitcircle,Fill));
//draw(shift(0,.5)*g,marker(scale(5)*unitcircle,UnFill));
 
xaxis(BottomTop,LeftTicks);
yaxis(LeftRight,RightTicks);
\end{lstlisting}

\subsection{\label{Q6.20}ĺ¦‚ä˝•ĺĽşĺ¶ä»¤ĺ‡&nbsp;ä¸Şĺ›ľč±ˇä˝żç”¨ĺŚä¸€ä¸Şč°č‰˛ćťżčŚĺ›´ďĽćŻ”ĺ¦‚ć•´ä¸Ş0-255çš„ç°ĺş¦čŚĺ›´ďĽ‰ďĽź}
č°č‰˛ćťżçš„é˘śč‰˛ç©şé—´ćŻä¸€çł»ĺ—é˘śč‰˛çš„čŚĺ›´ďĽŚčż™ä¸ŞčŚĺ›´ä˝śä¸şä¸€ä¸ŞĺŹ‚ć•°ĺŹŻä»Ąč˘«ćŚ‡ĺ®šďĽŚćŻ”ĺ¦‚ĺ®ĺŹŻä»Ąä¸ş \verb|Full|ďĽŚ
\verb|Automatic| ć–ä¸€ä¸ŞćľĺĽŹćŚ‡ĺ®šçš„čŚĺ›´ \verb|Range(pair min, pair max)|ă€‚
čż™é‡ŚďĽŚ\verb|Full| ćŚ‡ĺ®šĺ‡˝ć•°ĺś¨ćŠ˝ć&nbsp;·ĺŚşé—´ĺ†…ä»Žćś€ĺ°Źĺ€ĽĺŹĺ°ĺ°ćś€ĺ¤§ĺ€Ľçš„čŚĺ›´ďĽŚč€Ś \verb|Automatic| ĺ™äĽšč‡ŞĺŠ¨é€‰ć‹©
ĺé€‚çš„ä¸Šä¸‹é™ă€‚

\section{\label{Q7}ĺ…łäşŽçĽ–ç¨‹çš„é—®é˘}
\subsection{\label{Q7.1}AsymptotećŻä¸€ä¸Şč§Łé‡Šĺ™¨čżćŻä¸€ä¸ŞçĽ–čŻ‘ĺ™¨ďĽź}
AsymptotećŠŠĺ®çš„ĺ‘˝ä»¤çĽ–čŻ‘ćč‡Şĺ·±çš„č™šć‹źćśşä»Łç&nbsp;ďĽŚç„¶ĺŽĺ®ĺ°±ĺś¨č™šć‹źćśşä¸ŠčżčˇŚčż™ä¸Şč™šć‹źćśşä»Łç&nbsp;ćťĄäş§ç”źPostScriptä»Łç&nbsp;ă€‚

\subsection{\label{Q7.2}frameĺ’Śpictureäą‹é—´çš„ĺŚşĺ«ćŻä»€äąďĽź}
frame ćŻä˝żç”¨PostScriptĺťć&nbsp;‡ćťĄç”»ĺ›ľçš„ç”»ĺ¸ă€‚ĺŻąä¸€äş›ĺ»¶čżźç”»ĺ›ľç¨‹ĺşŹďĽŚĺś¨frameä¸Šç”»ĺ›ľ
ćś‰ć—¶ćŻĺż…éˇ»çš„ďĽŚč€Śä¸€č¬čŻ´ćťĄä˝żç”¨picturećťĄç”»ĺ›ľäĽšć›´ć–ąäľżă€‚čŻ·ĺŹ‚č€\qref{Q8.8}ă€‚


\subsection{\label{Q7.3}pathĺ’Śguideäą‹é—´çš„ĺŚşĺ«ćŻä»€äąďĽź}

ä¸€ćťˇpathćŻä¸€ćťˇĺ…·ćś‰çˇ®ĺ®šç«Żç‚ąĺťć&nbsp;‡çš„ä¸‰ć¬ˇć&nbsp;·ćťˇć›˛çşżă€‚

ä¸€ćťˇguidećŻä¸€ćťˇćśŞč§Łé‡Šçš„ä¸‰ć¬ˇć&nbsp;·ćťˇć›˛çşżďĽä¸€çł»ĺ—ä¸‰ć¬ˇć&nbsp;·ćťˇć›˛çşżçš„čŠ‚ç‚ąĺ’ŚćŽ§ĺ¶ç‚ąďĽ‰ă€‚
guideç±»äĽĽpathďĽŚä¸ŤĺŚçš„ćŻĺŻąguidećťĄčŻ´ä¸‰ć¬ˇć&nbsp;·ćťˇć›˛çşżćŻĺ»¶čżźĺ°ç”»ĺ›ľçš„ć—¶ĺ€™ďĽčż™ć—¶ć‰Ťč˘«č§Łé‡ŠćpathďĽ‰
ć‰Ťč®ˇç®—ďĽ›čż™ć&nbsp;·ďĽŚä¸¤ćťˇĺ…·ćś‰č‡Şç”±ç«Żç‚ąćťˇä»¶çš„guideäľżĺŹŻä»Ąĺąłć»‘çš„ćŽĄĺ°ä¸€čµ·ă€‚

\subsection{\label{Q7.4}ĺ¦‚ä˝•ć–ąäľżçš„ĺŁ°ćŽĺą¶ĺťĺ§‹ĺŚ–ä¸€ä¸Şpictureçš„ć•°ç»„ďĽź}
ä˝&nbsp;ĺŹŻä»Ąč‡Şĺ·±ĺ†™ä¸€ä¸Şĺ¦‚ä¸‹çš„ç¨‹ĺşŹďĽš
\begin{lstlisting}
picture[] picture(int n) { 
  picture[] pic;
  for(int i=0; i &lt; n; ++i) { 
    pic[i]=new picture;
    size(pic[i],19cm,0);
  } 
  return pic;
} 
 
picture[] pic=picture(6);
\end{lstlisting}

\subsection{\label{Q7.5}ćś‰ć˛ˇćś‰ĺŠžćł•ĺ®šäą‰ä¸€ä¸Şä¸€č¬ć€§çš„ĺ¤„ç†ć•°ç»„çš„ĺ‡˝ć•°ďĽäąźĺ°±ćŻčŻ´ĺŻąä»»ä˝•ç±»ĺž‹çš„ć•°ç»„é˝čˇŚďĽ‰ďĽź}
ä¸€č¬ç±»ĺž‹ĺ°šćśŞĺ®žçŽ°ă€‚ä˝†ćŻč‡łĺ°‘ç›®ĺ‰Ťä˝&nbsp;ĺŹŻä»Ąčż™ć&nbsp;·ĺ†™ďĽš
\begin{lstlisting}
typedef string T;
include F;
\end{lstlisting}
 
\begin{lstlisting}
typedef real T;
include F;
\end{lstlisting}
ĺ…¶ä¸­ F.asy ä¸­ĺŚ…ĺ«ç±»äĽĽĺ¦‚ä¸‹çš„ç±»ĺž‹ĺ®šäą‰çš„ä»Łç&nbsp;ďĽš
\begin{lstlisting}
T[] operator $(T A, T B) {return new T[] {A,B};}
\end{lstlisting}

\subsection{\label{Q7.6}ćś‰ć˛ˇćś‰ĺŠžćł•ĺś¨ĺ®šäą‰ä¸€ä¸Şç»“ćž„äą‹ĺ‰ŤĺŁ°ćŽĺ®ďĽŚäľ‹ĺ¦‚ç»“ćž„Aä¸­ć‰§čˇŚćźç§ŤĺŻąç»“ćž„Bçš„ć“Ťä˝śä˝†ćŻç»“ćž„Bä¸­ĺŚ…ĺ«Aç±»ĺž‹çš„ćĺ‘ďĽź}
Asymptoteä¸Ťć”ŻćŚć•°ćŤ®ç±»ĺž‹çš„ćŹĺ‰ŤĺŁ°ćŽă€‚ç„¶č€Śä˝&nbsp;ĺŹŻä»ĄĺµŚĺĄ—ç»“ćž„ďĽŚä»Ąäľżä¸¤ä¸Şç±»ĺž‹ĺŻąä¸¤ä¸Şç»“ćž„ä˝“ĺ®šäą‰ä¸­çš„ćźäş›é¨ĺ†é˝ĺŹŻč§ă€‚äľ‹ĺ¦‚ďĽš

\begin{lstlisting}
struct B { 
typedef void someroutine(B b);
 
static struct A { 
someroutine routine;
void init(someroutine routine) { 
this.routine=routine;
} 
} 
 
A a=new A;
string test="Testing";
} 
 
typedef B.A A;
 
A operator init() {return new A;} 
B operator init() {return new B;} 
 
 
A a;
a.init(new void(B b){write(b.test);});
 
B b;
a.routine(b);
\end{lstlisting}

\subsection{\label{Q7.7}forĺľŞçŽŻä¸­çš„éť™ć€ĺŹé‡ŹćŻĺś¨ä»€äąĺś°ć–ąĺ†é…Ť
   \protect\footnote{čŻ‘č€…ćł¨ďĽšć‰€č°“â€śĺ†é…ŤďĽallocateďĽ‰â€ťćŚ‡č˘«ĺ†é…Ťĺ†…ĺ­ĺś°ĺť€ďĽŚč˘«ĺ†é…Ťĺś°ĺť€ć&nbsp;‡ĺż—çť€ä¸€ä¸ŞĺŹé‡Źçš„čŻžç”źă€‚}çš„ďĽź}

ĺś¨ä¸‹éť˘äľ‹ĺ­ä¸­
\begin{lstlisting}
void f() { 
  for(int i=0; i &lt; 3; ++i) { 
    static int n;
    ++n;
    write(n);
  }
} 

f(); // čľ“ĺ‡ş 1, 2, 3
f(); // čľ“ĺ‡ş 4, 5, 6 ďĽŚć­¤čˇŚä¸şčŻ‘č€…ć·»ĺŠ&nbsp;
\end{lstlisting}
ĺ…¶ä¸­çš„ \verb|static| é™ĺ®ščŻŤć„Źĺ‘łçť€ĺŹé‡Ź \verb|n| ä¸ŤĺŹŞćŻĺś¨ \verb|for| ĺľŞçŽŻĺ¤–éť˘ĺ†é…Ťçš„ďĽŚ
č€Śä¸”čżćŻĺś¨ĺ‡˝ć•°äą‹ĺ¤–ă€‚ĺ¦‚ćžśä˝&nbsp;ĺ¤šć¬ˇč°ç”¨ \verb|f| ĺ°±äĽšć¸…ćĄšďĽŚä»Ťç„¶ĺŹŞćś‰ä¸€ä¸Ş \verb|n| çš„ĺ®žäľ‹ă€‚

ä¸€ä¸ŞĺŹé‡Źçš„â€śçş§ĺ«ďĽlevelďĽ‰â€ťďĽč˘«ĺ†é…Ťçš„ĺś°ć–ąďĽ‰ĺ’Śĺ®çš„â€śä˝śç”¨ĺźźďĽscopeďĽ‰â€ťďĽé€ščż‡ĺŹé‡ŹĺŤč˝ĺ¤źĺĽ•ç”¨ĺ®çš„čŚĺ›´ďĽ‰ćŻć˛ˇćś‰ĺ…łçł»çš„ă€‚
čŠ±ć‹¬ĺŹ·ć‹¬čµ·ćťĄçš„é¨ĺ†ĺŹŞĺ˝±ĺ“Ťä¸€ä¸ŞĺŹé‡Źçš„ä˝śç”¨ĺźźč€Śä¸Ťĺ˝±ĺ“Ťĺ®çš„çş§ĺ«ă€‚

ĺś¨éˇ¶çş§ä»Łç&nbsp;\footnote{čŻ‘č€…ćł¨ďĽćśŞĺż…ć­Łçˇ®ďĽŚä»…äľ›ĺŹ‚č€ďĽ‰ďĽšAsymptoteä¸­â€śçş§ĺ«â€ťçš„ĺ«äą‰ä¸ŽC++ä¸­ĺą¶ä¸Ťä¸€ć&nbsp;·ďĽŚéś€č¦ćł¨ć„Źă€‚Asymptoteä¸­éť™ć€ĺŹé‡ŹćŻĺś¨ĺ®çš„ä¸Šä¸€çş§
ä»Łç&nbsp;ä¸­ĺ†é…Ťçš„ďĽŚä¸”čŻ‘č€…ĺŹ‘çŽ°ä¸ŤĺŚçš„çş§ĺ«ćŻç”±äşŽĺś¨ĺ‡˝ć•°ć–ç»“ćž„ä˝“ĺ†…ĺ®šäą‰äş§ç”źçš„ďĽŚä˝†ćŻč±ˇ \verb|for| ĺľŞçŽŻç­‰çš„čŠ±ć‹¬ĺŹ·ĺą¶ä¸ŤäĽšć”ąĺŹĺś¨ĺ…¶
ä¸­ĺ®šäą‰çš„éť™ć€ĺŹé‡Źçš„çş§ĺ«ďĽ›č€Śĺś¨C++ä¸­ďĽŚéť™ć€ĺŹé‡ŹäĽĽäąŽĺ°±ćŻĺś¨ç´§ĺŚ…ĺ›´ĺ…¶ĺ®šäą‰çš„čŠ±ć‹¬ĺŹ·ĺ†…ĺ†é…Ťçš„ďĽŚĺ›&nbsp;č€Śç±»äĽĽC++ä»Łç&nbsp;ďĽĺ‡č®ľä˝ŤäşŽéˇ¶çş§çš„ \verb|main| ĺ‡˝ć•°ä¸­ďĽ‰
\verb|for(int i=0; i&lt;3; ++i) \{ static int n; ++n; printf("\%d ",n); \}| ĺ™čľ“ĺ‡ş1 2 3ă€‚}ä¸­éť™ć€äż®éĄ°ç¬¦ \verb|static| ć˛ˇćś‰ć„Źäą‰ďĽŚ
ĺ®äĽšäş§ç”źč­¦ĺ‘Šç„¶ĺŽč˘«ĺż˝ç•ĄďĽš
\begin{lstlisting}
for(int i=0; i &lt; 3; ++i) { 
  static int n;
  ++n;
  write(n);
}
// čľ“ĺ‡şĺ…łäşŽéˇ¶çş§éť™ć€äż®éĄ°ç¬¦çš„č­¦ĺ‘ŠďĽŚç„¶ĺŽčľ“ĺ‡ş 1, 1, 1
\end{lstlisting}

č‡Şä»Ž1.22ç‰ćś¬ďĽŚĺľŞçŽŻä˝“ä¸­ĺ†é…Ťçš„éťžéť™ć€ĺŹé‡Źĺś¨ćŻŹä¸ŞĺľŞçŽŻä¸­é˝ćŻé‡Ťć–°ĺ†é…Ťçš„ă€‚čż™ĺŹŞćś‰ĺś¨ćŻ”čľ
ć™¦ć¶©çš„ä»Łç&nbsp;ä¸­ć‰Ťéś€č¦ćł¨ć„ŹďĽŚćŻ”ĺ¦‚ĺľŞçŽŻä¸­çš„ĺŹé‡Źč˘«ĺś¨ĺľŞçŽŻä˝“ĺ†…ĺ®šäą‰çš„ä¸€ä¸Şĺ‡˝ć•°č®żé—®çš„ć…ĺ†µďĽš

\begin{lstlisting}
int f();
 
for(int i=0; i &lt; 10; ++i) { 
  int j=10*i;
  if(i == 5)
    f=new int() {return j;};
} 
 
write(f()); // čľ“ĺ‡ş 50
\end{lstlisting}

ĺľŞçŽŻä˝“ä¸­çš„ĺŹé‡Źćś€ĺ¤šĺ­ć´»ĺ°é‚Łä¸€ĺľŞçŽŻçš„ç»“ćťźďĽŚé™¤éťžĺ®ä»¬č˘«ä¸€ä¸Şĺ‡˝ć•°ĺ®šäą‰ĺĽ•ç”¨č€Śč˘«ĺ»¶é•żç”źĺ‘˝ćśźďĽŚĺ°±ĺŹä¸Šéť˘çš„ä»Łç&nbsp;é‚Łć&nbsp;·ă€‚
ĺś¨ä¸€ä¸Şĺ‡˝ć•°ä˝“ĺ†…ďĽŚĺŹé‡Źč‡łĺ°‘ĺ­ć´»ĺ°ĺ‡˝ć•°č˘«č°ç”¨ĺ®ŚďĽŚä¸Ťčż‡ç”±äşŽĺ‡˝ć•°ĺ®šäą‰ć–ĺ†…ĺ­ĺžĺśľć”¶é›†ç¨‹ĺşŹĺ…¶ç”źĺ‘˝ćśźĺŹŻč˝äĽšč˘«ĺ»¶é•żă€‚
ĺ¦‚ćžśä¸€ä¸ŞĺŹé‡ŹćŻĺś¨ć–‡ä»¶çš„éˇ¶çş§ć–äş¤äş’ĺĽŹćŹç¤şç¬¦ä¸‹ĺ®šäą‰çš„ďĽŚé‚Łäąĺ®č‡łĺ°‘ĺ­ć´»ĺ°ć–‡ä»¶ćś«ĺ°ľć–é‚Łć¬ˇäş¤äş’čżčˇŚçš„ç»“ćťźă€‚


\subsection{\label{Q7.8}ćś‰ć˛ˇćś‰asyç¨‹ĺşŹçš„č°čŻ•ĺ™¨ďĽź}
ćś‰çš„ďĽŚAsymptotećś‰ä¸€ä¸ŞĺźşäşŽčˇŚçš„č°čŻ•ĺ™¨ďĽš \url{http://asymptote.sourceforge.net/doc/Debugger}ă€‚

\subsection{\label{Q7.9}ä˝&nbsp;ä»¬ćŽĄĺŹ—Asymptoteçš„čˇĄä¸ĺ—ďĽź}

ćŽĄĺŹ—ă€‚äş‹ĺ®žä¸Šć‘ä»¬ĺ¸Śćś›ç”¨ć·č˝ćŹäş¤ĺŚ…ĺ«ć–°ç‰ąć€§çš„čˇĄä¸ďĽĺ° \url{http://sourceforge.net/tracker/?atid=685685&amp;group_id=120000}ă€‚ďĽ‰ďĽŚ
č€Śä¸ŤćŻĺŹŞéť&nbsp;ć‘ä»¬ćťĄĺ®Śćć‰€ćś‰ä»Łç&nbsp;ă€‚ćś‰ĺ¤§ĺ®¶ĺŹ‚ä¸ŽĺĽ€ĺŹ‘ć‰ŤäĽšć›´ĺż«ďĽ

\section{\label{Q8}ĺ…łäşŽAsymptoteĺ’ŚMetaPostäą‹é—´ĺŚşĺ«çš„é—®é˘}
\subsection{\label{Q8.1}Asymptoteä¸­ä»€äąä¸ŽMetaPostä¸­çš„ćŹ’ĺ€Ľç®—ç¬¦ c[a,b] ç­‰ä»·ďĽź}

\begin{lstlisting}
interp(a,b,c);
\end{lstlisting}

\subsection{\label{Q8.2}ĺ›ľçš„çĽ©ć”ľĺś¨Asymptoteĺ’ŚMetaPostä¸­ćś‰ä˝•ä¸ŤĺŚďĽź}
AsymptotećŹäľ›äş†ä¸€ç§ŤĺŹŻé€‰çš„äľżĺ©ć–ąĺĽŹćťĄč‡ŞĺŠ¨çĽ©ć”ľĺ°ç»™ĺ®šçš„ĺ›ľç‰‡ĺ°şĺŻ¸ďĽŚč€ŚMetaPostĺŹŞć”ŻćŚć‰‹ĺŠ¨çĽ©ć”ľă€‚
Asymptoteĺ»¶čżźç»ĺ¶ĺ°†č¦ç”»ĺś¨ĺ›ľä¸Šçš„ĺŻąč±ˇďĽŚĺą¶ä¸”ĺ®ĺŚşĺ†çśźĺ®žĺ°şĺŻ¸ĺŻąč±ˇĺ’Śéś€č¦ć&nbsp;ąćŤ®ĺ›ľĺ°şĺŻ¸čż›čˇŚçĽ©ć”ľçš„ĺŻąč±ˇă€‚
ç”±ć­¤äş§ç”źçš„çşżć€§č§„ĺ’é—®é˘é€ščż‡ĺŤ•çşŻĺ˝˘ć–ąćł•\footnote{čŻ‘č€…ćł¨ďĽšâ€śĺŤ•çşŻĺ˝˘ć–ąćł•ďĽsimplex methodďĽ‰â€ťćŻä¸€ç§Ťćś‰ć•
ć±‚č§Łçşżć€§č§„ĺ’ďĽlinear programmingďĽ‰é—®é˘çš„ć•°ĺ­¦ć–ąćł•ă€‚}č§Łĺ‡şă€‚

ĺ…łäşŽć—˘ĺŚ…ĺ«ç”¨ć·ĺťć&nbsp;‡ĺŹĺŚ…ĺ«çśźĺ®žĺ°şĺŻ¸ďĽPostScriptďĽ‰ĺťć&nbsp;‡çš„ĺ»¶čżźç»ĺ¶çš„äľ‹ĺ­ďĽŚĺŹŻä»Ą
ĺŹ‚č€ \url{http://asymptote.sourceforge.net/gallery/dimension.asy}ă€‚

\subsection{\label{Q8.3}ĺ¦‚ä˝•éżĺ…Ťĺ›ľçš„č‡ŞĺŠ¨çĽ©ć”ľďĽź}
ĺ¦‚ćžśä˝&nbsp;çśźçš„ĺ–ść¬˘MetaPostć–ąćł•çš„ć‰‹ĺŠ¨ďĽçˇ¬çşżçš„ďĽ‰çĽ©ć”ľçš„čŻťďĽŚä˝&nbsp;ĺŹŻä»ĄďĽš

(1) ĺŻąć•´ä¸Şĺ›ľä˝żç”¨é»č®¤ĺ°şĺŻ¸ \verb|size(0,0)| ĺą¶ć‰‹ĺŠ¨ĺ¤„ç†ć‰€ćś‰çĽ©ć”ľďĽŚĺ°±ĺŹĺś¨MetaPostä¸­ä¸€ć&nbsp;·ă€‚

(2) ç”»ä¸€ä¸Şç‹¬ç«‹çš„ĺ›ľ \verb|pic| ĺą¶ć‰§čˇŚ \verb|add(pic.fit())|ă€‚

(3) ä˝żç”¨ \verb|frame|ă€‚

\subsection{\label{Q8.4}ä¸ŽMetaPostä¸­çš„ ... ĺ‘˝ä»¤ç­‰ä»·çš„ćŻä»€äąďĽź}
čżžćŽĄç¬¦ \verb|::| ćŻ \verb|tension atleast 1| çš„ĺ®ŹďĽš

\myfig{8-4}
\begin{lstlisting}
size(100);
pair z0=(0,0);
pair z1=(1,0.25);
pair z2=(2,0);
draw(z0{up}::z1{right}::z2{down});
\end{lstlisting}

\subsection{\label{Q8.5}ä¸ŽMetaPostä¸­çš„pickupĺ‘˝ä»¤ç­‰ä»·çš„ćŻä»€äąďĽź}

ĺŹŞéś€ĺ†™ďĽŚćŻ”ĺ¦‚:

\begin{lstlisting}
currentpen=red;
\end{lstlisting}

\subsection{\label{Q8.6}ä¸ŽMetaPostä¸­çš„whateverĺ‘˝ä»¤ç­‰ä»·çš„ćŻä»€äąďĽź}
Asymptoteĺą¶ä¸Ťéšĺ«ć±‚č§Łçşżć€§ć–ąç¨‹ç»„ĺ›&nbsp;ć­¤ć˛ˇćś‰čˇ¨ç¤şćśŞçźĄçš„ \verb|whatever| ć¦‚ĺżµă€‚
čż™ç§ŤĺŠźč˝ĺ˝“ç„¶ĺŹŻä»Ąć·»ĺŠ&nbsp;ä¸ŠďĽć—˘ç„¶ \verb|=| čˇ¨ç¤şčµ‹ĺ€ĽďĽŚäąźč®¸ä˝żç”¨č®°ĺŹ· \verb|?=|ďĽ‰ă€‚
ç„¶č€ŚďĽŚMetaPostä¸­ \verb|whatever| çš„ĺ¤§é¨ĺ†ç”¨ćł•é˝ĺ·˛č˘« math.asy ä¸­çš„çš„ĺ‡˝ć•°ć‰€ĺŚ…ć‹¬äş†ďĽŚ
ĺŹ \verb|extension|ďĽš
\begin{lstlisting}
pair extension(pair P, pair Q, pair p, pair q);
\end{lstlisting}
ĺ®čż”ĺ›žçşżć®µPQĺŹŠpqçš„ĺ»¶é•żçşżçš„äş¤ç‚ąă€‚ć‘ä»¬ĺŹ‘çŽ°ä˝żç”¨ĺŹ \verb|extension| čż™ć&nbsp;·çš„ç¨‹ĺşŹć„Źäą‰ć›´ćŽçˇ®ďĽŚ
ĺŻąć–°ç”¨ć·ä¸Ťč‡´äş§ç”źčż·ć‘ă€‚ä˝†ćŻĺ¦‚ćžśćś‰äşşč˝čŻĺ®žçˇ®ĺ®žćś‰ĺż…č¦ć·»ĺŠ&nbsp;ç±»äĽĽ \verb|whatever| çš„ĺŠźč˝ďĽŚ
ć‘ä»¬ćŻĺŹŻä»Ąč€č™‘çš„ă€‚ä¸Žć­¤ĺŚć—¶ďĽŚä˝&nbsp;ć€»ćŻĺŹŻä»Ąä˝żç”¨ćŽçˇ®çš„ĺ†…ç˝®çşżć€§ć–ąç¨‹ç»„ć±‚č§Łç¨‹ĺşŹćťĄć±‚č§Łçš„ďĽŚ
ĺ†…ç˝®ć–ąćł•ä˝żç”¨çš„ćŻLUĺ†č§Łç®—ćł•ă€‚

\subsection{\label{Q8.7}ĺŻąäşŽĺ«ćś‰ä¸‰ä¸Şçşżć€§ć–ąç¨‹ä¸”ĺ…·ćś‰ä¸‰ä¸ŞćśŞçźĄé‡Ź: horiz, verti, whatever çš„çşżć€§ć–ąç¨‹ç»„ďĽŚ MetaPost ä¸­çš„ć–ąç¨‹  lray - horiz*v - verti*u = whatever*( LightSource - R ); ĺś¨ Asymptote çš„ĺŻąĺş”çš„ĺšćł•ćŻä»€äąĺ‘˘ďĽź}
ć—˘ç„¶ \verb|horiz*v+verti*u| ĺĽ&nbsp;ĺĽ€ä¸€ä¸Şĺąłéť˘ďĽŚä˝&nbsp;ĺŹŻä»Ąç”¨
\begin{lstlisting}
real intersect(vector P, vector Q, vector n, vector Z);
\end{lstlisting}
ćťĄć‰ľĺ‡şç›¸ĺş”äşŽç›´çşż \verb|lray-whatever*(LightSource - R)| çš„äş¤ç‚ąć—¶ĺ»\footnote{čŻ‘č€…ćł¨ďĽšAsymptoteä¸­çš„ćśŻčŻ­â€śtimeâ€ťďĽŚčż™é‡Śćš‚čŻ‘ä¸şâ€ść—¶ĺ»â€ťă€‚}
ç„¶ĺŽĺ†Ťä»Žä¸­čŽ·ĺŹ–ä¸‰ä¸Şč¦ć±‚çš„ĺ€Ľă€‚ďĽä˝&nbsp;ä»Ťĺ°†éś€č¦ç”¨ĺ†…ç˝®ćľĺĽŹçşżć€§ć±‚č§Łç¨‹ĺşŹćťĄč§Łä¸€ä¸Ş $2\times 2$ ć–ąç¨‹ç»„ćťĄĺľ—ĺ° \verb|horiz| ĺ’Ś \verb|verti|ă€‚ďĽ‰

\subsection{\label{Q8.8}ĺś¨MetaPostä¸­ďĽŚĺŹŻä»Ąé€ščż‡ĺ®šäą‰ä¸€ä¸ŞĺŤ•ä˝Ť u ĺą¶ćŽçˇ®äąĺś¨ćŻŹä¸Şĺťć&nbsp;‡ä¸Šçš„ć–ąćł•ćťĄĺ®žçŽ°ć‰€ç”»çš„ĺ›ľĺ˝˘ĺś¨ä¸ŤĺŚçš„ĺ›ľä¸­ĺ…·ćś‰ç›¸ĺŚçš„ĺ°şĺŻ¸ă€‚
ĺś¨Asymptoteä¸­ćś‰ć˛ˇćś‰ć›´ĺĄ˝çš„ĺŠžćł•ćťĄĺ®žçŽ°ďĽź}
ćś‰çš„ďĽŚAsymptotećś‰ć›´ĺĄ˝çš„ĺŠžćł•ďĽšä˝&nbsp;č‚Żĺ®šä¸Ťćłć‰‹ĺŠ¨çĽ©ć”ľć‰€ćś‰çš„ĺťć&nbsp;‡ă€‚č¦č®©ç”¨ć·ĺťć&nbsp;‡ä»Łčˇ¨1cmçš„ĺ€Ťć•°ďĽŚĺŹŞéś€ďĽš

\myfig{8-8a}
\begin{lstlisting}
unitsize(1cm);
draw(unitsquare);
\end{lstlisting}
ä˝&nbsp;äąźĺŹŻä»ĄćŚ‡ĺ®šä¸ŤĺŚçš„ $x$ ĺ’Ś $y$ ĺŤ•ä˝ŤďĽš
\myfig{8-8b}
\begin{lstlisting}
unitsize(x=1cm,y=2cm);
draw(unitsquare);
\end{lstlisting}
ĺŹ¦ä¸€ä¸Şć–ąćł•ćŻćŠŠä˝&nbsp;çš„ĺ›şĺ®šĺ°şĺŻ¸çš„ĺŻąč±ˇç”»ĺ°ćˇ†ćž¶ä¸Šĺ†ŤćŠŠĺ®ć·»ĺŠ&nbsp;ĺ° \verb|currentpicture| ä¸ŠďĽš
\myfig{8-8c}
\begin{lstlisting}
path p=(0,0)--(1,0);
frame object;
draw(object,scale(100)*p);
 
add(object);
add(object,(0,-10));
\end{lstlisting}
ä¸şäş†ç†č§Ł \verb|frame| ĺ’Ś \verb|picture| çš„ĺŚşĺ«ďĽŚčŻ·ĺ°ťčŻ•ĺ¦‚ä¸‹ä»Łç&nbsp;\footnote{čŻ‘č€…ćł¨ďĽščż™é‡Ś
ä»Łç&nbsp;ćś€ĺŽçš„é‚ŁĺŹĄ \verb|add(object,(0,-10));| ä¸­ďĽŚč™˝ç„¶ĺŹ‚ć•°ä¸­çš„ \verb|object|ćŻä¸€ä¸Ş \verb|picture|ĺž‹ĺŻąč±ˇďĽŚ
ä˝†ćŻĺ®žé™…ć·»ĺŠ&nbsp;çš„ĺŤ´ćŻ \verb|object.fit()|ďĽŚäąźĺ°±ćŻčŻ´ćŻä¸€ä¸Ş \verb|frame| ĺŻąč±ˇďĽŚć‰€ä»Ąčż™é‡Śçš„ćŻ”čľć‰Ťćś‰ć„Źäą‰ă€‚ä»Ž
ć‰‹ĺ†Śä¸­ \verb|add| ĺ‡˝ć•°çš„ĺŽźĺž‹ä¸­ĺŹŻä»Ąçś‹ĺ‡şďĽŚĺŹŞč¦ćŚ‡ĺ®šäş†ä˝Ťç˝®ĺŹ‚ć•°ďĽ\verb|pair| ç±»ĺž‹ďĽ‰ďĽŚé‚Łäąä¸Ťç®ˇč˘«ć·»ĺŠ&nbsp;çš„ćŻ \verb|picture|čżćŻ
\verb|frame|ďĽŚĺ…¶ĺ®žé˝ćŻćŚ‰ \verb|frame| ć–ąĺĽŹçš„PostScriptĺťć&nbsp;‡ĺ¤„ç†çš„ă€‚}ďĽš
\myfig{8-8d}
~\\[-5mm]
\begin{lstlisting}
size(300,300);
 
path p=(0,0)--(1,0);
picture object;
draw(object,scale(100)*p);
 
add(object);
add(object,(0,-10)); // ć·»ĺŠ&nbsp;çśźĺ®žĺ°şĺŻ¸ĺŻąč±ˇĺ° currentpicture 
\end{lstlisting}

\subsection{\label{Q8.9}ĺś¨MetaPostä¸­ĺŹŻä»Ąé€ščż‡ĺ…ç”źćä¸€ä¸Şĺ›ľĺ†Ťĺ°†ĺ…¶čŁĺ‰Şćä¸€ä¸Şĺ›´ç»•ĺ…¶ä¸­ĺżçš„ĺ›şĺ®šĺ¤§ĺ°Źçš„çź©ĺ˝˘ćťĄĺ¶ä˝śĺˇ«ĺ……ç”¨çš„ĺ›ľćˇďĽŚĺś¨Asymptoteä¸­ĺ¦‚ä˝•ĺ®žçŽ°ďĽź}
ĺ¦‚ćžśä˝&nbsp;ć­Łĺś¨ĺŹĺś¨MetaPostä¸­é‚Łć&nbsp;·ä˝żç”¨ \verb|currentpicture| ďĽä˝żç”¨PostScriptĺťć&nbsp;‡ç›´ćŽĄç”»ďĽ‰çš„čŻťďĽŚ
ä˝&nbsp;ĺŹŞéś€ç®€ĺŤ•çš„čż™ć&nbsp;·ĺšďĽš
\myfig{8-9a}
\begin{lstlisting}
fill((0,0)--(100,100)--(200,0)--cycle);
 
pair center(picture pic=currentpicture) {return 0.5*(pic.min()+pic.max());} 
 
real height=100;
real width=100;
pair delta=0.5(width,height);
pair c=center();
clip(box(c-delta,c+delta));
\end{lstlisting}

ç„¶č€ŚďĽŚä˝żç”¨PostScriptĺťć&nbsp;‡ç”»ĺ›ľé€šĺ¸¸ćŻä¸Ťć–ąäľżçš„ă€‚ä»Ąä¸‹ćŻAsymptoteä˝żç”¨ĺ»¶čżźç”»ĺ›ľć–ąĺĽŹćťĄĺ®žçŽ°çš„ć–ąćł•ďĽš

\myfig{8-9b}
\begin{lstlisting}
size(200,100); //čŻ‘č€…ćł¨ďĽščż™é‡ŚĺŽźćťĄćŻ size(200,0); ä˝†ĺľ—ĺ°çš„ç»“ćžśä¸Žä¸Šéť˘çš„ä¸Ťä¸€ć&nbsp;·ă€‚
fill((0,0)--(1,1)--(2,0)--cycle);
 
void clip(picture pic=currentpicture, real width, real height) 
{
pic.clip(new void (frame f, transform) { 
pair center=0.5(min(f)+max(f));
pair delta=0.5(width,height);
clip(f,box(center-delta,center+delta));
});
} 
 
clip(100,100);
\end{lstlisting}

čżĺŹŻĺŹ‚č€ć–‡ćˇŁä¸­ĺ…łäşŽĺˇ«ĺ……ďĽtilingďĽ‰çš„č®¨č®ş \url{http://asymptote.sourceforge.net/doc/Pens.html}ă€‚

\section{\label{Q9}ĺ…łäşŽčľ“ĺ‡şçš„é—®é˘}
\subsection{\label{Q9.1}ĺ˝“ĺ¤„ç†ĺ®Śä¸€ä¸Şasyć–‡ä»¶ĺŽĺ¦‚ä˝•ç¦ć­˘ĺŻąPSćźĄçś‹ĺ™¨çš„č‡ŞĺŠ¨č°ç”¨ďĽź}
äş‹ĺ®žä¸Šé»č®¤ćŻä¸Ťč‡ŞĺŠ¨č°ç”¨çš„ďĽŚé™¤éťžä˝&nbsp;ć°ĺĄ˝ćŻĺś¨ç”¨ĺľ®č˝ŻWindowsďĽĺ›&nbsp;ä¸şé‚Łć&nbsp;·ć­ŁćŻĺ¤§é¨ĺ†Windowsç”¨ć·ć‰€ĺ¸Śćś›çš„ďĽ‰ă€‚
Windowsç”¨ć·ĺŹŻä»Ąé€ščż‡ĺ‘˝ä»¤čˇŚé€‰éˇą -noV ćťĄç¦ć­˘ĺ®ďĽŚć–č€…ćŠŠĺ¦‚ä¸‹ä»Łç&nbsp;ć”ľĺ…Ą config.asy ć–‡ä»¶ä¸­ďĽš
\begin{lstlisting}
import settings;
interactiveView=false;
batchView=false;
\end{lstlisting}
čŻ·ĺŹ‚č€ \url{http://asymptote.sourceforge.net/doc/Options.html}ă€‚

\subsection{\label{Q9.2}ĺ¦‚ä˝•čľ“ĺ‡şćjpegĺ›ľĺŹďĽź}
ĺ¦‚ćžśä˝&nbsp;ĺ·˛ć­Łçˇ®ĺ®‰čŁ… ImageMagick č˝Żä»¶ĺŚ…ä¸­çš„ covert ç¨‹ĺşŹďĽŚĺŹŞéś€čľ“ĺ…Ą
\begin{verbatim}
asy -f jpg test.asy 
\end{verbatim}

\subsection{\label{Q9.3}ć‘č˝ĺ¦ĺµŚĺ…Ąä˝Ťĺ›ľďĽç…§ç‰‡ďĽ‰ĺą¶ćŚ‡ĺ®šä˝Ťç˝®ä»ĄĺŹŠĺŻąĺ…¶çĽ©ć”ľďĽź}
ćŠŠĺ®ä»¬č˝¬ćŤ˘ćepsć&nbsp;ĽĺĽŹĺą¶ä˝żç”¨ \verb|graphic(string)| ĺ‡˝ć•°ďĽŚĺ°±ĺŹä¸€ä¸Şć&nbsp;‡ćł¨ďĽš

\begin{lstlisting}
label(graphic("file"),(0,0));
\end{lstlisting}
čŻ·ĺŹ‚č€äľ‹ĺ­ \url{http://asymptote.sourceforge.net/gallery/orthocenter.asy} ĺ’Ś 
\url{http://asymptote.sourceforge.net/doc/label.html}ă€‚

\subsection{\label{Q9.4}AsymptotećŻĺ¦ć”ŻćŚç›´ćŽĄPDFčľ“ĺ‡şďĽź}
ç›®ĺ‰ŤďĽŚĺ˝“ä˝żç”¨ \verb|-f pdf| é€‰éˇąć—¶ćŻć”ŻćŚPDFč˝¬ćŤ˘çš„ďĽŚć”ŻćŚé€ŹćŽă€ćł¨č®°ä»ĄĺŹŠĺµŚĺ…Ąč§†é˘‘ĺ’Śu3dĺ›ľĺŹă€‚
ç„¶č€ŚďĽŚć‘ä»¬č®ˇĺ’ćś€ç»ĺ®žçŽ°ç›´ćŽĄçš„PDFčľ“ĺ‡şďĽŚä»Ąć”ŻćŚé‚Łäş›ĺś¨PostScriptä¸­ä¸Ťč˝ç”¨çš„ç‰ąć€§ďĽćŻ”ĺ¦‚ć&nbsp;ąćŤ®ä¸€č¬ĺ‡˝ć•°çš„çť€č‰˛ĺ¤„ç†ďĽ‰ă€‚

\subsection{\label{Q9.5}ĺ¦‚ä˝•ĺ¶ä˝śĺ…‰ć&nbsp;…ć‰«ćŹŹć&nbsp;ĽĺĽŹďĽćŻ”ĺ¦‚pngă€giffç­‰ďĽ‰çš„é«č´¨é‡Źçš„ĺ¤§ĺ›ľďĽź}
ĺ°ťčŻ•ä˝żç”¨ä¸€äş›é€‰éˇąćťĄč˝¬ćŤ˘ďĽŚä¸»č¦ćŻ \verb|-geometry| ĺ’Ś \verb|-density|ă€‚äľ‹ĺ¦‚ďĽš
\begin{verbatim}
convert -geometry 1000x3000 example.eps example.png 
\end{verbatim}
ĺş”čŻĄç»™ĺ‡şä˝&nbsp;ćłč¦çš„ĺŹç´&nbsp;ă€‚

ä˝&nbsp;äąźĺŹŻä»Ąĺ¦‚ä¸‹ć”ąĺŹĺ›ľĺŹçš„é»č®¤ĺ†čľ¨çŽ‡ďĽš
\begin{verbatim}
convert -geometry 1000x3000 -density 300 -units PixelsPerInch example.eps example.png 
\end{verbatim}
čż™ć&nbsp;·ä¸Ťć”ąĺŹĺ›ľĺŹçš„ĺŹç´&nbsp;ć•°ďĽŚĺŹŞćŻç»™ĺ‡şä¸€ä¸ŞćŻŹä¸ŞĺŹç´&nbsp;ĺş”čŻĄćľç¤şĺ¤šĺ¤§çš„ćŹç¤şă€‚

ĺ¦‚ćžśä˝&nbsp;ç”¨äş† \verb|-density| ĺŤ´ć˛ˇćś‰ç”¨ \verb|-geometry| é€‰éˇąďĽŚ convert ç¨‹ĺşŹĺ°†äżťćŚĺ›ľĺŹĺ°şĺŻ¸ä¸ŤĺŹ
ďĽĺ›&nbsp;ć­¤ä¸€ä¸Ş 4cm$\times$3cm çš„epsĺ›ľĺ°†äş§ç”źä¸€ä¸Ş4cm$\times$3cm çš„pngĺ›ľďĽ‰ă€‚

\subsection{\label{Q9.6}ç”¨AsymptoteĺŹŻä»Ąç”źćĺ¤šéˇµć–‡ćˇŁĺ—ďĽź}
ĺŹŻä»ĄďĽŚĺŹŞéś€č°ç”¨ \verb|newpage()| ĺ‡˝ć•°ă€‚ç”¨ slide.asy ćťĄĺ¶ä˝śé«č´¨é‡Źçš„ĺą»çŻç‰‡ć—¶ĺ°±čż™äąä˝żç”¨ďĽćŻ”Prosperć›´ć–ąäľżä˝żç”¨ďĽ‰ă€‚


\end{document}
</pre></body></html>