Annotation of OpenXM/src/cfep/Doc/Intro/next2.tex, Revision 1.1
1.1 ! takayama 1: % makeindex next2.idx
! 2: \documentclass{jbook}
! 3: \usepackage{html}
! 4: \usepackage{makeidx}
! 5: \usepackage{ascmac}
! 6: \usepackage[dvips]{graphicx}
! 7: \textwidth = 15cm
! 8: \textheight = 23cm
! 9:
! 10: \topmargin = 0.7cm
! 11: \evensidemargin = 0cm
! 12: \oddsidemargin = 1cm
! 13:
! 14: \def\comment#1{ #1 }
! 15: %\def\comment#1{ }
! 16: \input{asirbookmacro}
! 17:
! 18: \title{ {\bf $BD6F~Lg(B Cfep/asir (MacOS X)} }
! 19: \author{ $B9b;3?.5#(B }
! 20: \date{ 2006$BG/(B($BJ?@.(B18$BG/(B), 3$B7n(B12$BF|HG(B(cfep 1.1): $B%3%a%s%H$O(B \\ takayama@math.kobe-u.ac.jp $B$^$G(B}
! 21: \makeindex
! 22:
! 23: \begin{document}
! 24: \maketitle
! 25: \tableofcontents
! 26:
! 27: \chapter{ $BEEBn$H$7$F$NMxMQ(B } \label{chapter:next}
! 28: %en \chapter{A Tour of Asir} \label{chapter:next}
! 29:
! 30: $B?@8MBg3X$N650iMQ7W;;5!4D6-$,(B MacOS X $B$KJQ99$5$l$k$N$KH<$$(B,
! 31: $BI.<T$,65:`$H$7$FMxMQ$7$F$$$?(B Windows $B$GF0:n$9$k(B10$B?J(BBasic$B$,MxMQ$G$-$J$/$J$C$?(B.
! 32: Cfep/asir $B$O$=$NBeMQ$H$7$F(B,
! 33: 2006$BG/=iF,$+$i3+H/$r?J$a$F$$$k%7%9%F%`$G$"$k(B.
! 34: 10$B?J(BBasic$B$NM%$l$F$$$kE@$N0l$D$O(B, $BCzG+$JF~Lg2r@b$,IUB0$7$F$$$k$3$H$G$"$k(B.
! 35: ``Cfep/asir$BD6F~Lg(B'' $B$O$3$N2r@b$K$9$3$7$G$b6aIU$3$&$HEXNO$7$F$_$?(B.
! 36: Asir$B$NF~Lg%F%-%9%H$K(B ``Asir$B%I%j%k(B'' $B$,$"$k$,(B, $B$3$ND6F~Lg$G$O(B ``Asir$B%I%j%k(B''
! 37: $B$N0l>O$*$h$S$=$N@h$NF~LgE*FbMF$rCzG+$K(B($B>/!9$/$I$/(B)$B@bL@$7$?(B.
! 38:
! 39: \bigbreak
! 40:
! 41: $B$3$N@a$G$O(B MacOS X $B$G$N(B cfep/asir $B$N5/F0K!(B, $BEEBnIw(B, Basic$BIw$N;H$$J}$r@bL@$9$k(B.
! 42: $B%U%!%$%k$NJ]B8Ey(B MacOS X $B$N6&DL$NA`:nJ}K!$K$O$[$H$s$I$U$l$F$$$J$$$,(B,
! 43: cfep/asir $B$O(B MacOS X $BI8=`$N%U%!%$%k$NJ]B8Ey$rMQ$$$F$$$k$N$G(B,
! 44: $B$3$N$h$&$JItJ,$G$OB>$N%=%U%H%&%(%"$HMxMQJ}K!$OF10l$G$"$k(B.
! 45: $B=i?4<T$N?M$OE,Ev$JK\$d%,%$%I$r;2>H$5$l$?$$(B.
! 46:
! 47:
! 48: \section{$B%-!<A`:n$HMQ8l$NI|=,(B}
! 49:
! 50: \noindent
! 51: $B%-!<%\!<%I(B, $B%^%&%9$NA`:n$NMQ8l(B.
! 52: \begin{enumerate}
! 53: %
! 54: \item
! 55: \fbox{\tt Command} $B%-!<$d(B
! 56: \fbox{\tt ALT } $B%-!<$d(B \fbox{\tt SHIFT} $B%-!<$d(B
! 57: \fbox{\tt CTRL } $B%-!<$OB>$N%-!<$H0l=o$K2!$9$3$H$G;O$a$F5!G=$9$k(B
! 58: $B%-!<$G$"$k(B.$B$3$l$i$@$1$rC1FH$K2!$7$F$b$J$K$b$*$-$J$$(B.
! 59: $B0J8e(B \fbox{\tt SHIFT} $B%-!<$r$*$7$J$,$iB>$N%-!<$r2!$9A`:n$r(B
! 60: \shift{$B$-!<(B} $B$H=q$/$3$H$K$9$k(B. command $B%-!<(B, alt $B%-!<(B, ctrl $B%-!<$K$D$$$F$b(B
! 61: $BF1MM$G$"$k(B.
! 62: %
! 63: \item
! 64: \shift{a} $B$H$9$k$HBgJ8;z$N(B A $B$rF~NO$G$-$k(B.
! 65: %
! 66: \item
! 67: \fbox{\tt BS} $B$H$+(B \fbox{\tt DEL} $B$H=q$$$F$"$k%-!<2!$9$H0lJ8;zA0$r>C5n$G$-$k(B.
! 68: %
! 69: \item $BF|K\8l%-!<%\!<%I$N>l9g(B \fbox{{\tt $\backslash$}}
! 70: ($B%P%C%/%9%i%C%7%e(B) $B$O(B \alt{\yen} $B$GF~NO$G$-$k(B.
! 71: %
! 72: \item
! 73: \fbox{\tt SPACE} $B%-!<$O6uGr$rF~NO$9$k%-!<$G$"$k(B.
! 74: $B7W;;5!$NFbIt$G$OJ8;z$O?t;z$KJQ49$5$l$F3JG<$*$h$S=hM}$5$l$k(B.
! 75: $BJ8;z$KBP1~$9$k?t;z$rJ8;z%3!<%I$H8F$V(B. $BJ8;z%3!<%I$K$O$$$m$$$m$J<oN`$N$b$N$,$"$k$,(B,
! 76: $B0lHV4pACE*$J$N$O%"%9%-!<%3!<%I7O$G$"$j(B, $B%"%k%U%!%Y%C%H$d?t;z(B, $B%-!<%\!<%I$K8=$l$k(B
! 77: $B5-9f$J$I$r%+%P!<$7$F$$$k(B. $B4A;z$O%"%9%-!<%3!<%I7O$G$OI=8=$G$-$J$$(B.
! 78: \fbox{A} $B$N%"%9%-!<%3!<%I$O(B 65$BHV$G$"$k(B. $B0J2<(B \fbox{B} $B$,(B 66, \fbox{C} $B$,(B 67,
! 79: $B$HB3$/(B.
! 80: $B6uGr$N%"%9%-!<%3!<%I$O(B32$BHV$G$"$k(B.
! 81: $BF|K\8lF~NO$N>uBV$GF~NO$5$l$k6uGr$O(B ``$BA43Q6uGr(B'' $B$H8F$P$l$F$*$j(B,
! 82: $B%"%9%-!<%3!<%I(B32$BHV$N6uGr(B ($BH>3Q6uGr(B) $B$H$OJL$NJ8;z$G$"$k(B.
! 83: $BA43Q6uGr$,%W%m%0%i%`$K:.$8$C$F$$$k$H%(%i!<$r5/$3$9(B.
! 84: asir $B$G$O%a%C%;!<%8$d%3%a%s%HEy$KF|K\8l$,MxMQ2DG=$G$"$k$,(B,
! 85: $B47$l$k$^$G$O1Q;z%b!<%I$N$_$rMxMQ$9$k$3$H$r$*4+$a$9$k(B.
! 86: $B1&>e$N8@8lI=<($,(B
! 87: \begin{center}
! 88: \scalebox{0.1}{\includegraphics{Figs/language.ps}}
! 89: \end{center}
! 90: $B$H$J$C$F$$$k>uBV$G(B cfep/asir $B$KF~NO$7$h$&(B.
! 91: %
! 92: \item
! 93: \fbox{ ' } ($B%7%s%0%k%/%*!<%H(B) $B$H(B \fbox{ ` } ($B%P%C%/%/%*!<%H(B)
! 94: $B$OJL$NJ8;z$G$"$k(B.
! 95: $B%W%m%0%i%`$rFI$`;~$KCm0U(B.
! 96: $B$^$?(B, $B%W%m%0%i%`$rFI$`;~$O(B {\tt 0} ($B%<%m!K$H(B {\tt o} $B!J$*!<!K(B
! 97: $B$N0c$$$K$bCm0U(B.
! 98: %
! 99: %
! 100: \item
! 101: $B%^%&%9$NA`:n$K$O<!$N;0<oN`$,$"$k(B.
! 102: %
! 103: %
! 104: \begin{enumerate}
! 105: \item $B%/%j%C%/(B: $BA*Br$9$k$H$-(B,
! 106: $BJ8;z$rF~NO$9$k0LCV!J%-%c%l%C%H$N0LCV!K$N0\F0$KMQ$$$k(B.
! 107: $B%^%&%9$N%\%?%s$r$A$g$s$H$*$9(B. \index{$B$/$j$C$/(B@$B%/%j%C%/(B}
! 108: \item $B%I%i%C%0(B: $B0\F0(B, $B%5%$%:$NJQ99(B, $BHO0O$N;XDj(B, $B%3%T!<$N(B
! 109: $B$H$-$J$I$KMQ$$$k(B.
! 110: $B%^%&%9$N%\%?%s$r2!$7$J$,$iF0$+$9(B.
! 111: \item $B%@%V%k%/%j%C%/!'%W%m%0%i%`$N<B9T(B, open($B%U%!%$%k$r3+$/(B)$B$r$9$k$?$a$K(B
! 112: $BMQ$$$k(B. \index{$B$@$V$k$/$j$C$/(B@$B%@%V%k%/%j%C%/(B}
! 113: $B%^%&%9$N%\%?%s$r#22s$D$:$1$F$A$g$s$A$g$s$H$*$9(B.
! 114: $B%@%V%k%/%j%C%/$r$7$?%"%$%3%s$OGr$/$J$C$?$j7A>u$,$+$o$k$3$H$,(B
! 115: $B$*$*$$(B.
! 116: $B%@%V%k%/%j%C%/$7$?$i$7$P$i$/BT$D(B.
! 117: $B7W;;5!$,K;$7$$$H$-$O5/F0$K;~4V$,$+$+$k$3$H$b$"$j(B.
! 118: $B$`$d$_$K%@%V%k%/%j%C%/$r7+$jJV$9$H$=$N2s?t$@$15/F0$5$l$F$J$*CY$/$J$k(B.
! 119: \end{enumerate}
! 120: %
! 121: \end{enumerate}
! 122:
! 123:
! 124: \section{ Cfep/Asir $B$N5/F0K!$HEEBnE*$J;H$$J}(B }
! 125: %en \section{Using Risa/Asir as a Calculator}
! 126: %C
! 127:
! 128: cfep $B$N%"%$%3%s(B($B$$$N$V$?7/(B)
! 129: %en
! 130: %en In case of Windows, open the folder (directory) in which Risa/Asir is
! 131: %en installed and double click the icon of {\tt asirgui}
! 132: %<C
! 133: \begin{center}
! 134: \scalebox{0.1}{\includegraphics{Figs/inobuta.ps}}
! 135: \end{center}
! 136: %>C
! 137: $B$r%@%V%k%/%j%C%/$9$k$H?^(B\ref{fig:cfepStart}$B$N$h$&$K(B cfep/asir $B$,5/F0$9$k(B.
! 138: $B0J2<(B cfep/asir $B$rC1$K(B asir $B$H$h$V(B.
! 139:
! 140: %<C
! 141: \begin{figure}[tb]
! 142: \scalebox{0.5}{\includegraphics{Figs/cfepStart.ps}}
! 143: \caption{ cfep/asir $B$N5/F02hLL(B} \label{fig:cfepStart}
! 144: \end{figure}
! 145: %>C
! 146:
! 147: $B?^(B\ref{fig:cfepStart} $B$NF~NOAk$K7W;;$7$?$$<0$d%W%m%0%i%`$rF~NO$7$F(B
! 148: ``$B;O$a(B''$B%\%?%s(B
! 149: %<C
! 150: \begin{center}
! 151: \scalebox{0.1}{\includegraphics{Figs/buttonStart.ps}}
! 152: \end{center}
! 153: %>C
! 154: $B$r$*$9$H<B9T$r3+;O$9$k(B.
! 155: $B<0$N7W;;$d%W%m%0%i%`$N<B9T$,=*N;$9$k$H(B,
! 156: $B?7$7$$%&%$%s%I%&(B OutputView $B$,3+$-7k2L$,$=$N%&%$%s%I%&$KI=<($5$l$k(B.
! 157: \index{$B$K$e$&$j$g$/$^$I(B@$BF~NOAk(B}
! 158: \index{OutputView}
! 159: ``$B;O$a(B''$B%\%?%s$r$*$7$F<B9T$r3+;O$9$k$3$H$r7W;;5!MQ8l$G$O(B
! 160: ``$BF~NO$NI>2A$r;O$a$k(B'' $B$H$$$&(B.
! 161: \index{;} \index{$B$R$g$&$+(B@$BI>2A(B}
! 162:
! 163: $B=PNO>.Ak$K$O%7%9%F%`$+$i$N$$$m$$$m$J>pJs$,=PNO$5$l$k$,(B,
! 164: $BFbMF$OCf>e5i<T8~$1$N$b$N$,B?$$(B.
! 165: \index{$B$7$e$D$j$g$/$3$^$I(B@$B=PNO>.Ak(B}
! 166:
! 167: $B%U%!%$%k%a%K%e!<(B
! 168: %<C
! 169: \begin{center}
! 170: \scalebox{0.3}{\includegraphics{Figs/menuFile.eps}}
! 171: \end{center}
! 172: %>C
! 173: $B$+$i(B''$BJ]B8(B''$B$d(B''$BJLL>$GJ]B8(B''$B$r<B9T$9$k$HF~NOAk$NFbMF$r%U%!%$%k$H$7$FJ]B8$G$-$k(B.
! 174: $B=PNO>.Ak$NFbMF$d(B OutputView $B$NFbMF$OJ]B8$5$l$J$$$N$GCm0U$7$F$[$7$$(B.
! 175:
! 176: cfep/asir $B$r40A4$K=*N;$9$k$K$O(B cfep $B%a%K%e!<(B
! 177: %<C
! 178: \begin{center}
! 179: \scalebox{0.3}{\includegraphics{Figs/menuCfep.eps}}
! 180: \end{center}
! 181: %>C
! 182: $B$N(B ``cfep $B$r=*N;(B'' $B$r<B9T$9$k(B.
! 183: %en Input \verb@ quit; @ to terminate the Risa/Asir.
! 184: %
! 185: %
! 186:
! 187: %<C
! 188: \bigbreak
! 189: \bigbreak
! 190:
! 191: %>C
! 192:
! 193:
! 194: $B$5$F?^(B\ref{fig:cfepStart}$B$G$O(B
! 195: $ 3 \times 4 + 1 $ $B$N7W;;$r$7$F$$$k(B.
! 196: \begin{screen}
! 197: Asir $B$K$*$1$k7W;;<0$OIaDL$N?t<0$H;w$F$$$F(B,
! 198: $BB-$7;;$O(B {\tt $+$},
! 199: $B0z$-;;$O(B {\tt $-$}
! 200: $B$H=q$/(B.
! 201: $B$+$1;;$H3d;;$O(B $\times$ $B$d(B $B!`(B $B$,%-!<%\!<%I$K$J$$$H$$$&Nr;KE*M}M3$b$"$j(B,
! 202: $B$=$l$>$l(B {\tt *} $B$H(B {\tt /} $B$GI=8=$9$k(B.
! 203: $BN_>h(B $P^N$ $B$O(B \verb@P^N@ $B$N$h$&$K(B \verb@^@ $B5-9f$rMQ$$$FI=$9(B.
! 204: \end{screen}
! 205:
! 206: \begin{screen}
! 207: $B<0$N=*$j$r=hM}7O(B(asir)$B$K65$($k(B($B<($9(B)$B$N$K(B {\tt ;} ($B%;%_%3%m%s(B)
! 208: $B$r=q$+$J$$$H$$$1$J$$(B.
! 209: $BJ8Kv$N(B ``$B!#(B'' $B$N$h$&$JLr3d$r2L$?$9(B.
! 210: $B$^$?$+$1;;$N5-9f(B {\tt *} $B$N>JN,$O$G$-$J$$(B.
! 211: \end{screen}
! 212:
! 213: \begin{example} \rm
! 214: $B0J2<$N:8$N7W;;<0$r(B asir $B$G$O1&$N$h$&$K$"$i$o$9(B.
! 215: \begin{center}
! 216: \begin{tabular}{|l|l|} \hline
! 217: $2 \times (3+5^4)$ & \verb@2*(3+5^4);@ \\ \hline
! 218: $\left\{\left(2+\frac{2}{3}\right)\times 4+\frac{1}{3}\right\}\times 2 +5 $
! 219: & \verb@ ((2+2/3)*4+1/3)*2+5; @ \\ \hline
! 220: $AX+B$ & \verb@A*X+B;@ \\ \hline
! 221: $AX^2+BX+C$ & \verb@A*X^2+B*X+C;@ \\ \hline
! 222: $\frac{1}{X-1}$ & \verb@1/(X-1);@ \\ \hline
! 223: \end{tabular}
! 224: \end{center}
! 225: \end{example}
! 226:
! 227: $B7W;;$N=g=x$O3g8L$b4^$a$FIaDL$N?t<0$N7W;;$HF1$8$G$"$k(B.
! 228: $B$?$@$7(B
! 229: $B?t3X$G$O$+$C$3$H$7$F(B, {\tt [,]},{\tt \{,\}}$B$J$I$,$D$+$($k$,(B
! 230: asir $B$G$O(B {\tt (,)} $B$N$_(B.
! 231: {\tt [,]} $B$d(B {\tt \{,\}}$B$OJL$N0UL#$r$b$D(B.
! 232: $B>e$NNc$N$h$&$K(B {\tt (,)} $B$r2?=E$K$b$D$+$C$F$h$$(B.
! 233: %en In mathematics, {\tt (,)}, {\tt [,]} ,{\tt \{,\}} are used
! 234: %en as brackets in expressions,
! 235: %en but in Risa/Asir, only {\tt (,)} can be used as brackets in expressions,
! 236: %en and {\tt [,]} and {\tt \{,\}} are used for different purposes (list and
! 237: %en grouping in programs).
! 238: $B$3$N>l9g3g8L$NBP1~4X78$,$o$+$j$K$/$$(B.
! 239: $B3g8L$NBP1~$rD4$Y$?$$HO0O$r%^%&%9$G%I%i%C%0$7$FA*Br$7(B,
! 240: \begin{center}
! 241: \scalebox{0.1}{\includegraphics{Figs/buttonBracket.eps}}
! 242: \end{center}
! 243: $B%\%?%s$r$*$9$3$H$K$h$j3g8L$NBP1~$rD4$Y$k$3$H$,$G$-$k(B.
! 244: \begin{figure}[tb]
! 245: \begin{center}
! 246: \scalebox{0.5}{\includegraphics{Figs/menuCheckBracket.eps}}
! 247: \end{center}
! 248: \caption{$B3g8L$NBP1~(B} \label{fig:menuCheckBracket}
! 249: \end{figure}
! 250: $B?^(B\ref{fig:menuCheckBracket}$B$NNc$G$O(B \verb@(1+2*(3+4))@ $B$H=q$/$Y$-$H$3$m$r(B
! 251: \verb@(1+2*(3+4)@ $B$H=q$$$F$*$j%(%i!<$,I=<($5$l$F$$$k(B.
! 252:
! 253: \bigbreak
! 254:
! 255: \noindent \QQQ
! 256: ``Basic$BIw$N;H$$J}$r@bL@$9$k(B'' $B$H=q$$$F$"$j$^$7$?$,(B, Basic $B$C$F2?$G$9$+(B? \\
! 257: \noindent \AAA
! 258: $B%3%s%T%e!<%?$K;E;v$r$5$;$k$K$O:G=*E*$K$O%W%m%0%i%`8@8l(B
! 259: ($B7W;;5!$X$N;E;v$N<j=g$r;X<($9$k$?$a$N?M9)8@8l(B)$B$rMQ$$$k(B.
! 260: $B%o!<%W%mEy$b%W%m%0%i%`8@8l$G5-=R$5$l$F$$$k(B.
! 261: Basic $B$O:G$b8E$$%W%m%0%i%`8@8l$N0l$D$G$"$j(B, $B=i?4<T$K$d$5$7$/(B, $B$+$D(B
! 262: $B7W;;5!$N;EAH$_$d%W%m%0%i%`8@8l$NM}2r$K$bM-MQ$G$"$k(B.
! 263: Basic $B$O9b9;$N?t3X$N652J=qEy$K$bEP>l$9$k(B.
! 264: $BCx<T$O$$$^$^$G(B ``10$B?J(BBASIC'' $B$r=i?4<T8~$165:`$H$7$F3hMQ$7$F$$$?$,(B,
! 265: ``10$B?J(BBASIC''$B$,(B MacOS X $B$GF0:n$7$J$$$?$a(B cfep $B$r3+H/$7$?(B.
! 266: Asir $B8@8l$b%W%m%0%i%`8@8l$G$"$j(B Basic $B$H$h$/;w$F$$$k$,(B, C $B8@8l$K$b$C$H6a$$(B.
! 267:
! 268:
! 269: \noindent \QQQ
! 270: MacOS X $B$C$F2?$G$9$+(B? \\
! 271: \noindent \AAA
! 272: -----$B$^$@=q$$$F$J$$(B.
! 273:
! 274:
! 275:
! 276: %<C
! 277: \bigbreak
! 278: \noindent
! 279: %>C
! 280: Asir $B$O?t$N=hM}$N$_$J$i$:(B, $\sqrt{x}$$B$d;03Q4X?t$N6a;w7W;;(B, $BB?9`<0$N7W;;$b$G$-$k(B.
! 281: %en Asir can do calculations not only for numbers, but also for polynomials.
! 282: %en Let us see some examples.
! 283: %en
! 284: $B:8$N?t3XE*$J<0$O(B asir $B$G$O1&$N$h$&$KI=$9(B.
! 285: \begin{center}
! 286: \begin{tabular}{|l|l|} \hline
! 287: $\pi$ ($B1_<~N((B) & {\tt @pi} \\ \hline
! 288: $\cos x$ & {\tt cos(x)} \\ \hline
! 289: $\sin x$ & {\tt sin(x)} \\ \hline
! 290: $\tan x$ & {\tt tan(x)} \\ \hline
! 291: $\sqrt{x}$ & \verb@x^(1/2)@ \\ \hline
! 292: \end{tabular}
! 293: \end{center}
! 294: %en {\tt sin(x), cos(x)} are the trigonometric functions sine and cosine.
! 295: %en The symbol {\tt @pi} is the constant $\pi$.
! 296: $B;03Q4X?t$N3QEY$K$"$?$kItJ,$N(B $x$ $B$O%i%8%"%s$H$$$&C10L$rMQ$$$FI=$9(B.
! 297: $B9b9;Dc3XG/$N?t3X$G$O3QEY$rEY(B(degree)$B$H$$$&C10L$rMQ$$$FI=$9$,(B,
! 298: $B?t3X(B3$B0J>e$G$O3QEY$O%i%8%"%s$H$$$&C10L$GI=$9(B.
! 299: \begin{screen}
! 300: 90$BEY(B($BD>3Q(B)$B$,(B $\pi/2$ $B%i%8%"%s(B, 180$BEY$,(B $\pi$ $B%i%8%"%s(B.
! 301: $B0lHL$K(B $d$$BEY$O(B $\frac{d}{180} \pi$ $B%i%8%"%s$G$"$k(B.
! 302: \end{screen}
! 303: $BC10L%i%8%"%s$r$b$A$$$k$HHyJ,K!$N8x<0$,4J7i$K$J$k(B.
! 304: $B$?$H$($P(B $x$ $B$,%i%8%"%s$G$"$k$H(B $\sin x$ $B$NHyJ,$O(B $\cos x$ $B$G$"$k(B.
! 305: \index{$B$i$8$"$s(B@$B%i%8%"%s(B}
! 306:
! 307: $\sin(x)$ $B$d(B $\cos(x)$ $B$N6a;wCM$r5a$a$k$K$O$?$H$($P(B
! 308: %en \item In order to get approximate values of $\sin(x)$ $\cos(x)$, input as
! 309: %<C
! 310: \begin{center}
! 311: \verb@ deval(sin(3.14)); @
! 312: \end{center}
! 313: %>C
! 314: $B$HF~NO$9$k(B.
! 315: $B$3$l$O(B $\sin (3.14)$ $B$N6a;wCM$r7W;;$9$k(B.
! 316: $\sin \pi = 0 $ $B$J$N$G(B $0$ $B$K6a$$CM$,=PNO$5$l$k$O$:$G$"$k(B.
! 317: $B<B:](B {\tt 0.00159265} $B$r=PNO$9$k(B. \index{deval}
! 318: {\tt deval}
! 319: (\underline{eval}uate and get a result in {\underline d}ouble number precision $B$NN,(B)
! 320: $B$O(B 64 bit$B$NIbF0>.?tE@?t$K$h$j6a;wCM7W;;$9$k(B.
! 321: 64 bit$B$NIbF0>.?tE@?t$H$O2?$+$N@bL@$OD6F~Lg$NHO0O30$G$"$k$,(B,
! 322: $B7W;;5!$OM-8B$N5-21NN0h(B($B%a%b%j(B)$B$7$+;}$?$J$$$N$G(B, $B>.?t$bM-8B7e$7$+07$($J$$(B
! 323: $B$H3P$($F$*$3$&(B. 64bit $B$O07$($k7e?t$rI=$7$F$$$k(B.
! 324: $B>\$7$/$O(B ``asir $B%I%j%k(B'' $B$r;2>H$7$FM_$7$$(B.
! 325:
! 326: %en The function {\tt deval} numerically evaluates the argument in 64 bit floating point arithmetic.
! 327: %en As to details, see Chapter \ref{chapter:naibu}.
! 328: %en
! 329:
! 330: \begin{figure}[thb]
! 331: \begin{center}
! 332: \scalebox{0.5}{\includegraphics{Figs/sqrt2.eps}}
! 333: \end{center}
! 334: \caption{$BJ?J}:,$N7W;;(B}
! 335: \label{fig:sqrt2}
! 336: \end{figure}
! 337:
! 338: \begin{example} \rm
! 339: $\sqrt{2}$, $\sqrt{3}$ $B$N6a;wCM$r7W;;$7$J$5$$(B. \\
! 340: $BF~NO(B
! 341: \begin{screen}
! 342: \begin{verbatim}
! 343: print(deval(2^(1/2)));
! 344: print(deval(3^(1/2)));
! 345: \end{verbatim}
! 346: \end{screen}
! 347: $B=PNO$O(B
! 348: $B?^(B\ref{fig:sqrt2}$B$r$_$h(B.
! 349: \end{example}
! 350:
! 351:
! 352: $B>e$NNc$N$h$&$K(B,
! 353: $B%;%_%3%m%s(B {\tt ;} $B$G6h@Z$i$l$?0lO"$NL?Na$N$"$D$^$j$O$b$C$H$b(B
! 354: $BC1=c$J(B asir $B%W%m%0%i%`$NNc$G$"$k(B. \index{$B$W$m$0$i$`(B@$B%W%m%0%i%`(B}
! 355: $B0lO"$NL?Na$O;O$a$+$i=gHV$K<B9T$5$l$k(B.
! 356: {\tt print($B<0Ey(B);} $B$O(B ``$B<0Ey(B'' $B$NCM$r7W;;$7$FCM$r2hLL$KI=<($9$k(B.
! 357:
! 358: $B$5$F=PNO$N(B {\tt 1.41421} ($B$R$H$h(B $B$R$H$h$K(B $B$R$H$_$4$m(B) $B$O(B $\sqrt{2}$ $B$N6a;wCM$J$N$G(B,
! 359: \verb@print(deval(2^(1/2)));@
! 360: $B$N<B9T7k2L$G$"$k(B.
! 361: $B$5$F=PNO$N(B {\tt 1.73205} ($B$R$H$J$_$K(B $B$*$4$l$d(B) $B$O(B $\sqrt{3}$ $B$N6a;wCM$J$N$G(B,
! 362: \verb@print(deval(3^(1/2)));@
! 363: $B$N<B9T7k2L$G$"$k(B.
! 364: $B:G8e$N(B {\tt 0} $B$O$J$s$J$N$G$"$m$&$+(B?
! 365: $B<B$O$3$l$O:G8e$N(B {\tt print} $BJ8$NLa$7$F$$$kCM$G$"$k(B.
! 366: $B$`$D$+$7$$(B? $BJL$NNc$G@bL@$7$h$&(B.
! 367:
! 368: \noindent
! 369: \fbox{$BF~NO(B}
! 370: \begin{screen}
! 371: \begin{verbatim}
! 372: 1+2;
! 373: 2+3;
! 374: 3+4;
! 375: \end{verbatim}
! 376: \end{screen}
! 377: $B$3$N;~=PNO$O(B(OutputView$B$X$NI=<($O(B)
! 378: \begin{screen}
! 379: {\tt 7}
! 380: \end{screen}
! 381: $B$H$J$k(B.
! 382: cfep/asir $B$G$O$H$/$K(B {\tt print} $BJ8$r$+$+$J$$8B$j(B
! 383: $B:G8e$NJ8$N7W;;7k2L(B($BI>2A7k2L(B)$B$7$+=PNO$7$J$$(B.
! 384: $B$$$^$N>l9g$O(B $3+4$ $B$N7k2L(B $7$ $B$r=PNO$7$F$$$k(B.
! 385: \index{$B$7$e$D$j$g$/$1$C$+(B@$B=PNO7k2L(B}
! 386:
! 387: \begin{problem} \rm
! 388: \begin{enumerate} \index{2$B$N$k$$$8$g$&(B@$2$$B$NN_>h(B}
! 389: \item $2^8$, $2^9$, $2^{10}$,
! 390: $B$NCM$r7W;;$7$FEz$($rI=<($9$k%W%m%0%i%`$r=q$-$J$5$$(B.
! 391: \item $2$ $B$NN_>h$O%Q%=%3%s$N@-G=@bL@$K$h$/EP>l$9$k(B.
! 392: $B$?$H$($P8!:w%7%9%F%`(B google $B$K%-!<%o!<%I(B ``512 $B%a%b%j(B $BEk:\(B'' $B$rF~NO$7$?$H$3$m(B
! 393: ``$B%S%G%*%a%b%j$r(B 256M $B$+$i(B 512M $B$KG\A}$5$;(B'' $B$J$I(B, $B?tB?$/$N5-;v$,%R%C%H$9$k(B.
! 394: $B$3$N$h$&$J5-;v$r(B($B0UL#$,$o$+$i$J$/$F$b(B)10$B7o$"$D$a$F$_$h$&(B.
! 395: $512$ $B0J30$N(B $2$ $B$NN_>h$G$bF1$8$3$H$r;n$7$F$_$h$&(B.
! 396: \item ($BCf5i(B) $2$ $B$NN_>h$,%Q%=%3%s$N@-G=@bL@$K$h$/EP>l$9$kM}M3$rO@$8$J$5$$(B.
! 397: \end{enumerate}
! 398: \end{problem}
! 399:
! 400: \bigbreak
! 401:
! 402: \begin{figure}[thb]
! 403: \begin{center}
! 404: \scalebox{0.4}{\includegraphics{Figs/plot1.eps}}
! 405: \end{center}
! 406: \caption{$B4X?t$N%0%i%U(B}
! 407: \end{figure}
! 408:
! 409: \noindent
! 410: \HHH
! 411: \index{plot} \index{X11}
! 412: %en \begin{example} \rm
! 413: %en \index{plot}
! 414: \underline{X11 $B4D6-$,F0$$$F$$$l$P(B},
! 415: {\tt plot(f);} $BL?Na$G(B
! 416: $x$$B$N4X?t(B $f$ $B$N%0%i%U$rIA$1$k(B.
! 417: %en The command {\tt plot(f);}
! 418: %en draws the graph of the function $f$ in the variable $x$.
! 419: {\tt x} $B$NHO0O$r;XDj$7$?$$$H$-$O$?$H$($P(B \\
! 420: {\tt plot(f,[x,0,10])}
! 421: $B$HF~NO$9$k$H(B, {\tt x} $B$O(B 0 $B$+$i(B 10 $B$^$GJQ2=$9$k(B.
! 422: %en When you need to specify the range of variables {\tt x},
! 423: %en input, for example \\
! 424: %en {\tt plot(f,[x,0,10])}
! 425: %en Then, the variable {\tt x} runs over $[0, 10]$.
! 426:
! 427: \noindent \fbox{$BF~NONc(B}
! 428: %<C
! 429: \begin{screen}
! 430: \begin{verbatim}
! 431: plot(sin(x));
! 432: plot(sin(2*x)+0.5*sin(3*x),[x,-10,10]);
! 433: \end{verbatim}
! 434: \end{screen}
! 435: %>C
! 436: \begin{problem} \rm
! 437: $B$$$m$$$m$J4X?t$N%0%i%U$rIA$$$F$"$=$s$G$_$h$&(B.
! 438: $B?t3X$NCN<1$rAmF00w$7$F7W;;5!$NIA$/7A$,$I$&$7$F$=$&$J$N$+(B
! 439: $B@bL@$r;n$_$F$_$h$&(B.
! 440: \end{problem}
! 441:
! 442:
! 443: \section{$B%(%i!<%a%C%;!<%8(B}
! 444:
! 445: $BF~NO$K%(%i!<$,$"$k$H(B, $B%(%i!<%a%C%;!<%8$,I=<($5$l$k(B.
! 446: \index{$B$($i!<(B@$B%(%i!<(B}
! 447: \index{$B$($i!<$a$C$;!<$8(B@$B%(%i!<%a%C%;!<%8(B}
! 448:
! 449: \begin{figure}[htb]
! 450: \begin{center}
! 451: \scalebox{0.5}{\includegraphics{Figs/errorParseEq}}
! 452: \end{center}
! 453: \caption{$BJ8K!%(%i!<(B} \label{fig:errorParseEq}
! 454: \end{figure}
! 455: $B?^(B\ref{fig:errorParseEq} $B$G$O(B
! 456: \verb@ 2+4= @
! 457: $B$HF~NO$7$F$$$k(B. $B:G8e$K(B \verb@=@ $B$r=q$/I=8=$O(B asir $B$NJ8K!$G$O(B
! 458: $B5v$5$l$F$$$J$$$N$G(B, ``$BJ8K!%(%i!<(B'' $B$H;XE&$5$l$F$$$k(B. \index{$B$V$s$]$&$($i!<(B@$BJ8K!%(%i!<(B}
! 459: \begin{screen}
! 460: $BBgBN$3$l$G$o$+$C$F$/$l$F$$$$$8$c$J$$(B,
! 461: $B$H$3$A$i$,$*$b$C$F$$$F$b%W%m%0%i%`8@8l$O0l@ZM;DL$,$-$+$J$$(B.
! 462: \end{screen}
! 463: $B$J$*(B
! 464: \begin{verbatim}
! 465: error([41,4294967295,parse error,[asir_where,[[toplevel,1]]]])
! 466: \end{verbatim}
! 467: $B$NItJ,$O>e5i<T8~$1$N>pJs$J$N$G$H$j$"$($:L5;k$7$F$b$i$$$?$$(B.
! 468:
! 469:
! 470: \begin{figure}[htb]
! 471: \begin{center}
! 472: \scalebox{0.5}{\includegraphics{Figs/errorMultiLine}}
! 473: \end{center}
! 474: \caption{$B%(%i!<9T(B} \label{fig:errorMultiLine}
! 475: \end{figure}
! 476: $B?^(B\ref{fig:errorMultiLine} $B$G$O(B
! 477: \begin{screen}
! 478: \begin{verbatim}
! 479: print( 2^7 );
! 480: print( 2^8 );
! 481: print( deval(2^(1/2));
! 482: print( deval(3^(1/2)));
! 483: \end{verbatim}
! 484: \end{screen}
! 485: $B$HF~NO$7$F$$$k(B.
! 486: 3$B9TL\$O1&3g8L$,$R$H$DB-$j$J$/$F(B
! 487: \verb@print( deval(2^(1/2)));@
! 488: $B$,@5$7$$F~NO$G$"$k(B.
! 489: $B%(%i!<9T$N(B3$B9TL\$K%-%c%l%C%H$,<+F0E*$K0\F0$7$F$$$k$O$:$G$"$k(B.
! 490: $B$J$*$3$NNc$G$O(B
! 491: \begin{center}
! 492: \scalebox{0.05}{\includegraphics{Figs/buttonBracket.eps}}
! 493: \end{center}
! 494: $B%\%?%s$r$b$A$$$F$b$9$0%(%i!<$N>l=j$,$o$+$k(B.
! 495: \index{$B$+$C$3(B@$B3g8L(B}
! 496:
! 497: \noindent {\bf $BCm0U(B}:
! 498: $BI=<($5$l$?9T$O%(%i!<$NH/@80LCV$G$"$k$,(B,
! 499: $B%(%i!<$N860x$O$=$NA0$NJ}$N9T$K$"$k$3$H$bB?$$(B.
! 500: $B$?$H$($P(B
! 501: \begin{screen}
! 502: \begin{verbatim}
! 503: 1+2
! 504: 2+3;
! 505: \end{verbatim}
! 506: \end{screen}
! 507: $B$HF~NO$9$k$H%(%i!<9T$O(B 2 $B9TL\$G$"$k$,(B, $B860x$O(B1$B9TL\$G(B {\tt ; } $B$r(B
! 508: $B=q$-K:$l$?$3$H$G$"$k(B.
! 509:
! 510: \bigbreak
! 511: $B%(%i!<9T$,J#?tI=<($5$l$?>l9g$O$=$l$i$NCf$N$I$3$+$K%(%i!<$,$"$k(B.
! 512: $BJ#?t$"$k%(%i!<9T$K=gHV$K%8%c%s%W$7$F$$$/$K$O(B,
! 513: \fbox{$B<B9T(B} $B%a%K%e!<$+$i(B \fbox{$B<!$N%(%i!<9T$X(B} $B$rA*Br$9$k(B.
! 514: \begin{center}
! 515: \scalebox{0.3}{\includegraphics{Figs/menuNextError.eps}}
! 516: \end{center}
! 517: \index{$B$D$.$N$($i!<$.$g$&$X(B@$B<!$N%(%i!<9T$X(B}
! 518:
! 519: \begin{problem} \rm
! 520: $B%(%i!<$r@8$8$k<0$^$?$O%W%m%0%i%`$r(B5$B$D:n$l(B.
! 521: \end{problem}
! 522:
! 523:
! 524: \chapter{ $BJQ?t$H%W%m%0%i%`(B }
! 525:
! 526: \section{$BJQ?t(B}
! 527:
! 528: \noindent \index{$B$X$s$9$&(B@$BJQ?t(B}
! 529: $BJQ?t$K?tCMEy$r5-21$7$F$*$1$k(B.
! 530: \underline{$BJQ?tL>$OBgJ8;z$G;O$^$k(B}. \index{$B$X$s$9$&$a$$(B@$BJQ?tL>(B}
! 531: %$B1Q;z$NBgJ8;z(B, $B;RJ8;z$r6hJL$7$F$$$k$N$GCm0U(B.
! 532: $B$J$*8e=R$9$k$h$&$K(B asir $B$G$OB?9`<07W;;$,$G$-$k$,>.J8;z$G;O$^$kJ8;zNs$O(B
! 533: $BB?9`<0$NJQ?tL>$H$7$FMxMQ$5$l$k(B.
! 534: \index{$B$?$3$&$7$-$N$X$s$9$&$a$$(B@$BB?9`<0$NJQ?tL>(B}
! 535: %en \noindent
! 536: %en Symbols starting with capital alphabetical characters are
! 537: %en {\it program variables}, which are used to store values.
! 538: %en \index{program variable}
! 539: %en Names of functions defined in programs start with small alphabetical
! 540: %en characters.
! 541: %en Note that variable symbols starting with small alphabetical characters are
! 542: %en variables in polynomials in Risa/Asir and they cannot be used to store
! 543: %en values.
! 544: %en
! 545:
! 546: \index{2$B$N$k$$$8$g$&(B@$2$$B$NN_>h(B}
! 547: $2$$B$NN_>h$rI=<($9$k<!$N%W%m%0%i%`$r9M$($h$&(B.
! 548: \begin{screen}
! 549: \begin{verbatim}
! 550: print( 2^1 );
! 551: print( 2^2 );
! 552: print( 2^3 );
! 553: print( 2^4 );
! 554: print( 2^5 );
! 555: print( 2^6 );
! 556: print( 2^7 );
! 557: print( 2^8 );
! 558: \end{verbatim}
! 559: \end{screen}
! 560: $B$3$N%W%m%0%i%`$OJQ?t(B {\tt X} $B$rMQ$$$F(B
! 561: $B<!$N$h$&$K=q$$$F$*$1$P(B $2$ $B$NN_>h$@$1$J$/(B $3$ $B$NN_>h$rI=<($9$k(B
! 562: $B$N$K:FMxMQ$G$-$k(B($B?^(B\ref{fig:powerOf2}).
! 563: \begin{screen}
! 564: \begin{verbatim}
! 565: X = 2;
! 566: print( X^1 );
! 567: print( X^2 );
! 568: print( X^3 );
! 569: print( X^4 );
! 570: print( X^5 );
! 571: print( X^6 );
! 572: print( X^7 );
! 573: print( X^8 );
! 574: \end{verbatim}
! 575: \end{screen}
! 576: \begin{figure}[thb]
! 577: \begin{center}
! 578: \scalebox{0.3}{\includegraphics{Figs/powerOf2.eps}}
! 579: \end{center}
! 580: \caption{$BJQ?t$NMxMQ(B} \label{fig:powerOf2}
! 581: \end{figure}
! 582: $3$ $B$NN_>h$rI=<($9$k$K$O(B
! 583: \verb@X=2@ $B$N9T$r(B \verb@X=3@ $B$KJQ99$9$l$P$$$$$@$1$G$"$k(B.
! 584:
! 585: $B%"%k%U%!%Y%C%H$N(B\underline{$BBgJ8;z(B}$B$G$O$8$^$k1Q?t;z$NNs$,(B asir $B$N(B
! 586: $BJQ?t$G$"$k(B.
! 587: $B$D$^$j(B, {\tt X}, {\tt Y}, {\tt Z} $B$O$b$A$m$s$N$3$H(B,
! 588: {\tt Sum} $B$H$+(B {\tt Kazu} $B$H$+(B {\tt X1} $B$J$I(B2$BJ8;z0J>e$N1Q?t;z$NNs(B
! 589: $B$NAH$_9g$o$;$,JQ?tL>$H$7$F5v$5$l$k(B.
! 590:
! 591:
! 592: $BJQ?t$r4^$s$@<0$r%W%m%0%i%`Cf$G<+M3$K$D$+$&$3$H$b$G$-$k(B.
! 593: $B$?$H$($P(B
! 594: \begin{verbatim}
! 595: X = 2;
! 596: A = 1;
! 597: print( 2*X^2 -A );
! 598: \end{verbatim}
! 599: $B$r<B9T$9$k$H(B {\tt 7} $B$,I=<($5$l$k(B.
! 600:
! 601: $B$3$N$h$&$JNc$r$_$k$H(B, $BJQ?t$N5!G=$O(B
! 602: $BCf3X?t3X$G$J$i$&J8;z<0$H;w$F$$$k$H;W$&$@$m$&(B.
! 603: $BD6F~Lg$H$7$F$O$3$l$G$[$\@5$7$$M}2r$G$"$k$,(B, $B$h$j%9%F%C%W%"%C%W$7$F$$$/$K$O(B,
! 604: $B<!$N$3$H$r6/$/5-21$7$F$*$3$&(B.
! 605: \begin{screen}
! 606: $BJQ?t$H$O7W;;5!$K?tCMEy$rJ]B8$7$F$*$/%a%b%j>e$N>l=j$NL>A0$G$"$k(B.
! 607: \end{screen}
! 608:
! 609: $B$5$F(B, $BD6F~Lg(B, $BBh0l$N4XLg$G$"$k(B.
! 610: \begin{screen}
! 611: {\tt =} $B5-9f$O<!$N$h$&$J7A<0$G$D$+$&(B:
! 612: $$ \mbox{{\bf $BJQ?tL>(B}} {\tt = } \mbox{{\bf $B<0(B}} {\tt ;} $$
! 613: $B$3$l$O$^$:1&JU$N<0$r7W;;$7$=$N$"$H$=$N7W;;7k2L$r:8JU$NJQ?t$KBeF~$;$h$H$$$&0UL#(B.
! 614: \verb@=@ $B5-9f$O1&JU$r7W;;$7$F$=$N7k2L$r:8JU$XBeF~$;$h$H$$$&(B\underline{$BL?Na(B}
! 615: $B$@$H;W$C$FM_$7$$(B. \\
! 616: $B$?$H$($P(B,
! 617: \verb@X=1@ $B$O(B \verb@X@ $B$,(B \verb@1@ $B$KEy$7$$$H$$$&0UL#$G$O$J$/(B,
! 618: \verb@1@ $B$r(B $BJQ?t(B \verb@X@ $B$KBeF~$;$h$H$$$&0UL#$G$"$k(B.
! 619: \end{screen}
! 620: $B$3$3$G$$$$$?$$$3$H$O(B, \index{$B$@$$$K$e$&(B@$BBeF~(B} \index{=} \index{$B$@$$$K$e$&$-$4$&(B=@$BBeF~5-9f(B=}
! 621: \begin{screen}
! 622: \verb@=@ $B5-9f$N0UL#$,?t3X$G$N0UL#$H0c$&$h(B!
! 623: \end{screen}
! 624: $B$H$$$&$3$H$G$"$k(B.
! 625: $B$3$l$G:.Mp$9$kF~Lg<T$bB?$$$N$G%W%m%0%i%`8@8l$K$h$C$F$O(B
! 626: ``$2$ $B$rJQ?t(B {\tt X} $B$KBeF~$;$h(B'' $B$r(B
! 627: \verb@X:=2@
! 628: $B$H=q$/>l9g$b$"$k(B ($B$?$H$($P%W%m%0%i%`8@8l(B Pascal).
! 629:
! 630: $B<!$N%W%m%0%i%`$O(B $2$, $2^2$, $2^4$, $2^8$ $B$r7W;;$7$FI=<($9$k(B.
! 631: \begin{screen}
! 632: \begin{verbatim}
! 633: X=2;
! 634: print(X);
! 635: X = X*X;
! 636: print(X);
! 637: X = X*X;
! 638: print(X);
! 639: X = X*X;
! 640: print(X);
! 641: \end{verbatim}
! 642: \end{screen}
! 643: \begin{figure}[thb]
! 644: \begin{center}
! 645: \scalebox{0.3}{\includegraphics{Figs/powerOf2b.eps}}
! 646: \end{center}
! 647: \caption{$BJQ?t$NMxMQ(B} \label{fig:powerOf2b}
! 648: \end{figure}
! 649: $B=PNO$,?^(B\ref{fig:powerOf2b}$B$N$h$&$K$J$kM}M3$r@bL@$7$h$&(B.
! 650: $B$^$:(B1$B9TL\$GJQ?t(B{\tt X}$B$K(B2$B$,BeF~$5$l$k(B.
! 651: $B<!$K(B3$B9TL\$G$O$^$:1&JU$N<0$r7W;;$9$k(B. $B$3$N>l9g(B {\tt X} $B$NCM$O(B $2$ $B$G$"$k$N$G(B,
! 652: $2\times2$ $B$G7k2L$O(B $4$ $B$G$"$k(B.
! 653: \underline{$B$3$N7W;;$,=*$C$?8e(B}$B7k2L$N(B $4$ $B$,JQ?t(B {\tt X} $B$KBeF~$5$l$k(B.
! 654: 5$B9TL\$G$O1&JU$N<0$O(B $4 \times 4$ $B$J$N$G(B, $B$=$N7W;;7k2L$N(B $16$ $B$,(B $B:8JU$NJQ?t(B $X$
! 655: $B$KBeF~$5$l$k(B.
! 656: \index{$B$X$s$9$&(B@$BJQ?t(B}
! 657:
! 658: \bigbreak
! 659: %
! 660: %
! 661: \noindent
! 662: \HHH \index{$B$?$3$&$7$-(B@$BB?9`<0(B} \index{$B$9$&$7$-$7$g$j(B@$B?t<0=hM}(B}
! 663: Asir $B$OB?9`<07W;;$b$G$-$k(B. $B<B$O(B Asir $B$O7W;;5!$G5-9fE*$K?t<0$r=hM}$9$k$?$a$N(B
! 664: $B?t<0=hM}%7%9%F%`$G$b$"$k(B.
! 665: %en Asir can do calculations for polynomials.
! 666: \begin{enumerate}
! 667: %en \begin{enumerate}
! 668: \item $B>.J8;z$G$O$8$^$k5-9f$OB?9`<0$NJQ?t$G$"$k(B.
! 669: $B?t3X$H$A$,$C$FJQ?t$NL>A0$O0lJ8;z$H$O$+$.$i$J$$(B.
! 670: $B$?$H$($P(B {\tt rate} $B$H=q$/$H(B, $rate$ $B$H$$$&L>A0$NB?9`<0$NJQ?t$H$J$k(B.
! 671: $B$?$H$($P(B {\tt x2} $B$H=q$/$H(B, $x2$ $B$H$$$&L>A0$NB?9`<0$NJQ?t$H$J$k(B.
! 672: $x$ $B$+$1$k(B $2$ $B$O(B {\tt x*2} $B$H=q$/(B. \index{$B$?$3$&$7$-$X$s$9$&(B@$BB?9`<0JQ?t(B}
! 673: %en \item Symbols starting small alphabetical character are variables of polynomials. For example, {\tt x2} is the variable of the name x2.
! 674: %en The expression {\tt x*2} stands for $x$ times $2$.
! 675: %
! 676: %
! 677: \item \index{$B$$$s$9$&$V$s$+$$(B@$B0x?tJ,2r(B} \index{fctr}
! 678: {\tt fctr(\poly)} $B$O(B \poly $B$rM-M}?t78?t$NHO0O$G0x?tJ,2r$9$k(B.
! 679: {\tt fctr} $B$O(B factor $B$NC;=LI=8=$G$"$k(B.
! 680: %en \item \index{factorization} \index{fctr}
! 681: %en The input {\tt fctr(\poly)} factors \poly in the ring of polynomials
! 682: %en with rational number coefficients.
! 683: %
! 684: %
! 685: \end{enumerate}
! 686: %en \end{enumerate}
! 687:
! 688: \begin{figure}[tbh]
! 689: \begin{center}
! 690: \scalebox{0.3}{\includegraphics{Figs/fctr1.eps}}
! 691: \end{center}
! 692: \caption{$B0x?tJ,2r(B} \label{fig:fctr1}
! 693: \end{figure}
! 694:
! 695: $B?^(B\ref{fig:fctr1} $B$N(B{\tt fctr} $B$N=PNO$N:G=i$O(B $x^2+2xy+y^2$ $B$,(B
! 696: $ 1^1 \times (x+y)^2 $
! 697: $B$H0x?tJ,2r$5$l$k$3$H$r0UL#$7$F$$$k(B.
! 698: $B?^(B\ref{fig:fctr1} $B$N(B{\tt fctr} $B$N=PNO$N(B2$BHVL\$O(B $x^2-1$ $B$,(B
! 699: $$ 1^1 \times (x-1)^1 \times (x+1)^1
! 700: $$
! 701: $B$H0x?tJ,2r$5$l$k$3$H$r0UL#$7$F$$$k(B.
! 702:
! 703:
! 704: \section{$B$/$j$+$($7(B}
! 705:
! 706: $B$/$j$+$($7$dH=CG$r$*$3$J$&$?$a$NJ8$,(B asir $B$K$OMQ0U$5$l$F$$$k(B.
! 707: $B$3$NJ8$r$b$A$$$k$HJ#;($J$3$H$r<B9T$G$-$k(B.
! 708: $B$^$:0lHV$N4pAC$G$"$k$/$j$+$($7$N5!G=$r$?$a$7$F$_$h$&(B.
! 709: \index{$B$/$j$+$($7(B} \index{for$B$V$s(B@for$BJ8(B}
! 710: %en A programming language is installed in Asir.
! 711: %en Let us try the most basic programming; repeating and printing.
! 712: \begin{example} \rm
! 713: $B?^(B\ref{fig:powerOf2}$B$N%W%m%0%i%`$O<!$N$h$&$K7+$jJV$75!G=(B --- {\tt for}$BJ8(B ---
! 714: $B$rMQ$$$F4J7i$K=q$1$k(B.
! 715: \begin{screen}
! 716: \begin{verbatim}
! 717: X = 2;
! 718: for (I=1; I<=8; I++) {
! 719: print( X^I );
! 720: }
! 721: \end{verbatim}
! 722: \end{screen}
! 723: $B<B9T7k2L$O?^(B\ref{fig:powerOf2For}$B$r$_$h(B.
! 724: \end{example}
! 725:
! 726: \begin{figure}[tbh]
! 727: \begin{center}
! 728: \scalebox{0.3}{\includegraphics{Figs/powerOf2For.eps}}
! 729: \end{center}
! 730: \caption{for$BJ8(B} \label{fig:powerOf2For}
! 731: \end{figure}
! 732:
! 733:
! 734: $B7+$jJV$74XO"$NI=8=$N0UL#$r2U>r=q$K$7$F$^$H$a$F$*$3$&(B.
! 735: \begin{enumerate}
! 736: %en \begin{enumerate}
! 737: \item \index{for} \index{$B$/$j$+$($7(B@$B7+$jJV$7(B} \index{\<@\verb&<=&}
! 738: %en \item \index{for} \index{repeat} \index{\<@\verb&<=&}
! 739: \verb@ for (K=$B=i4|CM(B; K<=$B=*$j$NCM(B; K++) {$B%k!<%W$NCf$G<B9T$9$k%3%^%s%I(B}; @
! 740: $B$O$"$k$3$H$r2?EY$b7+$jJV$7$?$$;~$KMQ$$$k(B.
! 741: for $B%k!<%W$H8F$P$l$k(B.
! 742: ``{\tt K<=N}'' $B$O(B, ``${\tt K} \leq {\tt N}$$B$+(B'' $B$H$$$&0UL#$G$"$k(B.
! 743: $B;w$?I=8=$K(B,
! 744: ``{\tt K>=N}''$B$,$"$k$,(B, $B$3$l$O(B ``${\tt K} \geq {\tt N}$$B$+(B'' $B$H$$$&0UL#$G$"$k(B.
! 745: {\tt =} $B$N$J$$(B
! 746: ``{\tt K<N}'' $B$O(B, ``${\tt K} < {\tt N}$$B$+(B'' $B$H$$$&0UL#$G$"$k(B.
! 747: \item \verb@ ++K @ $B$d(B \verb@ K++ @ $B$O(B {\tt K} $B$r(B 1 $BA}$d$;$H$$$&0UL#$G$"$k(B.
! 748: \verb@ K = K+1 @ $B$H=q$$$F$b$h$$(B.
! 749: $BF1$8$/(B, \verb@ --K @ $B$d(B \verb@ K-- @ $B$O(B {\tt K} $B$r(B 1 $B8:$i$;$H$$$&0UL#$G$"$k(B.
! 750: %en The sentence
! 751: %en {\tt for (K={\it initial value}; K<={\it limit}; K++) \{{\it commands}\}; }
! 752: %en is used to repeat commands.
! 753: %en It is called the ``for'' loop.
! 754: %en ``{\tt K<=N}'' means that ``${\tt K} \leq {\tt N}$ holds''.
! 755: %en A similar expression
! 756: %en ``{\tt K>=N}'' implies that ``${\tt K} \geq {\tt N}$ holds''
! 757: %en The expression ``{\tt K<N}'' means that ``${\tt K} < {\tt N}$''.
! 758: \item \verb@ ++K @ $B$d(B \verb@ K++ @ $B$O(B {\tt K} $B$r(B 1 $BA}$d$;$H$$$&0UL#$G$"$k(B.
! 759: \verb@ K = K+1 @ $B$H=q$$$F$b$h$$(B.
! 760: $BF1$8$/(B, \verb@ --K @ $B$d(B \verb@ K-- @ $B$O(B {\tt K} $B$r(B 1 $B8:$i$;$H$$$&0UL#$G$"$k(B.
! 761: %en \item The expressions \verb@ ++K @ and \verb@ K++ @ mean increasing
! 762: %en {\tt K} by $1$.
! 763: %en In this example, it has the same meaning with \verb@ K = K+1 @.
! 764: %en Similarly \verb@ --K @ and \verb@ K-- @ mean decreasing {\tt K} by 1.
! 765: %
! 766: %
! 767: \end{enumerate}
! 768: %en \end{enumerate}
! 769: %en
! 770:
! 771: \begin{figure}[tbh]
! 772: \begin{center}
! 773: \scalebox{0.3}{\includegraphics{Figs/powerOf2For2.eps}}
! 774: \end{center}
! 775: \caption{for$BJ8(B} \label{fig:powerOf2For2}
! 776: \end{figure}
! 777: for $B$N$"$H$N(B {\tt \{}, {\tt \}} $B$NCf$K$OJ#?t$NJ8(B($BL?Na(B)$B$r=q$1$k(B.
! 778: \begin{screen}
! 779: \begin{verbatim}
! 780: X = 2;
! 781: for (I=1; I<=8; I++) {
! 782: print("2$B$N(B"+rtostr(I)+"$B>h$O(B ",0);
! 783: print( X^I );
! 784: }
! 785: \end{verbatim}
! 786: \end{screen}
! 787: $B$3$NNc$G$O(B
! 788: $BF|K\8l$r4^$`$N$GA0$N@a$G=R$Y$?$h$&$KF|K\8l6uGr$r%W%m%0%i%`K\BN$K$$$l$J$$$h$&$K$7$F(B,
! 789: $BCm0U?<$/%W%m%0%i%`$rF~NO$7$F$b$i$$$?$$(B.
! 790: $B<B9T7k2L$O?^(B\ref{fig:powerOf2For2}$B$r$_$h(B. \index{2$B$N$k$$$8$g$&(B@$2$$B$NN_>h(B}
! 791: \verb@print("2$B$N(B"+rtostr(I)+"$B>h$O(B ",0);@ $B$NItJ,$r4JC1$K@bL@$7$F$*$3$&(B.
! 792: $B$^$::G8e$N(B {\tt 0} $B$O=PNO$N$"$H2~9T$7$J$$(B, $B$D$^$j<!$N(B {\tt print} $BJ8$N=PNO$r(B
! 793: $B$=$N$^$^B3$1$h$H$$$&0UL#(B. \index{print} \index{rtostr}
! 794: \verb@"@ $B$G$+$3$^$l$?ItJ,$OJ8;zNs$H8F$P$l$F$$$k(B.$B$3$l$O$3$N$^$^I=<($5$l$k(B.
! 795: \verb@rtostr(I)@ $B$O?t;z(B {\tt I} $B$rJ8;zNsI=8=$KJQ49$7$J$5$$(B, $B$H$$$&0UL#(B
! 796: ($BD6F~Lg$H$7$F$OFq$7$$(B?).
! 797: $B$"$HJ8;zNs$KBP$7$F(B {\tt +} $B$rE,MQ$9$k$HJ8;zNs$,7k9g$5$l$k(B.
! 798: \index{$B$b$8$l$D$N$1$D$4$&(B@$BJ8;zNs$N7k9g(B}
! 799: \index{$B$b$8$l$D$R$g$&$2$s(B@$BJ8;zNsI=8=(B}
! 800:
! 801:
! 802: \noindent
! 803: \fbox{$B;(CL(B}
! 804: ($B9>8M;~Be$N?t3X$NK\$K$"$C$?LdBj$N2~Bj(B) \\
! 805: $BEBMM(B: $B$3$N$?$S$NF/$-$O$"$C$Q$l$G$"$C$?(B. $BK+H~$O$J$K$,$h$$$+(B? \\
! 806: $B2HMh(B: $B:#F|$O0l1_(B, $BL@F|$O(B2$B1_(B, $BL@8eF|$O(B4$B1_$H(B, $BA0F|$N(B2$BG\$E$D(B, $B$3$l$r(B4$B=54VB3$1$F(B
! 807: $B$/$@$5$k$@$1$G7k9=$G$4$6$$$^$9(B. \\
! 808: $BEBMM(B: $B$J$s$H$b$5$5$d$+$JK+H~$8$c$N$&(B. $B$h$7$h$7(B. \\
! 809: $B$5$F(B, $B2HMh$O$$$/$iK+>^6b$r$b$i$($k$@$m$&(B?
! 810: $B$3$l$b$^$?(B$2$$B$NN_>h$N7W;;$G$"$k(B. \index{2$B$N$k$$$8$g$&(B@$2$$B$NN_>h(B}
! 811: Cfep/asir $B$G7W;;$7$F$_$h$&(B.
! 812:
! 813:
! 814:
! 815: \begin{example}\Begin \quad
! 816: {\tt for} $B$K$h$k7+$jJV$7$rMQ$$$F(B $\sqrt{x}$ $B$N?tI=$r$D$/$m$&(B.
! 817: %en \begin{example}\Begin [02] \quad
! 818: %en By using {\tt for} loop, generate a table of $\sqrt{x}$.
! 819: %en \end{example}
! 820: %en
! 821: \begin{screen}
! 822: \begin{center}
! 823: \begin{verbatim}
! 824: for (I=0; I<2; I = I+0.2) {
! 825: print(I,0); print(" : ",0);
! 826: print(deval(I^(1/2)));
! 827: }
! 828: \end{verbatim}
! 829: \end{center}
! 830: \end{screen}
! 831: %>C
! 832: $B=PNO7k2L(B
! 833: %en Output.
! 834: %<C
! 835: \begin{center}
! 836: \begin{tabular}{|l|} \hline \sl
! 837: 0 : 0 \\
! 838: 0.2 : 0.447214 \\
! 839: 0.4 : 0.632456 \\
! 840: 0.6 : 0.774597 \\
! 841: 0.8 : 0.894427 \\
! 842: 1 : 1 \\
! 843: 1.2 : 1.09545 \\
! 844: 1.4 : 1.18322 \\
! 845: 1.6 : 1.26491 \\
! 846: 1.8 : 1.34164 \\
! 847: 2 : 1.41421 \\
! 848: \hline
! 849: \end{tabular}
! 850: \end{center}
! 851: %>C
! 852: \rm
! 853: \index{print}
! 854: {\tt print(A)} $B$OJQ?t(B {\tt A} $B$NCM$r2hLL$KI=<($9$k(B.
! 855: {\tt print($BJ8;zNs(B)} $B$OJ8;zNs$r2hLL$KI=<($9$k(B.
! 856: {\tt print(A,0)} $B$OJQ?t(B {\tt A} $B$NCM$r2hLL$KI=<($9$k$,(B, $BI=<($7$?(B
! 857: $B$"$H$N2~9T$r$7$J$$(B.
! 858: $B6uGr$bJ8;z$G$"$k(B.$B$7$?$,$C$F(B, $B$?$H$($P(B
! 859: {\tt A=10; print(A,0); print(A+1);}
! 860: $B$r<B9T$9$k$H(B, \index{print}
! 861: {\tt 1011} $B$HI=<($5$l$F$7$^$&(B.
! 862: {\tt A=10; print(A,0); print(" ",0);print(A+1);}
! 863: $B$r<B9T$9$k$H(B,
! 864: {\tt 10 11} $B$HI=<($5$l$k(B.
! 865: %en \rm
! 866: %en \index{print}
! 867: %en The command {\tt print(A)} displays the value of the variable {\tt A}
! 868: %en on the screen.
! 869: %en The command {\tt print({\it string})} outpus the {\it string} on the screen.
! 870: %en The command {\tt print(A,0)} displays the value of the variable {\tt A},
! 871: %en but it does not make the newline.
! 872: %en Note that the blank is a character. For example, if you input
! 873: %en {\tt A=10; print(A,0); print(A+1);}
! 874: %en {\tt 1011} will be displayed. So, input as
! 875: %en {\tt A=10; print(A,0); print(" ",0);print(A+1);}
! 876: %en Then,
! 877: %en {\tt 10 11} will be displayed.
! 878: %en
! 879: \end{example}
! 880:
! 881: $B$H$3$m$G(B, $B$3$NNc$G$O>r7o$,(B ${\tt I}<2$ $B$J$N$K(B ${\tt I}=2$
! 882: $B$N>l9g$,I=<($5$l$F$$$k(B.
! 883: $B<B:]$K(B asir $B>e$G<B9T$7$F$_$k$H$3$&$J$k$,(B, $BM}M3$rCN$k$K$O!"(B
! 884: $BIbF0>.?t$N7W;;5!>e$G$NI=8=$K$D$$$F$NCN<1$,I,MW$G$"$k(B
! 885: (``asir$B%I%j%k(B''$B$r;2>H(B).
! 886: $B$H$j$"$($:(B,
! 887: %en In this example, the termination condition is ${\tt I}<2$, but
! 888: %en the case of ${\tt I}=2$ is executed. In order to understand the reason,
! 889: %en we need to study the format of floating point numbers.
! 890: %en (See \ref{chapter:naibu} for details).
! 891: %en For now, please keep the following in our mind.
! 892: \begin{FRAME}
! 893: $B@0?t$dJ,?t$N7W;;$O(B Asir $B>e$G@53N$K<B9T$5$l$k$,(B,
! 894: $B>.?t$K$D$$$F$O$=$&$G$J$$(B.
! 895: \end{FRAME}
! 896: $B$H3P$($F$*$3$&(B.
! 897: %en \begin{FRAME}
! 898: %en Arithmetics for integers and rational numbers are exact in Risa/Asir,
! 899: %en but arithmetics for dicimal numbers are not.
! 900: %en \end{FRAME}
! 901: %en
! 902:
! 903: \begin{problem}
! 904: $B$"$?$($i$l$?(B 10 $B?J?t$r(B 2$B?J?t$XJQ49$9$k%W%m%0%i%`$r:n$l(B.
! 905: $B%R%s%H(B: {\tt A}$B!`(B{\tt B} $B$NM>$j$O(B \verb@A%B@ $B$G7W;;$G$-$k(B.
! 906: \index{$B$"$^$j(B@$BM>$j(B}
! 907: \end{problem}
! 908:
! 909: \section{$B<B9T$NCf;_(B}
! 910: %
! 911: %
! 912: \index{$B$A$e$&$7(B@$BCf;_(B} \index{interrupt}
! 913: $B<B9TCf$N7W;;$d%W%m%0%i%`$N<B9T$rCf;_$7$?$$;~$OCf;_%\%?%s(B
! 914: \begin{center}
! 915: \scalebox{0.1}{\includegraphics{Figs/buttonStop.eps}}
! 916: \end{center}
! 917: $B$r%/%j%C%/$9$k(B.
! 918:
! 919: \begin{figure}[tbh]
! 920: \begin{center}
! 921: \scalebox{0.5}{\includegraphics{Figs/interrupt.eps}}
! 922: \end{center}
! 923: \caption{$B<B9T$NCf;_(B} \label{fig:interrupt}
! 924: \end{figure}
! 925:
! 926: $B?^(B\ref{fig:interrupt}$B$G$O(B
! 927: $10^{100}$ $B2s$N(B {\tt Hello } $B$N=PNO$N7+$jJV$7$rCf;_$7$F$$$k(B.
! 928:
! 929: cfep $B$O3+H/ES>e$N%7%9%F%`$N$?$a(B
! 930: \begin{verbatim}
! 931: [control] control function_id is 1030
! 932: [control] control_reset_connection.
! 933: Sending the SIGUSR1 signal to 1226: Result = 0
! 934: In ox103_reset: Done.
! 935: 515
! 936: Done
! 937: \end{verbatim}
! 938: $B$3$N$h$&$J3+H/<T@lMQ$N%a%C%;!<%8$b=PNO$5$l$k$,(B,
! 939: $B$H$j$"$($:$3$N$h$&$J%a%C%;!<%8$,$G$?$iCf;_$,@.8y$7$?$H$$$&$3$H$G$"$k(B.
! 940:
! 941:
! 942: \section{$B%(%s%8%s:F5/F0(B}
! 943:
! 944: \index{$B$5$$$-$I$&(B@$B:F5/F0(B} \index{$B$1$$$5$s$($s$8$s(B@$B7W;;%(%s%8%s(B}
! 945: \index{$B$1$$$5$s$5!<$P(B@$B7W;;%5!<%P(B}
! 946: Cfep/asir $B$G$O<!$N$h$&$K(B3$B$D$N%W%m%;%9$,8_$$$KDL?.$7$J$,$iF0:n$7$F$$$k(B.
! 947: \begin{center}
! 948: \fbox{cfep} $\Leftrightarrow$ \fbox{$B%3%s%H%m!<%i(B(ox\_texmacs)}
! 949: $\Leftrightarrow$ \fbox{$B7W;;%(%s%8%s(B(ox\_asir)}
! 950: \end{center}
! 951: $B7W;;%(%s%8%s(B($B7W;;%5!<%P(B)$B$r:F5/F0$7$?$jJL$N$b$N$K$H$j$+$($?$j$G$-$k(B.
! 952: \index{$B$1$$$5$s$($s$8$s(B@$B7W;;%(%s%8%s(B}
! 953: \index{$B$1$$$5$s$5!<$P(B@$B7W;;%5!<%P(B}
! 954: \index{$B$($s$8$s(B@$B%(%s%8%s(B}
! 955:
! 956: \index{$B$5$$$-$I$&(B@$B:F5/F0(B} \index{restart}
! 957: $B%(%s%8%s:F5/F0%\%?%s(B
! 958: \begin{center}
! 959: \scalebox{0.05}{\includegraphics{Figs/buttonRestart}}
! 960: \end{center}
! 961: $B$r%/%j%C%/$9$k$H(B,
! 962: $B8=:_MxMQ$7$F$$$k7W;;%(%s%8%s$rDd;_$7(B,
! 963: $B?7$7$$7W;;%(%s%8%s$r%9%?!<%H$9$k(B.
! 964: $BA*BrHO0O$N$_$r<B9T$9$k%b!<%I$G$J$$$+$.$jMxMQ>e$GCf;_$H$N0c$$$O(B
! 965: $B$"$^$j$J$$$,(B, $B:F5/F0$N$H$-$N%a%C%;!<%8(B
! 966: \begin{center}
! 967: \scalebox{0.4}{\includegraphics{Figs/restartDialog}}
! 968: \end{center}
! 969: $B$K$b$"$k$h$&$K(B, $BJL$N7W;;%(%s%8%s$r5/F0$9$k$3$H$b2DG=$G$"$k(B.
! 970: $B$3$NNc$G$O(B unix shell $B$b5/F0$G$-$k(B.
! 971:
! 972: $B$^$?(B, ``$B<B9T(B'' $B%a%K%e!<$+$i(B ``$B%(%s%8%s$r<+F0%9%?!<%H$7$J$$(B'' $B%b!<%I$rA*$s$G$k(B
! 973: $B>l9g$K7W;;%(%s%8%s$r<jF0$G%9%?!<%H$9$k$K$O(B, $B$3$N%\%?%s$rMQ$$$k(B.
! 974:
! 975: \bigbreak
! 976:
! 977: \noindent
! 978: \HHH
! 979: cfep $B$O(B \index{cfep}
! 980: Cocoa FrontEnd view Process
! 981: $B$NN,$G$"$k(B.
! 982: cfep $B$O(B Objective C $B$H$$$&8@8l$*$h$S(B xcode 2 $B$H$$$&3+H/4D6-$rMQ$$$F(B
! 983: Cocoa $B$H$$$&%U%l!<%`%o!<%/$N$b$H$G3+H/$5$l$F$$$k(B.
! 984: cfep $B$N(B Objective C $B$N%W%m%0%i%`$N0lIt$r$_$F$_$h$&(B.
! 985: \begin{screen}
! 986: \begin{verbatim}
! 987: for (i=0; i<oglCommSize; i++) {
! 988: gc = [oglComm objectAtIndex: i];
! 989: [self execute: gc];
! 990: }
! 991: \end{verbatim}
! 992: \end{screen}
! 993: asir $B$HF1$8$h$&$J(B {\tt for} $BJ8$,$"$k$M(B.
! 994:
! 995: \section{$B%X%k%W$NMxMQ(B}
! 996:
! 997: \index{$B$+$s$9$&(B@$B4X?t(B}
! 998: Cfep/asir $B$G$N(B ``$B4X?t(B'' $B$H$O?t3X$N4X?t$N$h$&$K0z?t$rM?$($k$H7W;;$7$FCM$r$b$I$7(B,
! 999: $B$+$D$"$k;E;v(B($BI=<(Ey(B)$B$r$9$k<jB3$-$N=8$^$j$G$"$k(B.
! 1000: $BNc$($P(B {\tt print}, {\tt deval}, {\tt sin}, {\tt fctr} $BEy$O4X?t$G$"$k(B.
! 1001: $B4X?t$r<+J,$GDj5A$9$k$3$H$b2DG=$G$"$k(B. $B$3$l$K$D$$$F$O8e$N@bL@$*$h$S(B
! 1002: ``asir$B%I%j%k(B''$B$r;2>H(B.
! 1003:
! 1004: $B$"$i$+$8$aDj5A$:$_$N4X?t$r(B ``$BAH$_9~$_4X?t(B'' $B$H$h$V(B.
! 1005: \index{help}
! 1006: \index{$B$X$k$W(B@$B%X%k%W(B} \index{$B$/$_$3$_$+$s$9$&(B@$BAH$_9~$_4X?t(B}
! 1007: $BAH$_9~$_4X?t$N>\$7$$@bL@$rD4$Y$k$K$O(B
! 1008: ``cfep $B$N%X%k%W(B'' $B$+$i(B
! 1009: \begin{center}
! 1010: \scalebox{0.3}{\includegraphics{Figs/helpTop}}
! 1011: \end{center}
! 1012: $B$N(B ``$B:w0z(B'' $B$rA*$S(B, $B:w0z(B
! 1013: \begin{center}
! 1014: \scalebox{0.45}{\includegraphics{Figs/helpIndex}}
! 1015: \end{center}
! 1016: $B$N(B ``Risa/Asir $B%^%K%e%"%k(B'' $B$rA*$S(B,
! 1017: ``Risa/Asir $B%^%K%e%"%k(B'' $B$N:G=i$N%Z!<%8$N4X?t0lMw$+$i(B
! 1018: $BD4$Y$?$$4X?t$rC5$9(B.
! 1019: $B$?$H$($P(B {\tt fctr} ($B0x?tJ,2rMQ$N4X?t(B) $B$O$3$N0lMw$NCf$K$"$k(B.
! 1020: \begin{center}
! 1021: \scalebox{0.35}{\includegraphics{Figs/helpFctr}}
! 1022: \end{center}
! 1023: \index{fctr}
! 1024:
! 1025:
! 1026: \index{spotlight}
! 1027: $B8!:w$K$O(B spotlight $B$N3hMQ$bM-1W$G$"$m$&(B. $B:w0z(B
! 1028: \begin{center}
! 1029: \scalebox{0.45}{\includegraphics{Figs/helpIndex}}
! 1030: \end{center}
! 1031: $B$N(B ``$B;HMQ@bL@=q$N%U%)%k%@$r(Bfinder$B$G3+$/(B''
! 1032: $B$rA*$V$H;HMQ@bL@=q$N%U%)%k%@$,3+$/$N$G(B, $B$3$3$r(B spotlight $B$G8!:w$9$k$H(B
! 1033: $B$$$m$$$m$JH/8+$,$"$k$G$"$m$&(B.
! 1034: $B$A$J$_$K(B, $B$3$ND6F~Lg$d(B asir$B%I%j%k$O$3$N%U%)%k%@$N(B pdf $B%U%)%k%@$NCf$K$"$k(B.
! 1035: ($B$J$*$3$3$+$i$N(B spotlight $B8!:w$O2?8N$+CY$$$N$G(B, $B%a%K%e!<%P!<$N(B
! 1036: splotlight $B$+$i$N8!:w$NJ}$,$$$$$+$b$7$l$J$$(B.
! 1037: )
! 1038: %% mdfind, mdimport?
! 1039:
! 1040:
! 1041: \chapter{$B%0%i%U%#%C%/(B}
! 1042:
! 1043: \section{$B%i%$%V%i%j$NFI$_9~$_(B} \index{$B$i$$$V$i$j(B@$B%i%$%V%i%j(B}
! 1044:
! 1045: \begin{figure}
! 1046: \begin{center}
! 1047: \scalebox{0.5}{\includegraphics{Figs/glib_lineImport.eps}}
! 1048: \end{center}
! 1049: \caption{$B%i%$%V%i%j$N%m!<%I(B} \label{fig:glib_lineImport}
! 1050: \end{figure}
! 1051:
! 1052: Asir $B8@8l$G=q$+$l$F$$$k4X?tDj5A$N=89g$,%i%$%V%i%j$G$"$k(B.
! 1053: $B%i%$%V%i%j$rFI$_9~$`$K$O(B {\tt import} $B%3%^%s%I$^$?$O(B
! 1054: {\tt load} $B%3%^%s%I$rMQ$$$k(B. \index{import} \index{load}
! 1055: $B%^%K%e%"%k$K5-=R$5$l$F$$$k4X?t$G%i%$%V%i%j$NFI$_9~$_$,A0Ds$H$J$C$F$k$b$N$b(B
! 1056: $BB?$$(B.
! 1057: $B$?$H$($P(B, $B@~$r0z$/%3%^%s%I(B {\tt glib\_line(0,0,100,100);}
! 1058: $B$r<B9T$7$F$b(B, ``glib\_line $B$,Dj5A$5$l$F$$$^$;$s(B''
! 1059: $B$H$$$&%(%i!<$,I=<($5$l$k(B.
! 1060: $B%0%i%U%#%C%/%3%^%s%I$N%i%$%V%i%jFI$_9~$`%3%^%s%I(B
! 1061: \begin{verbatim}
! 1062: import("glib3.rr");
! 1063: \end{verbatim}
! 1064: $B$r<B9T$7$F$*$/$H?^(B\ref{fig:glib_lineImport}$B$N$h$&$K(B
! 1065: $B@~$rIA2h$9$k(B.
! 1066:
! 1067:
! 1068: Asir-contrib $B%W%m%8%'%/%H$K$h$j=8@Q$5$l$?%i%$%V%i%j$N=89gBN$,(B
! 1069: asir-contrib $B$G$"$k(B. \index{asir-contrib}
! 1070: Asir-contrib $B$rFI$_9~$s$G$7$^$&$H(B,
! 1071: $B$[$H$s$I$N4X?t$K$D$$$F(B import $B$,I,MW$+$I$&$+5$$K$9$kI,MW$O$J$/$J$k$,(B,
! 1072: $BBgNL$N%i%$%V%i%j$rFI$_9~$`$?$a$K;~4V$,$+$+$k$N$,7gE@$G$"$k(B.
! 1073: asir-contrib $B$O(B \fbox{$B<B9T(B} $B%a%K%e!<$+$iFI$_9~$a$k(B.
! 1074: \begin{center}
! 1075: \scalebox{0.3}{\includegraphics{Figs/importContrib}}
! 1076: \end{center}
! 1077:
! 1078: \section{$B@~$r0z$/4X?t(B}
! 1079:
! 1080: \begin{example} \rm
! 1081: \begin{screen}
! 1082: \begin{verbatim}
! 1083: import("glib3.rr");
! 1084: glib_line(0,0, 100,100);
! 1085: glib_flush();
! 1086: \end{verbatim}
! 1087: \end{screen}
! 1088: $B?^(B\ref{fig:glib_lineImport} $B$,IA2h7k2L$G$"$k(B.
! 1089: $y$$B:BI8$O2hLL$,2<$X$$$/$[$IBg$-$/$J$k(B.
! 1090: $B?^(B\ref{figure:cond:coord} $B$r;2>H(B.
! 1091: $B:8>e$N:BI8$O(B $(0,0)$, $B1&2<$N:BI8$,(B $(400,400)$.
! 1092: \verb@glib_line@ $B$G(B $(0,0)$ $B$+$i(B $(100,100)$ $B$X@~$rIA2h(B.
! 1093: \verb@glib_flush@ $B$O2hLL$r99?7$9$k$O$?$i$-$,$"$k(B. flush $B$7$J$$$H(B,
! 1094: $BIA2h7k2L$,2hLL$G$NI=<($KH?1G$7$J$$>l9g$,$"$k(B.
! 1095: \end{example}
! 1096:
! 1097: \index{glib}
! 1098: {\tt glib3.rr} $B$r%m!<%I$9$k$3$H$K$h$j(B, $B<!$N4X?t$,;H$($k$h$&$K$J$k(B. \\
! 1099: \begin{tabular}{|l|l|}
! 1100: \hline
! 1101: {\tt glib\_window(X0,Y0,X1,Y1)} &
! 1102: $B?^$r=q$/(B window $B$N%5%$%:$r7h$a$k(B. \\
! 1103: & $B2hLL:8>e$N:BI8$,(B {\tt (X0,Y0)},
! 1104: $B2hLL1&2<$N:BI8$,(B {\tt (X1,Y1)} \\
! 1105: & $B$G$"$k$h$&$J:BI87O$G0J2<IA2h$;$h(B. \\
! 1106: & $B$?$@$7(B x $B:BI8$O(B, $B1&$K$$$/$K=>$$$*$*$-$/$J$j(B, \\
! 1107: &
! 1108: y $B:BI8$O(B \underline{$B2<$K(B} $B$$$/$K=>$$Bg$-$/$J$k(B ($B?^(B \ref{figure:cond:coord}). \\ \hline
! 1109: {\tt glib\_clear()} & $BA4$F$N(BOpenGL$B%*%V%8%'%/%H$r>C5n$7(B,
! 1110: $BIA2h2hLL$r%/%j%"$9$k(B. \\ \hline
! 1111: {\tt glib\_putpixel(X,Y)} & $B:BI8(B {\tt (X,Y)} $B$KE@$rBG$D(B. \\ \hline
! 1112: {\tt glib\_set\_pixel\_size(S)} &
! 1113: $BE@$NBg$-$5$N;XDj(B. 1.0 $B$,(B1$B%T%/%;%kJ,$NBg$-$5(B. \\ \hline
! 1114: {\tt glib\_line(X,Y,P,Q)} & $B:BI8(B {\tt (X,Y)} $B$+$i(B $B:BI8(B {\tt (P,Q)} $B$XD>@~$r0z$/(B \\ \hline
! 1115: {\tt glib\_remove\_last()} & $B0l$DA0$N(B OpenGL $B%*%V%8%'%/%H$r>C$9(B. \\ \hline
! 1116: \end{tabular}
! 1117:
! 1118: \begin{figure}[htb]
! 1119: \setlength{\unitlength}{1mm}
! 1120: \begin{picture}(100,40)(0,0)
! 1121: \put(20,35){\vector(1,0){80}}
! 1122: \put(98,32){x}
! 1123: \put(20,35){\vector(0,-1){35}}
! 1124: \put(23,1){y}
! 1125: \end{picture}
! 1126: \caption{$B:BI87O(B} \label{figure:cond:coord}
! 1127: \end{figure}
! 1128:
! 1129: $B?'$rJQ99$7$?$$$H$-$O(B, \verb@ | @ $B5-9f$G6h@Z$C$?%*%W%7%g%J%k0z?t(B
! 1130: {\tt color} $B$r;H$&(B. \index{$B$*$W$7$g$J$k$R$-$9$&(B@$B%*%W%7%g%J%k0z?t(B}
! 1131: $B$?$H$($P(B,
! 1132: \begin{center}
! 1133: \verb@ glib_line(0,0,100,100|color=0xff0000); @
! 1134: \end{center}
! 1135: $B$HF~NO$9$k$H(B, $B?'(B {\tt 0xff0000} $B$G@~J,$r$R$/(B.
! 1136: $B$3$3$G(B, $B?'$O(B RGB $B$N3F@.J,$N6/$5$r(B 2 $B7e$N(B 16 $B?J?t$G;XDj$9$k(B.
! 1137: 16$B?J?t$K$D$$$F$O(B ``asir $B%I%j%k(B'' $B$r;2>H(B.
! 1138: $B$3$NNc$G$O(B, R $B@.J,$,(B ff $B$J$N$G(B, $B@V$N@~$r$R$/$3$H$H$J$k(B.
! 1139: $B$J$*(B, $B4X?t(B {\tt glib\_putpixel} $B$bF1$8$h$&$K$7$F(B, $B?'$r;XDj$G$-$k(B.
! 1140:
! 1141: $B$5$F(B, $B?^(B \ref{figure:cond:coord} $B$G8+$?$h$&$K%3%s%T%e!<%?%W%m%0%i%`$N(B
! 1142: $B@$3&$G$O(B, $B2hLL$N:8>e$r86E@$K$7$F(B, $B2<$X$$$/$K=>$$(B, $y$ $B:BI8$,A}$($k$h$&$J(B
! 1143: $B:BI87O$r$H$k$3$H$,B?$$(B.
! 1144: $B?t3X$N%0%i%U$r=q$$$?$j$9$k$K$O$3$l$G$OITJX$J$3$H$bB?$$$N$G(B,
! 1145: {\tt glib3.rr} $B$G$O(B,
! 1146: \begin{center}
! 1147: \verb@ Glib_math_coordinate=1; @
! 1148: \end{center}
! 1149: $B$r<B9T$7$F$*$/$H(B
! 1150: $B2hLL$N:82<$,86E@$G(B, $B>e$K$$$/$K=>$$(B $y$ $B:BI8$,A}$($k$h$&$J(B
! 1151: $B?t3X$G$N:BI87O$G?^$rIA2h$9$k(B.
! 1152:
! 1153: \begin{example} \rm \index{$B$0$i$U(B@$B%0%i%U(B}
! 1154: 2$B<!4X?t(B $y=x^2-1$ $B$N%0%i%U$r=q$$$F$_$h$&(B.
! 1155: %%Prog: cfep/tests/2006-03-11-graph2d.rr
! 1156: \begin{screen}
! 1157: \begin{verbatim}
! 1158: import("glib3.rr");
! 1159: Glib_math_coordinate=1;
! 1160: glib_window(-2,-2, 2,2);
! 1161:
! 1162: glib_line(-2,0,2,0 | color=0x0000ff);
! 1163: glib_line(0,-2,0,2 | color=0x0000ff);
! 1164: for (X=-2.0; X< 2.0; X = X+0.1) {
! 1165: Y = X^2-1;
! 1166: X1 = X+0.1;
! 1167: Y1 = X1^2-1;
! 1168: glib_line(X,Y, X1,Y1);
! 1169: }
! 1170: glib_flush();
! 1171: \end{verbatim}
! 1172: \end{screen}
! 1173: $B<B9T7k2L$O?^(B\ref{fig:graph2d}.
! 1174: -----$B%W%m%0%i%`$N2r@b$O$^$@=q$$$F$J$$(B.
! 1175: \end{example}
! 1176:
! 1177: %<C
! 1178: \begin{figure}[tb]
! 1179: \scalebox{0.6}{\includegraphics{Figs/graph2d.eps}}
! 1180: \caption{2$B<!4X?t$N%0%i%U(B} \label{fig:graph2d}
! 1181: \end{figure}
! 1182: %>C
! 1183:
! 1184:
! 1185: \section{$B1_$rIA$/4X?t$r:n$C$F$_$h$&(B}
! 1186:
! 1187: %%Prog: cfep/tests/2006-03-11-circle.rr
! 1188: \begin{screen}
! 1189: \begin{verbatim}
! 1190: import("glib3.rr");
! 1191: Glib_math_coordinate=1;
! 1192: glib_window(-1,-1,1,1);
! 1193: glib_clear();
! 1194: E = 0.2; X = 0; Y = 0; R = 0.5;
! 1195: for (T=0; T<=deval(2*@pi); T = T+E) {
! 1196: Px = X+deval(R*cos(T));
! 1197: Py = Y+deval(R*sin(T));
! 1198: Qx = X+deval(R*cos(T+E));
! 1199: Qy = Y+deval(R*sin(T+E));
! 1200: glib_line(Px,Py,Qx,Qy);
! 1201: glib_flush();
! 1202: }
! 1203: \end{verbatim}
! 1204: \end{screen}
! 1205: -----$B%W%m%0%i%`$N2r@b$O$^$@=q$$$F$J$$(B.
! 1206:
! 1207: $B>e$N%W%m%0%i%`$G$O(B $cos$, $sin$ $B$rMQ$$$F1_$rIA$$$F$$$k(B.
! 1208: $BCf?4(B, $BH>7B$rJQ99$7$?$j(B, $B?'$rJQ99$7$?$j$7$J$,$i$?$/$5$s$N1_$rIA$/$K$O(B,
! 1209: $B$I$N$h$&$K$9$l$P$h$$$G$"$m$&$+(B?
! 1210: ``$B4X?t(B'' $B$rMQ$$$k$H$=$l$,MF0W$K$G$-$k(B.
! 1211:
! 1212: $B$"$k$R$H$^$H$^$j$N%W%m%0%i%`$O4X?t(B (function) $B$H$7$F(B
! 1213: $B$^$H$a$F$*$/$H$h$$(B. \index{$B$+$s$9$&(B@$B4X?t(B}
! 1214: $B7W;;5!8@8l$K$*$1$k4X?t$O?t3X$G$$$&4X?t$H;w$FHs$J$k$b$N$G$"$k(B.
! 1215: $B4X?t$r<jB3$-(B (procedure) $B$H$+(B $B%5%V%k!<%A%s(B (subroutine) $B$H$+(B
! 1216: $B$h$V8@8l$b$"$k(B.
! 1217: $B4X?t$rMQ$$$k:GBg$NMxE@$O(B, $B4X?t$r0lC6=q$$$F$7$^$($P(B,
! 1218: $BCf?H$r%V%i%C%/%\%C%/%9$H$7$F07$($k$3$H$G$"$k(B.
! 1219: $BBg5,LO$J%W%m%0%i%`$r=q$/$H$-$OJ#;($J=hM}$r$$$/$D$+$N4X?t$KJ,3d$7$F(B
! 1220: $B$^$:3F4X?t$r==J,%F%9%H$7;E>e$2$k(B.
! 1221: $B$=$l$+$i$=$l$i$N4X?t$rAH$_9g$o$;$F$$$/$3$H$K$h$j(B,
! 1222: $BJ#;($J5!G=$r<B8=$9$k(B.
! 1223: $B$3$N$h$&$J%"%W%m!<%A$r$H$k$3$H$K$h$j(B, ``$B:$Fq$,J,3d(B'' $B$5$l$k(B.
! 1224:
! 1225: %<C
! 1226: \begin{figure}[tbh]
! 1227: \scalebox{0.6}{\includegraphics{Figs/circleFunc.eps}}
! 1228: \caption{ $B4X?t$K$h$kF1?41_$NIA2h(B} \label{fig:circleFunc}
! 1229: \end{figure}
! 1230: %>C
! 1231:
! 1232: $B$5$F1_$rIA$/Nc$K$b$I$m$&(B.
! 1233: $B0J2<$N$h$&$K4X?t(B {\tt circle(X,Y,R,Color)}$B$rDj5A(B ({\tt def}) $B$9$k(B.
! 1234: $B$3$N4X?t$r(B $R$ $B$d(B $Color$ $B$rJQ2=$5$;$J$,$i8F$V$3$H$K$h$j(B,
! 1235: $B?^(B\ref{fig:circleFunc} $B$N$h$&$JF1?41_$N?^$rIA$/$3$H$,2DG=$H$J$k(B.
! 1236: $B4X?t$K$D$$$F>\$7$/$O(B ``asir $B%I%j%k(B'' $B$r;2>H$7$F$[$7$$(B.
! 1237:
! 1238: \begin{screen}
! 1239: \begin{verbatim}
! 1240: import("glib3.rr");
! 1241:
! 1242: def circle(X,Y,R,Color) {
! 1243: E = 0.2;
! 1244: for (T=0; T<deval(2*@pi); T = T+E) {
! 1245: Px = X+deval(R*cos(T));
! 1246: Py = Y+deval(R*sin(T));
! 1247: Qx = X+deval(R*cos(T+E));
! 1248: Qy = Y+deval(R*sin(T+E));
! 1249: glib_line(Px,Py,Qx,Qy | color=Color);
! 1250: }
! 1251: glib_flush();
! 1252: }
! 1253:
! 1254: Glib_math_coordinate=1;
! 1255: glib_window(-1,-1,1,1);
! 1256: glib_clear();
! 1257: CC = 0xff0000;
! 1258: for (P = 0.4; P<0.5; P = P+0.01) {
! 1259: circle(0,0,P,CC);
! 1260: CC = random()%0x1000000;
! 1261: }
! 1262: \end{verbatim}
! 1263: \end{screen}
! 1264: -----$B%W%m%0%i%`$N>\$7$$2r@b$^$@(B.
! 1265:
! 1266: \begin{problem} \rm
! 1267: \begin{enumerate}
! 1268: \item $BJ,EY4o$rIA$/%W%m%0%i%`$r:n$l(B.
! 1269: \item ($BH/E82]Bj(B) $B$3$NJ,EY4o(B, $B;e(B, $B$*$b$j(B, $B$o$j$P$7(B, $BHD(B, cfep/asir $B$K$h$k%W%m%0%i%`Ey$rMQ$$$F(B,
! 1270: $BLZ$d%S%k$N9b$5$rB,Dj$9$k5!3#$H%=%U%H%&%(%"%7%9%F%`$r3+H/$;$h(B.
! 1271: \end{enumerate}
! 1272: \end{problem}
! 1273:
! 1274: \begin{problem} \rm
! 1275: ($B$3$l$OH/E82]Bj(B) \index{OpenGL} \index{3$B$8$2$s$0$i$U$#$C$/$9(B@3$B<!85%0%i%U%#%C%/%9(B}
! 1276: cfep $B$K$O(B OpenGL $B%$%s%?%W%j%?!<$,AH$_9~$s$G$"$k(B.
! 1277: OpenGL $B$O(B3$B<!85%0%i%U%#%C%/%9$rMQ$$$k%=%U%H%&%(%":n@.$N$?$a$K(B
! 1278: $BMQ$$$i$l$kLs(B 150$B<oN`$N%3%^%s%I$+$i9=@.$5$l$F$$$k%Q%C%1!<%8$G(B
! 1279: 3$B<!85%0%i%U%#%C%/%9$NI8=`5,3J$N$R$H$D$G$b$"$k(B.
! 1280: cfep 1.1$B$G$O$=$NCf$N(B 10 $B<e$N%3%^%s%I$rMxMQ$G$-$k(B.
! 1281:
! 1282: $B$3$N(B OpenGL $B%$%s%?%W%j%?!<$rMQ$$(B,
! 1283: $BB?LLBN(B(polygon)$B$r:`NA$K$7(B,
! 1284: cfep$B>e5iJT(B, OpenGL $B$N%W%m%0%i%`$r;29M$K(B
! 1285: ``$B2H(B'' $B$r=q$$$F$_$h$&(B.
! 1286: \end{problem}
! 1287:
! 1288:
! 1289:
! 1290: \chapter{For $BJ8$K$h$k?tNs$N7W;;(B}
! 1291:
! 1292: \section{$BD6F~Lg(B, $BBh(B2$B$N4XLg(B: $BA22=<0$G$-$^$k?tNs$N7W;;(B}
! 1293:
! 1294: \begin{example} \rm
! 1295: $a$ $B$r@5$N?t$H$9$k$H$-(B,
! 1296: \begin{eqnarray*}
! 1297: x_{n+1} &=& \frac{x_n + \frac{a}{x_n}}{2}, \\
! 1298: x_0 &=& a
! 1299: \end{eqnarray*}
! 1300: $B$G$-$^$k?tNs(B $x_0, x_1, x_2, \ldots $
! 1301: $B$O(B $\sqrt{a}$ $B$K$I$s$I$s6aIU$/$3$H(B($B<}B+$9$k$3$H(B)$B$,CN$i$l$F$$$k(B.
! 1302: $a=2$ $B$N;~(B, $x_1, x_2, \ldots, x_4$ $B$r7W;;$9$k%W%m%0%i%`$r=q$$$F$_$h$&(B.
! 1303: %%Prog: cfep/tests/2006-03-11-sqrt.rr
! 1304: \begin{screen}
! 1305: \begin{verbatim}
! 1306: A = 2.0;
! 1307: X = A;
! 1308: for (I=0; I<5; I++) {
! 1309: Y = (X+A/X)/2;
! 1310: print(Y);
! 1311: X = Y;
! 1312: }
! 1313: \end{verbatim}
! 1314: \end{screen}
! 1315: \end{example}
! 1316:
! 1317: $B$3$N%W%m%0%i%`$N<B9T7k2L$O?^(B\ref{fig:sqrt}.
! 1318: %<C
! 1319: \begin{figure}[tbh]
! 1320: \scalebox{0.5}{\includegraphics{Figs/sqrt.eps}}
! 1321: \caption{$\sqrt{2}$ $B$K<}B+$9$k?tNs(B} \label{fig:sqrt}
! 1322: \end{figure}
! 1323: %>C
! 1324:
! 1325: $BD6F~Lg$G$N4XLg$O(B
! 1326: \begin{screen}
! 1327: \begin{verbatim}
! 1328: Y = (X+A/X)/2;
! 1329: X = Y;
! 1330: \end{verbatim}
! 1331: $B$N0UL#$r40A4$KM}2r$9$k$3$H(B
! 1332: \end{screen}
! 1333: $B$G$"$k(B.
! 1334: $BJQ?t$N>O$G@bL@$7$?$h$&$K(B,
! 1335: $$ \mbox{{\bf $BJQ?tL>(B}} {\tt = } \mbox{{\bf $B<0(B}} {\tt ;} $$
! 1336: $B$O$^$:1&JU$N<0$r7W;;$7$=$N$"$H$=$N7W;;7k2L$r:8JU$NJQ?t$KBeF~$;$h$H$$$&0UL#(B
! 1337: $B$G$"$k(B. $B$7$?$,$C$F(B,
! 1338: \verb@ Y = (X+A/X)/2; @ $B$O8=:_$N(B {\tt X} $B$H(B {\tt A} $B$K3JG<$5$l$?(B
! 1339: $B?t;z$r$b$H$K(B \verb@ (X+A/X)/2 @ $B$NCM$r7W;;$7(B, $B$=$N7k2L$rJQ?t(B {\tt Y} $B$XBeF~$;$h(B,
! 1340: $B$H$$$&0UL#$G$"$k(B. $B$^$?(B
! 1341: \begin{screen}
! 1342: \verb@X=Y@ $B$O(B \verb@X@ $B$,(B \verb@Y@ $B$KEy$7$$$H$$$&0UL#$G$O$J$/(B,
! 1343: $BJQ?t(B\verb@Y@ $B$K3JG<$5$l$??t;z$r(B $BJQ?t(B \verb@X@ $B$KBeF~$;$h$H$$$&0UL#$G$"$k(B.
! 1344: \end{screen}
! 1345: $B$3$N$h$&$K9M$($l$P(B, $B>e$N%W%m%0%i%`$,(B $x_1, x_2, x_3, x_4$ $B$NCM$r(B
! 1346: $B=gHV$K7W;;$7$F(B print $B$7$F$$$kM}M3$,M}2r$G$-$k$G$"$m$&(B.
! 1347: $B<+J,$,7W;;5!$K$J$C$?$D$b$j$G(B,
! 1348: $BJQ?t$NCf$N?tCM$,$I$N$h$&$KJQ2=$7$F$$$/$N$+(B,
! 1349: $B=q$-$J$,$iM}2r$7$FD:$-$?$$(B.
! 1350: $B$3$l$,$O$C$-$jM}2r$G$-(B, $B1~MQLdBj$,<+M3$K2r$1$k$h$&$K$J$C$?(B, $BD6F~LgB46H$G$"$k(B.
! 1351: \index{$B$@$$$K$e$&(B@$BBeF~(B}
! 1352:
! 1353: \section{$B1_$rIA$/?tNs(B}
! 1354:
! 1355: $B?tNs$N7W;;$rMQ$$$k$H(B, $\cos$ $B$d(B $\sin$ $B$N7W;;$r$d$i$:$K1_$rIA$/$3$H$,(B
! 1356: $B$G$-$k(B.
! 1357: %%Prog: cfep/tests/2006-03-11-circle-dda.rr
! 1358: \begin{screen}
! 1359: \begin{verbatim}
! 1360: import("glib3.rr");
! 1361: Glib_math_coordinate=1;
! 1362: glib_window(-2,-2, 2,2);
! 1363: glib_clear();
! 1364: E = 0.1;
! 1365: C1 = 1.0; C2=1.0;
! 1366: S1 = 0.0; S2=E;
! 1367: for (T=0; T<=deval(2*@pi); T = T+E) {
! 1368: C3 = 2*C2-C1-E*E*C2;
! 1369: S3 = 2*S2-S1-E*E*S2;
! 1370: glib_line(C1,S1, C2,S2);
! 1371: C1=C2; S1=S2;
! 1372: C2=C3; S2=S3;
! 1373: glib_flush();
! 1374: }
! 1375: \end{verbatim}
! 1376: \end{screen}
! 1377:
! 1378: $B$3$N%W%m%0%i%`$N<B9T7k2L$O?^(B\ref{fig:circleDda}.
! 1379: %<C
! 1380: \begin{figure}[tbh]
! 1381: \scalebox{0.6}{\includegraphics{Figs/circleDda.eps}}
! 1382: \caption{$\cos$, $\sin$ $B$r;H$o$:$K1_$rIA$/(B} \label{fig:circleDda}
! 1383: \end{figure}
! 1384: %>C
! 1385:
! 1386: -----$B%W%m%0%i%`$N2r@b$^$@=q$$$F$J$$(B.
! 1387:
! 1388: $B$3$NOCBj$O(B, $B?tNs$N7W;;$H:9J,J}Dx<0$K$h$k%7%_%e%l!<%7%g%s$KB3$/(B.
! 1389: $B$3$l$K$D$$$F$O$^$?9F$r$"$i$?$a$F=q$$$F$_$?$$(B.
! 1390:
! 1391: $B0J>e$GD6F~Lg$O=*N;$G$"$k(B. $BB3$-$O(B ``Asir $B%I%j%k(B'' $B$rFI$s$G$M(B.
! 1392:
! 1393: \chapter{cfep $B>e5iJT(B}
! 1394:
! 1395: \section{\TeX $B$K$h$k%?%$%W%;%C%H(B($B<B83E*(B)}
! 1396: %%Doc: cfep/tests/2006-03-06
! 1397: $B=PNO$r(BTeX$B$G%?%$%W%;%C%H$9$k$K$O(B
! 1398: ``$B<B9T(B'' $B%a%K%e!<$+$i(B ``$B=PNO$r(BTeX$B$G%?%$%W%;%C%H(B'' $B$rA*Br$9$k(B.
! 1399: fink $B$rMQ$$$F(B, {\tt latex}, {\tt dvips}, {\tt pstoimg} $B$,%$%s%9%H!<%k$5$l$F$$(B
! 1400: $B$J$$$HF0:n$7$J$$(B.
! 1401: \TeX $B$rMQ$$$?;E>e$jNc$O?^(B\ref{fig:sl2}$B$r8+$h(B.
! 1402: $B$J$*(B, \TeX $B$G%?%$%W%;%C%H$9$k>l9g%[!<%`$N2<$K(B
! 1403: \verb@OpenXM_tmp@ $B$J$k:n6HMQ$N%U%)%k%@$,:n@.$5$l$k(B.
! 1404: $B%?%$%W%;%C%H$O<B835!G=$N$?$a(B, $B$3$N%U%)%k%@$NCf$N:n6HMQ%U%!%$%k$O<+F0$G$O>C5n$5$l$J$$(B.
! 1405: $B;~!9<jF0$G:n6H%U%!%$%k$r>C5n$5$l$?$$(B.
! 1406: \index{tex@\TeX}
! 1407:
! 1408: \section{$BA*BrHO0O$N$_$N<B9T(B}
! 1409:
! 1410: \index{$B$;$s$?$/$O$s$$$N$_$N$8$C$3$&(B@$BA*BrHO0O$N$_$N<B9T(B}
! 1411: $B2hLL>e$N(B ``$BA*BrHO0O$N$_$r<B9T(B'' $B$r%A%'%C%/$9$k$H(B,
! 1412: ``$B;O$a(B'' $B%\%?%s$r$*$7$?$H$-(B, $BA*BrHO0O$N$_$,I>2A$5$l$k(B.
! 1413: $BA*BrHO0O$,$J$$>l9g$O%-%c%l%C%H0LCV$N9T$,<+F0A*Br$5$l$F<B9T$5$l$k(B.
! 1414: \command{{\tt Enter}} $B$HAH$_9g$o$;$F$3$N5!G=$r;H$&$H(B, $B%?!<%_%J%k$+$i(B
! 1415: asir $B$rMxMQ$9$k$N$K$A$g$C$H;w$F$/$k(B.
! 1416: $B?^(B\ref{fig:sl2}$B$O$3$N$h$&$J<B9T$r$7$F$$$kNc$G$"$k(B.
! 1417:
! 1418: %<C
! 1419: \begin{figure}[tbh]
! 1420: \scalebox{0.5}{\includegraphics{Figs/sl2.eps}}
! 1421: \caption{$B%?!<%_%J%kIw(B} \label{fig:sl2}
! 1422: \end{figure}
! 1423: %>C
! 1424:
! 1425:
! 1426: \noindent
! 1427: %%Doc: cfep/tests/2007-03-07-debug.rtfd
! 1428: \fbox{$B<ALd(B}
! 1429: cfep $B$N%$%s%?%U%'!<%9$G%G%P%C%0$r$7$J$,$i%W%m%0%i%`$r3+H/$9$k$K$O$I$N$h$&$K$d$k$H(B
! 1430: $B$h$$$+(B? \\
! 1431: \fbox{$BEz$((B}
! 1432: cfep $B$O=i?4<T8~$-$N%$%s%?%U%'!<%9$J$N$G(B,
! 1433: $BBg5,LO$J%W%m%0%i%`3+H/$rA[Dj$7$F$$$J$$$,(B,
! 1434: $B;d$O<!$N$h$&$K%i%$%V%i%j$N3+H/$r$7$F$$$k(B.
! 1435:
! 1436: \begin{enumerate}
! 1437: \item $BI,MW$J4X?t$r=q$/(B. $B2<$NNc$G$O(B {\tt sum1}.
! 1438: \item $B4X?t$r%F%9%H$9$kF~NO$r%3%a%s%H$N7A$G$=$N4X?t$N6a$/$K=q$$$F$*$/(B.
! 1439: $B2<$NNc$G$O%3%a%s%H$K$"$k(B {\tt sum1(10,1); } $BEy(B.
! 1440: \end{enumerate}
! 1441:
! 1442:
! 1443: \begin{screen}
! 1444: \begin{verbatim}
! 1445: /*
! 1446: testinput: sum1(10,1);
! 1447: testinput: sum1(10,2);
! 1448: */
! 1449: def sum1(N,M) {
! 1450: S = 0; i=1;
! 1451: for (I=1; I<N; I++) {S = S+I^M; }
! 1452: return S;
! 1453: }
! 1454: \end{verbatim}
! 1455: \end{screen}
! 1456:
! 1457: \begin{enumerate}
! 1458: \item ``$B;O$a(B'' $B%\%?%s$G4X?tDj5A$r%m!<%I(B.
! 1459: $B$3$N;~E@$GJ8K!%(%i!<$J$I$,$"$l$P%a%C%;!<%8$K$7$?$,$C$F=$@5(B.
! 1460: \item $B$=$N$"$H(B ``$BA*BrHO0O$N$_$r<B9T(B'' $B$N%b!<%I$KJQ99$7$F%3%a%s%HFb$N(B testinput $B$r<B9T(B.
! 1461: \item $B<B9T;~$N%(%i!<$N9THV9f$X$N0\F0$O(B "$BA*BrHO0O$N$_$r<B9T(B" $B$N%b!<%I$r2r=|$7$F$+$i(B
! 1462: $B9T$&(B. \index{$B$($i!<(B@$B%(%i!<(B}
! 1463: \end{enumerate}
! 1464:
! 1465: %<C
! 1466: \begin{figure}[tb]
! 1467: \scalebox{0.5}{\includegraphics{Figs/howtoDebug1.eps}}
! 1468: \caption{``$BA*BrHO0O$N$_$r<B9T(B''$B$N3hMQ(B} \label{fig:howtoDebug1}
! 1469: \end{figure}
! 1470: %>C
! 1471:
! 1472:
! 1473: \section{$B%(%s%8%s$r5/F0$7$J$$(B}
! 1474: %%cfep/tests/2006-03-08-noEngine
! 1475:
! 1476: \noindent
! 1477: \fbox{$B<ALd(B}
! 1478: $B%F%-%9%HJT=8$^$?$O%F%-%9%H$N1\Mw$@$1$G7W;;$r$9$k$D$b$j$O$"$j$^$;$s$,(B. \\
! 1479: \fbox{$BEz$((B}
! 1480: ``$B<B9T(B'' $B%a%K%e!<$G(B ``$B%(%s%8%s$r<+F05/F0$7$J$$(B'' $B$rA*Br(B. \\
! 1481: %<C
! 1482: \scalebox{0.3}{\includegraphics{Figs/menuNoEngine.eps}} \\
! 1483: %>C
! 1484: $B$"$H$G%(%s%8%s$r5/F0$7$?$$>l9g$O(B ``$B:F5/(B'' $B%\%?%s$r$*$7$F%(%s%8%s$r5/F0$9$k(B. \\
! 1485: %<C
! 1486: \scalebox{0.3}{\includegraphics{Figs/popupRestart.eps}}
! 1487: %>C
! 1488:
! 1489:
! 1490: \section{OpenGL$B%$%s%?%W%j%?(B}
! 1491:
! 1492: \index{OpenGL}
! 1493: Cfep $B$K$O(B OpenGL $B%$%s%?%W%j%?!<$,AH$_9~$s$G$"$k(B.
! 1494: OpenGL $B$O(B3$B<!85%0%i%U%#%C%/%9$rMQ$$$k%=%U%H%&%(%":n@.$N$?$a$K(B
! 1495: $BMQ$$$i$l$kLs(B 150$B<oN`$N%3%^%s%I$+$i9=@.$5$l$F$$$k%Q%C%1!<%8$G(B
! 1496: 3$B<!85%0%i%U%#%C%/%9$NI8=`5,3J$N$R$H$D$G$b$"$k(B.
! 1497: cfep 1.1$B$G$O$=$NCf$N(B 10 $B<e$N%3%^%s%I$rMxMQ$G$-$k(B.
! 1498: $B>\$7$/$O(B
! 1499: {\tt cfep.app/OpenXM/lib/asir-contrib/cfep-opengl.rr} $B$r;2>H(B.
! 1500:
! 1501: \index{OpenGL$B$0$i$U$#$C$/$*$V$8$'$/$H(B@OpenGL$B%0%i%U%#%C%/%*%V%8%'%/%H(B}
! 1502: OpenGL $B$G$O$^$:(B OpenGL$B%0%i%U%#%C%/%*%V%8%'%/%H$rG[CV$7(B,
! 1503: $B$=$l$+$i;kE@$N0LCV$+$i8+$?2hA|$rIA2h$9$kJ}K!$rMQ$$$k(B.
! 1504: $B$7$?$,$C$F(B, $B%7%9%F%`$O>o$K(B OpenGL$B%0%i%U%#%C%/%*%V%8%'%/%H$N=89g$rJ];}(B
! 1505: $B$7$F$$$k(B.
! 1506: {\tt glib\_remove\_last()} $BL?Na$O$=$N:G8e$NMWAG$r:o=|$9$kL?Na$G$"$k(B.
! 1507: {\tt cfep-opengl.rr} $B%i%$%V%i%j$G$O(B,
! 1508: {\tt opengl.metaRemoveLast()} $B4X?t$G:G8e$NMWAG$r:o=|$G$-$k(B.
! 1509: \index{opengl}
! 1510:
! 1511: %<C
! 1512: \begin{figure}[tb]
! 1513: \scalebox{0.6}{\includegraphics{Figs/twoPolygon.eps}}
! 1514: \caption{} \label{fig:twoPolygon}
! 1515: \end{figure}
! 1516: %>C
! 1517:
! 1518: \begin{screen}
! 1519: \begin{verbatim}
! 1520: import("cfep-opengl.rr");
! 1521: opengl.metaRemoveAll();
! 1522: opengl.init();
! 1523: opengl.glib3DefaultScene(0);
! 1524: opengl.redraw();
! 1525: opengl.glColor4f(0.0,0.0,1.0,0.3);
! 1526: opengl.glBegin(GL_POLYGON); Y=0.1;
! 1527: opengl.glVertex3f(-1.0, Y, 0.5);
! 1528: opengl.glVertex3f(-1.0, Y, -0.5);
! 1529: opengl.glVertex3f(1.0, Y, -0.5);
! 1530: opengl.glVertex3f(1.0, Y, 0.5);
! 1531: opengl.glEnd();
! 1532:
! 1533: opengl.glColor4f(1.0,0.0,0.0,0.5);
! 1534: opengl.glBegin(GL_POLYGON);
! 1535: opengl.glVertex3f(0.0, 0.5, 0.0);
! 1536: opengl.glVertex3f(0.0, 0.5, -0.4);
! 1537: opengl.glVertex3f(0.5, -0.2, -0.4);
! 1538: opengl.glVertex3f(0.5, -0.2, 0.0);
! 1539: opengl.glEnd();
! 1540: opengl.glFlush() ;
! 1541: opengl.metaShowListOfOpenGLCommands();
! 1542: \end{verbatim}
! 1543: \end{screen}
! 1544: $B$3$N%W%m%0%i%`$G$O(B 2 $BKg$ND9J}7A$rIA$$$F$$$k(B.
! 1545: $B$3$N%W%m%0%i%`$N=PNO$O?^(B\ref{fig:twoPolygon}.
! 1546: -----$B>\$7$$@bL@$O$^$@(B.
! 1547:
! 1548: OpenGL $B$N2hLL$K$OIaDL$N?t3X$N$h$&$K(B $(x,y)$ $B:BI8$,$O$$$C$F$*$j(B,
! 1549: $B2hLL$+$i<jA0B&$,(B $z$ $B:BI8$,@5$NJ}8~(B, $B2hLL$N8~$3$&B&$,(B
! 1550: $z$ $B:BI8$,Ii$NJ}8~$G$"$k(B.
! 1551: ``$BL\(B'' $B$+$i86E@J}8~$r8+$?2hA|$,(B
! 1552: $B?^(B\ref{fig:twoPolygon}$B$K$"$k$h$&$K(B 3 $B$D$N%9%i%$%@!<$rMQ$$$FL\$N0LCV$rF0$+$;$k$N$G(B,
! 1553: OpenGL$B%*%V%8%'%/%H$r$$$m$$$m$J3QEY$+$i$_$k$3$H$,2DG=$G$"$k(B.
! 1554: $B2<$N%9%i%$%@!<$,L\$N(B $x$ $B:BI8(B, $B1&$NFs$D$N%9%i%$%@!<$,$=$l$>$lL\$N(B $y$, $z$ $B:BI8$G$"$k(B.
! 1555: $BL\$NF0$-$K47$l$k$K$O(B, $B<!$NFs$D$N%G%b2hLL$r$?$a$9$HLLGr$$$@$m$&(B.
! 1556: \begin{screen}
! 1557: \begin{verbatim}
! 1558: import("cfep-opengl.rr");
! 1559: opengl.glib3DefaultScene("mesa demo/ray");
! 1560: \end{verbatim}
! 1561: \end{screen}
! 1562:
! 1563: \begin{screen}
! 1564: \begin{verbatim}
! 1565: import("cfep-opengl.rr");
! 1566: opengl.glib3DefaultScene("dfep demo/icosahedron");
! 1567: \end{verbatim}
! 1568: \end{screen}
! 1569:
! 1570: \cleardoublepage
! 1571: \flushbottom
! 1572: \printindex
! 1573:
! 1574: \end{document}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>