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