\documentclass[a4paper,11pt]{article}
\textheight 23 cm
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{stmaryrd}
\usepackage{makeidx}
\usepackage{times}
 \usepackage{pst-plot}
\usepackage{ifpdf}
\ifpdf
 \usepackage[pdftex,colorlinks]{hyperref}
\else 
\usepackage{pst-plot}
\fi
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{latexsym}

\newcommand{\R}{{\mathbb{R}}}
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\N}{{\mathbb{N}}}

\makeindex
\author{Ren\'ee De Graeve}

\begin{document}

\part*{{\tt Xcas} reference card}
\section{How to install {\tt Xcas}}
\verb|Xcas| is a free software (GPL), you can download it at~:\\
{\tt http://www-fourier.ujf-grenoble.fr/\tild  parisse/giac.html}
%
CAS (Computer Algebra System) means exact, formal or symbolic calculus.
%
\section{Interface}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Interface}\\
\hline\hline
\framebox{{\tt File Edit Cfg...}}& is the main menu\\
\framebox{{\tt session1.xws} or}& is the name of the current session or\\
\hspace*{1cm}\framebox{{\tt Unnamed}}&\hspace*{0.3cm} if the session has not been saved\\
\framebox{{\tt ?}}& open the help command index\\
\framebox{{\tt Save}}& save the session \\
\framebox{{\tt Config: exact real...}}& open the CAS configuration\\
\framebox{{\tt STOP}}& interrupt a computation\\
\framebox{{\tt Kbd}}& show/hide keyboard\\
\framebox{{\tt X}}& close the session\\
\framebox{{\tt 1$\arrowvert$\hspace*{4cm}}} & is a commandline\\
\hline
\end{tabular}
\end{center}
You can write your first command (click to have the cursor in the commandline)~: 
{\tt 1+1}, then "Enter" (or "Return" depending on your keyboard).
The result appears below in an expression editor, as well as a new commandline 
(numbered 2) for the next command.
%
{\tt Xcas} has different data types : integers (\verb|2|),
 fractions (\verb|3/2|), float numbers (\verb|2.0|,\verb|1.5|), 
formal parameters (\verb|x,t|), variables (\verb|a:=2|), 
expressions (\verb|x^2-1|), functions (\verb|f(x):=x^2-1|), lists (\verb|[1,2,3]|), sequences (\verb|1,2,3|), strings (\verb|"na"|) and geometric objects.

An expression is a combination beteween numbers and variables connected with 
operators. A function associates a variable to an expression.\\ 
For example,
\verb|a:=x^2+2*x+1| defines an expression \verb|a| but
\verb|b(x):=x^2+2*x+1| defines a function \verb|b| and 
\verb|b(0)=subst(a,x=0)=1|.

A matrix is a list of lists with same length, a sequence can't contains 
sequence. 
\vskip 1mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Ponctuation symbols}\\
\hline\hline
\verb|.|& between the integer part and the decimal part\\
\verb|,|& between the terms of a list or of a sequence \\
\verb|;|& ends each instruction of a program\\
\verb|:;|& ends an instruction whose answer will not be displayed\\
\verb|!|& n! is the factorial of $n$ (4!=$1\cdot 2\cdot3\cdot4=24$)\\
\hline
\verb|:=|& \verb|a:=2| affectation instruction that stocks \verb|2| into the variable \verb|a|\\
\verb|[]|& list delimitations (\verb|L:=[0,2,4]| and \verb|L[1]| returns \verb|2|)\\
\verb|""|& string delimitations (\verb|C:="ba"| and \verb|C[1]| returns \verb|"a"|)\\
\hline
\end{tabular}
\end{center}

%
\section{Configurations}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Configurations}\\
\hline\hline
{\tt Cfg$\blacktriangleright$CAS config}& open the CAS configuration\\
{\tt Cfg$\blacktriangleright$graph config}& open the default graphic configuration \\
{\tt Cfg$\blacktriangleright$general configuration}& open the general configuration\\
\framebox{\tt cfg} {\tt (Graph)}& open the configuration of this graphic level\\
\framebox{\tt Config : ...}& open the CAS configuration\\
\framebox{\tt Sheet config} :& open the sheet configuration\\
\hline
\end{tabular}
\end{center}
You can change the aspect of the interface and save your
changes for the next sessions using the \verb@Cfg@ menu.

\section{Levels}
%
Each session is composed of numbered levels which are~: command line for 
cas commands, interactive geometry screen (2-d et 3-d), formal spreadsheet, 
turtle drawing, programm editor  etc... 
%
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Levels}\\
\hline\hline
\verb@Alt+c@& new comment \\
\verb@Alt+d@& new turtle graphic \\
\verb@Alt+e@& new expression editor\\
\verb@Alt+g@& new 2-d geometry figure\\
\verb@Alt+h@& new 3-d geometry figure\\
\verb@Alt+n@& new commandline\\
\verb@Alt+p@& new program editor\\
\verb@Alt+t@& new spreadsheet\\
\hline
\end{tabular}
\end{center}


\section{Help}
%
All commands are sorted in alphabetical order in the help index ({\tt Help$\blacktriangleright$Index}) and several manuals with 
exercises in {\tt Help$\blacktriangleright$Manuals$\blacktriangleright$...} 
and examples in {\tt Help$\blacktriangleright$Examples}.
%
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Help}\\
\hline\hline
\verb@Help@$\blacktriangleright$\verb@Index@& open the command index \\
\verb@Help@$\blacktriangleright$\verb@Manuals@$\blacktriangleright$\verb@...@& open one of manuals in your navigator\\
{\tt \framebox{?}}& open the command index\\
{\tt ce\framebox{?}}& open the command index at {\tt ceil}\\
{\tt ce\framebox{F1}}& open the command index at {\tt ceil}\\
\verb@ce@\framebox{$\rightleftarrows$}& open the command index at {\tt ceil}\\
\verb@?ceil@& open the browser detailled help for {\tt ceil}\\
{\tt Cmds$\blacktriangleright$Real$\blacktriangleright$Base$\blacktriangleright$ceil}& print {\tt ceil} short help in {\tt msg} opened with\\
& {\tt Cfg$\blacktriangleright$Show$\blacktriangleright$msg} or {\tt\framebox{Kbd}$\blacktriangleright$\framebox{msg}}\\
\hline
\end{tabular}
\end{center}
%In order to see the messages ({\tt msg}), select {\tt Cfg->Show->msg} or {\tt\framebox{Kbd}->\framebox{msg} }

\newpage
\part*{{\tt Xcas} reference card : basic CAS }
\begin{itemize}
\item Type Enter to execute a commandline.
\item Numbers may be exact or approx.
\item Exact numbers are constants, integers, 
integer fractions and all expressions with integers and constants.
\item Approx numbers are written with the scientific standard notation~:
integer part followed by the decimal point and the fractional part,
optionally followed by \verb|e| and an exponent.
\end{itemize}

\begin{minipage}[h]{3cm}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Operators}\\
\hline\hline
\verb@+@& addition\\
\verb@-@& substraction \\
\verb@*@& mutiplication  \\
\verb@/@& division\\
\verb@^@& power  \\
\hline
\end{tabular}
\end{center}
\end{minipage}
\hspace{1cm}
\begin{minipage}[h]{6cm}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Constants}\\
\hline\hline
\verb|pi|&$\pi\simeq 3.14159265359$ \\
\verb|e|&$e\simeq 2.71828182846$  \\
\verb|i|&$i=\sqrt{-1}$  \\
\verb|infinity|&$\infty$  \\
\verb|+infinity| or \verb|inf|&$+\infty$  \\
\verb|-infinity| or \verb|-inf|&$-\infty$  \\
\verb|euler_gamma|& Euler's constant\\
\hline
\end{tabular}
\end{center}
\end{minipage}

\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Sequences, lists, vectors}\\
\hline\hline
\verb@S:=a,b,c@& S is a sequence of 3 elements\\
\verb@S:=[a,b,c]@& S is a list of 3 elements\\
\verb@S:=NULL@& S is an empty sequence\\
\verb@S:=[]@& S is an empty list \\
\verb@dim(S)@& returns the size of S\\
\verb@S[0]@& returns the first element of S\\
\verb@S[n]@& returns the $n+1$-th element of S\\
\verb@S[dim(S)-1]@& returns the last element of S\\
\verb@S:=S,d@& appends the element {\tt d} at the tail of a sequence S\\
\verb@S:=append(S,d)@& appends the element {\tt d} at the tail of a list S\\
\hline
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Strings}\\
\hline\hline
\verb@S:="abc"@& $S$ is a string of 3 characters\\
\verb@S:=""@& S is a string of 0 character\\
\verb@dim(S)@& is the length of $S$\\
\verb@S[0]@& returns the first character of $S$\\
\verb@S[n]@& returns the $n+1$-th character of $S$\\
\verb@S[dim(S)-1]@& returns the last character of $S$\\
\verb@S:=S+d@& appends the character $d$ at the tail of the string $S$\\
\verb@"ab"+"def"@& concats the two strings and returns "abdef"\\
\hline
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Fractions}\\
\hline\hline
\verb@propfrac@& returns integer part+fractional part\\
\verb@numer getNum@& numerator of the fraction after simplification\\
\verb@denom getDenom@& denominator of the fraction after simplification\\
\verb@f2nd@& [numer, denom] of the fraction after simplification\\
\verb@simp2@& simplifies a pair\\
\verb@dfc@& continued fraction expansion of a real\\
\verb@dfc2f@& converts a continued fraction expansion into a real\\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{|ll|ll|}
\hline
\multicolumn{4}{|c|}{\bf Usual functions}\\
\hline\hline
\verb|evalf(t,n)| & num. approx. of $t$ with $n$ decimals &\verb|sign| & sign (-1,0,+1)\\
\verb|max| & maximum &\verb|min| & minimum\\
\verb|round| & nearest integer &\verb@frac@& fractional part\\
\verb|floor| & greatest integer $\leq$&\verb|ceil| & smallest integer $\geq $\\
\hline
\verb|re| & real part&\verb|im| & imaginary part\\
\verb|abs| &  norm or absolute value&\verb|arg| & argument\\
\verb|conj| & conjugate&\verb|affix| & affix\\
\hline
\verb|factorial !| & factorial&\verb|binomial| & binomial coefficient\\
\hline
\verb|exp| & exponential& \verb|sqrt| & square root\\
\verb|log10| & common logarithm (base 10)&\verb|ln  log|& natural logarithm\\
\hline
\verb|sin cos| & sinus cosine&\verb|csc sec| & 1/sinus 1/cosine\\
\verb|tan| & tangent&\verb|cot| & cotangent\\
\verb|asin| & arcsinus&\verb|acos| & arccosine\\
\verb|atan| & arctangent&\verb|acot| & arccotangent\\
\hline
\verb|sinh| & hyperbolic sinus&\verb|cosh| & hyperbolic cosine\\
\verb|asinh| & hyperbolic arcsine&\verb|acosh| & hyperbolic arccosine\\
\verb|tanh| & hyperbolic tangent&\verb|atanh| &  hyperbolic arctangent\\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Arithmetic on integers}\\
\hline\hline
\verb|a%p| & $a$ mod $p$\\
\verb|powmod(a,n,p)| & $a^n$ mod $p$\\
\verb|irem| & euclidean remainder\\
\verb|iquo| & euclidean quotient\\
\verb|iquorem| & [quotient,remainder]\\
\hline
\verb|ifactor| & factorization into prime factors\\
\verb|ifactors| & list of prime factors\\
\verb|idivis| & list of divisors\\
\hline
\verb|gcd| & greatest common divisor\\
\verb|lcm| & lowest common multiple\\
\verb|iegcd| & extended greatest common divisor\\
\verb|iabcuv| & returns $[u,v]$  such as $au+bv=c$\\
\verb|ichinrem| & chinese remainders for integers\\
\hline
\verb|is_prime| & test if $n$ is prime\\
\verb|nextprime| & next pseudoprime integer\\
\verb|previousprime| & previous pseudoprime integer\\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{|ll|ll|}
\hline
\multicolumn{4}{|c|}{\bf Transformations}\\
\hline\hline
\verb|simplify|& simplifies&
\verb|tsimplify|& simplifies (less powerful)\\
\verb|normal|& normal form&
\verb|ratnormal|& normal form (less powerful)\\
\verb|expand|& expands&
\verb|partfrac|& partial fraction expansion\\
\verb|factor|& factorizes &
\verb|convert|& converts into a specified format\\
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{|ll|ll|}
\hline
\multicolumn{4}{|c|}{\bf Transformations and trigonometry}\\
\hline\hline
\verb|tlin| &linearize &\verb|tcollect| & linearizes and collects\\
\verb|texpand| & expands $\exp,\ln$ and trig&
\verb|trig2exp| &trig to $\exp$\\
\verb|hyp2exp| &hyperbolic to $\exp$&\verb|exp2trig| &$\exp$ to trig\\
\hline
\end{tabular}
\end{center}
\newpage
\part*{{\tt Xcas} reference card : statistics and spreadsheet}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Probabilities}\\
\hline\hline
\verb|comb(n,k)| & $\left(^n_k\right) =C_n^k$\\
\verb|binomial(n,k,[p])| & returns comb($n,k)*p^k(1-p)^{n-k}$ or {\tt comb(n,k)} \\
\verb|perm(n,p)| & $A_n^p$\\
\verb|factorial(n), n!| & n!\\
\verb|rand(n)| & random integer $p$ such that $0 \leq p<n$\\
\verb|rand(p,q)| & random real $t$ such that $t\in [p,q]$ \\
\verb|randnorm(mu,sigma| & random real $t$ according $N(\mu,\sigma)$\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf 1-d statistics}\\
\hline\hline
\verb|mean| & mean of a list \\
\verb|median| & median of a list\\
\verb|quartiles| & [min,quartile1,median,quartile3,max]\\
\verb|boxwhisker| & whisker boxes of a statistical series\\
\verb|variance| & variance of a list\\
\verb|stddev| & standard deviation of a list\\
\verb|histogram| & histogram of its argument\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf 2-d statistics}\\
\hline\hline
\verb|polygonplot| & polygonal line\\
\verb|scatterplot| & scattered points\\
\verb|polygonscatterplot| & polygonal pointed line\\
\verb|covariance| & covariance of 2 lists\\
\verb|correlation| & correlation of 2 lists\\
\verb|exponential_regression| & $(m,b)$ for exponential fit $y=be^{mx}$\\
\verb|exponential_regression_plot| &graph of the exponential fit $y=be^{mx}$\\
\verb|linear_regression| &$(a,b)$ for linear fit $y=ax+b$ \\
\verb|linear_regression_plot| &graph of the linear fit $y=ax+b$\\
\verb|logarithmic_regression| &$(m,b)$ for logarithmic fit $y=m\ln(x)+b$ \\
\verb|logarithmic_regression_plot| &graph of the logarithmic fit $y=m\ln(x)+b$\\
\verb|polynomial_regression| &$(a_n,..a_0)$ for polynomial fit $y=a_nx^n+..a_0$ \\
\verb|polynomial_regression_plot| & graph of the polynomial fit $y=a_nx^n+..a_0$ \\
\verb|power_regression| &$(m,b)$ for power fit $y=bx^m$ \\
\verb|power_regression_plot| &graph of the power fit $y=bx^m$ \\
\hline
\end{tabular}
\end{center}
Statistic commands may be typed in a commandline or selected from the
{\tt Cmds$\blacktriangleright$Proba\_stats} menu. They may be selected from the {\tt Graphic$\blacktriangleright$Stats} 
menu using dialog boxes. The easiest way is however to open a spreadsheet
enter data there, select the data with the mouse, open the spreadheet
{\tt Maths} menu and fill the dialog boxes.

\newpage

\noindent
{\bf The Xcas spreadsheet} is a symbolic spreadsheet (in addition to
numeric values and formula (beginning with \verb|=|), cells may contain 
exact value, complex numbers, expressions, ...) where Xcas commands and
user-defined functions may be used. Note that litteral entries must
be quoted as strings, for example "Result", otherwise they will be
parsed as identifiers or may generate errors.
The Xcas spreadsheet uses standard conventions 
(columns are refered with letters starting at \verb|A|,
rows with numbers starting at 0, references are relative except if
the column or row number is prefixed with \verb|$|).
Note that~:
\begin{itemize}
\item the {\tt Table, Edit, Maths} menu may be obtained by
a right-click mouse
\item the {\tt eval val 2-d 3-d} buttons (reeval the spreadsheet, show
the value instead of formula, show 2-d or 3-d graph displaying
cells with a graphic object value in a window)
\item the ``goto'' input-value (top-left) let you go to a cell or select
a cell range if you fill it in. It is filled if you make a mouse event
\item the commandline to input cells values or formulas
\item the configuration button : shows the current config, click to change
the sheet configuration~: you may select to view all 2-d graphic objects
of the spreadsheet below or right to the sheet (Landscape mode)
\end{itemize}

\noindent
{\bf Example: extended gcd}, given $a$ and $b$
find $u$ and $v$ such that $au+bv=$gcd$(a,b)$
\begin{itemize}
\item Enter the value of $a$ and $b$ in \verb|A0| and \verb|A1|
for example 78 and 56
\item We will fill column \verb|A| with remainders $r_n$, set \verb|A2| to
\verb|=irem(A0,A1)| and copy down (Ctrl-d).
\item Column \verb|E| will contain the quotients,
set \verb|E2=iquo(A0,A1)| and copy down
\item Columns \verb|B| and \verb|C| will contain values of $u_n$
and $v_n$ such that $au_n+bv_n=r_n$, enter 1 and 0 for \verb|B0|, \verb|C0|,
0 and 1 for \verb|B1| and \verb|C1|,
\verb|=B0-E2*B1| for \verb|B2|, copy down
\verb|=C0-E2*C1| for \verb|C2|, copy down
\item Column \verb|D| is $au_n+bv_n$, hence should be identical to column 
\verb|A|, set \verb|D0| to \verb|=B0*$A$0+B1*$A$1| and copy down
\item Column \verb|F| will contain the answer or 0, 
set \verb|F0| to :\\
\verb|=if A0==0 then [B0,C0,D0] else 0 fi| and copy down.
\end{itemize}
One can check in a standard commandline with {\tt iegcd(78,56)}~:\\
\framebox{\includegraphics[width=\textwidth]{bezout}}

\newpage
\part*{{\tt Xcas} reference card : Algebra}
\vskip 2mm  
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Polynomials}\\
\hline\hline
\verb|normal| &normal form (expanded and reduced)\\
\verb|expand| &expanded form\\
\verb|ptayl|&Taylor polynomial\\
\verb|peval horner| & evaluation using Horner's method\\
\verb|genpoly| & polynomial defined by its value at a point\\
\verb|canonical_form| & canonical form of a second degree polynomial\\
\hline
\verb|coeff| & coefficient or list of coefficients\\
\verb|poly2symb| & list polynomial to symbolic polynomial\\
\verb|symb2poly| & symbolic polynomial to list polynomial\\
\verb|pcoeff| & polynomial from it's roots\\
\hline
\verb|degree| & degree\\
\verb|lcoeff| & coefficient of the monomial of highest degree\\
\verb|valuation| & degree of the monomial of lowest degree \\
\verb|tcoeff| & coefficient of the monomial of lowest degree\\
\hline
\verb|factor| & factorizes a polynomial\\
\verb|cfactor| & factorizes a polynomial on $\C$ \\
\verb|factors| & list of irreducible factors and multiplicities\\
\verb|divis| & list of divisors\\
\verb|collect| & factorization on the coefficients field\\
\hline
\verb|froot| & roots with their multiplicities\\
\verb|proot| & approx. values of roots\\
\verb|sturmab| & number of roots in an interval\\
\hline
\verb|getNum| & numerator of a rational fraction (unsimplified)\\
\verb|getDenom| & denominator of a rational fraction (unsimplified)\\
\verb|propfrac| & returns polynomial integer part + fractional part\\
\verb|partfrac| & partial fraction expansion\\
\hline
\verb|quo| & euclidean quotient\\
\verb|rem| & euclidean remainder\\
\verb|gcd| & greatest common divisor\\
\verb|lcm| & lowest common multiple\\
\verb|egcd| &  extended greatest common divisor\\
\verb|chinrem| & chinese remainder \\
%\verb|divpc| & Taylor-poly for the quotient of 2 polynomials.\\
\hline
\verb|randpoly| & random polynomial\\
\verb|cyclotomic| & cyclotomic polynomial\\
\verb|lagrange| & Lagrange polynomial\\
\verb|hermite| & Hermite polynomial\\
\verb|laguerre| & Laguerre polynomial\\
\verb|tchebyshev1| & Tchebyshev polynomial (1st type)\\
\verb|tchebyshev2| & Tchebyshev polynomial (2nd type)\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Matrices}\\
\hline\hline
\verb@M:=[[a,b,c],[f,g,h]]@& M is a matrix with 2 rows and 3 columns\\
%\verb@M:=[[]]@& M  is a matrix with 1 row and 0 column\\
\verb@dim(M)@& returns dimensions as a list [nrows, ncols]\\
\verb@M[0]@& returns the first line of M\\
\verb@M[n]@& returns the $n+1$-th line of M\\
\verb@row(M,n)@& returns the $n+1$-th line of M\\
\verb@col(M,n)@& returns the $n+1$-th column of M\\
\verb@M[dim(M)[0]-1]@& returns the last line of M\\
\verb@M[n..p]@& returns the sub-matrice of M with lines in $[n..p]$ \\
\verb@append(M,[d,k,l])@& appends the line $[d,k,l]$ at the end of M\\
\verb@M[dim(M)[0]]:=[d,k,l]@& appends the line $[d,k,l]$ at the end of $M$\\
\verb@border(M,[d,k])@& appends the column $[d,k]$ at the end of $M$\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Operators on vectors and matrix}\\
\hline\hline
\verb|v*w| & scalar product\\
\verb|cross(v,w)| & dot product\\
\verb|A*B| & matrix product\\
\verb|A .* B| & term by term product\\
\verb|1/A| & inverse\\
\verb|tran|& transposes a matrix\\
\verb|rank| & rank\\
\verb|det| & determinant\\
\verb|ker| & kernel basis\\
\verb|image| & image basis\\
\verb|idn| & identity matrix\\
\verb|ranm| & matrix with random coefficients\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Linear systems}\\
\hline\hline
\verb|linsolve| & linear system solver\\
%\verb|simult| & simultaneous equation solver\\
\verb|rref| & Gauss-Jordan reduction\\
\verb|rank| & rank\\
\verb|det| & determinant of a system\\
\hline
\end{tabular}
\end{center}
\vskip 2mm 
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Matrix reduction}\\
\hline\hline
\verb|jordan| & eigenvalue/characteristic vectors (Jordan reduction)\\
\verb|pcar| & characteristic polynomial\\
\verb|pmin| & minimal polynomial\\
\verb|eigenvals| & eigenvalues\\
\verb|eigenvects| & eigenvectors\\
\hline
\end{tabular}
\end{center}

\newpage
\part*{{\tt Xcas} reference card : Calculus}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Derivatives}\\
\hline\hline
\verb|diff(E)| or \verb|E'| &expression derivative of an expression $E$ with respect to $x$\\
\verb|diff(E,t)| or \verb|(E,t)'| &expression derivative of an expression $E$ with respect to $t$\\
\verb|diff(f)| or \verb|f'|& function derivative of the function $f$\\
\verb|diff(E,x$n,y$m)| &expression partial derivative $\frac{\partial E}{\partial x^n\partial y^m}$ of an expression $E$\\
\verb|grad| & gradient\\ 
\verb|divergence| & divergence\\
\verb|curl| & rotationnal\\
\verb|laplacian| & laplacian\\
\verb|hessian| & hessian matrix\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Limits and series expansion}\\
\hline\hline
\verb|limit(E,x,a)| & limit of an expression $E$ at $x=a$ \\
\verb|limit(E,x,a,1)| & limit of an expression $E$ at $x=a^+$\\
\verb|limit(E,x,a,-1)| & limit of an expression $E$ at $x=a^-$ \\
\verb|series(E,x=a,n)| & series expansion of $E$ at $a$ with relative order=$n$\\
\verb|taylor(E,a)| & series expansion of $E$ at $x=a$ with relative order=5\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Integrals}\\
\hline\hline
\verb|int(E,x)| & antiderivative of an expression $E$\\
\verb|int(f)| & antiderivative function of a function $f$\\
\verb|int(E,x,a,b)| & integration of an expression $E$ from $x=a$ to $x=b$\\
\verb|romberg(E,x,a,b)| & approximate value of {\tt int(E,x,a,b)}\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Equations}\\
\hline\hline
\verb|solve(eq,x)| & exact $\R$-solution of a polynomial equation\\
\verb|solve([eq1,eq2],[x,y])| & exact $\R$-solution of a list of polynomial equations\\
\verb|csolve(eq,x)| & exact $\C$-solution of a list of polynomial equations\\
\verb|csolve(eq1,eq2],[x,y])| & exact $\C$-solution of a list of polynomial equations\\
\verb|fsolve(eq,x=x0)| & approx solution of an equation (x0=xguess)\\
\verb|fsolve([eq],[var],[val])| & approx solution of a list of equations(val=xguess) \\
\verb|newton| & Newton's method\\
\verb|linsolve| & linear system solver\\
\verb|proot| & approx roots of a polynomial\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Ordinary Differential Equations (ODE)}\\
\hline\hline
\verb|desolve| & exact solution of an ODE\\
\verb|odesolve| & approx solution of an ODE\\
\verb|plotode| & plot the approx solution of an ODE\\
\verb|plotfield| & plot the field of an ODE\\
\verb|interactive_plotode| & plot an ODE field and solutions through mouse clicks \\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Curves}\\
\hline\hline
\verb|plot| & plots a 1-d expression\\
\verb|tangent| & draws the tangent lines to a curve\\
\verb|slope| & slope of a line\\
\verb|plotfunc| & plots a 1-d or 2-d expression\\
\verb|...,color=...)| & chooses the color of a plot\\
\verb|areaplot| & displays the area below a curve\\
\verb|plotparam| & plot a parametric curve\\
\verb|plotpolar| & plot a polar curve\\
\verb|plotimplicit(f(x,y),x,y)| & implicit plot of $f(x,y)=0$\\
\hline
\end{tabular}
\end{center}
{\bf Example}
Define the function $f$ over $\R-\{-1,0,1,2\}$ by :
$\displaystyle f(x)=\frac{\ln(|2-x|)}{\ln(|x|)}$.\\
We will show that $f$ can be extended to 
a continuous function on $\R-\{-1,2\}$, draw the graph of $f$, 
and the tangents at $x=-1/2$, $x=0$ and $x=1$. 
We will give an approximate value of the area between 
$x=3,x=5,y=0$ and the curve, using the trapezoid rule with 4 subdivisions.\\
Input :
{\tt f(x):=ln(abs(x-2))/ln(abs(x))}\\ 
{\tt limit(f(x),x,1)} answer {\tt -1}.
{\tt limit((f(x)+1)/(x-1),x,1)} answer {\tt -1}\\ 
Hence we can extend $f$ at $x=1$ and the slope of the tangent at (1,-1) is -1\\
{\tt limit(f(x),x,0)} answer {\tt 0},
{\tt limit(f(x)/x,x,0,1)} answer  {\tt -infinity } and
{\tt limit(f(x)/x,x,0,-1)} answer {\tt +(infinity)}.
Hence we can extend $f$ at $x=0$ and the tangent at (0,0) is the $y$-axis\\
{\tt limit(f(x),x,-1)} answer {\tt infinity}, so $x=-1$ is an asymptote.\\
{\tt limit(f(x),x,2)} answer {\tt -infinity}, so $x=2$ is an asymptote.\\
{\tt limit(f(x),x,inf),limit(f(x),x,-inf)} answer {\tt (1,1)}.
We conclude that the line $y=1$ is an asymptote to the curve.\\
To extend $f$ to a continuous function defined on $\R-\{-1,2\}$, input :\\
{\tt g:=when(x==0,0,when(x==1,-1,f(x)))}\\
To get the graph, input: {\tt G:=plotfunc(g(x),x=-5..8,color=red);},\\
{\tt line(y=1),tangent(G,-1/2),line(1-i,slope=-1),}\\
{\tt areaplot(g(x),x=3..5,4,trapezoid)}\\
\framebox{\includegraphics[width=12cm]{fichgraph}}\\
In order to approximate the area with 4 trapezoids, type~:\\
{\tt Digits:=3;}{\tt 0.5*(f(3)/2+f(3.5)+f(4)+f(4.5)+f(5)/2)}\\
it will return 0.887.

Enter {\tt areaplot(g(x),x=3..5)} to compute the area with Romberg's method
(an acceleration of the trapezoid method) ;
3 digits are displayed. For more digits, enter
{\tt romberg(g(x),x,3,5)}, it returns 0.903226168665 if {\tt Digits:=12;}. 

\newpage
\part*{{\tt Xcas} reference card : geometry}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf 2-d geometry}\\
\hline\hline
\verb@point@& point given by its coordinates or its affix\\
\verb@...,display=...)@ & attributs for a graphic object (last argument)\\
\verb|legend="..."| & set the legend of a graphic object \\
\verb|segment| & returns the segment given by 2 points\\
\verb@line(A,B)@& returns the line $AB$\\
\verb@line(a*x+b*y+c=0)@& returns the line $ax+by+c=0$\\
\verb@triangle(A,B,C)@& returns the triangle $ABC$\\
\verb@bissector(A,B,C)@& returns the bissector of $\widehat{BAC}$\\
\verb@angle(A,B,C)@& returns the angle measure (in rad or deg) of $\widehat{BAC}$\\
\verb@median\_line(A,B,C)@& draws the median-line through $A$ of the triangle $ABC$\\
\verb@altitude(A,B,C)@& draws the altitude through $A$ of the triangle $ABC$\\
\verb@perpen\_bisector(A,B)@& draws the perpendicular bisector of $AB$ \\
\verb@square(A,B)@& draws the direct square of side $AB$\\
\verb@circle(A,r)@& draws the circle with center $A$ and radius $r$\\
\verb@cercle(A,B)@& draws the circle with diameter $AB$\\
\verb@radius(c)@& gives the radius of the circle $c$\\
\verb@center(c)@& gives the center of the circle $c$\\
\verb@distance(A,B) @& returns  the distance from $A$ to $B$ (point or curve)\\
\verb@inter(G1,G2)@& returns the list of points in $G1\cap G2$\\
\verb@inter_unique(G1,G2)@& returns one of the points in $G1\cap G2$\\
\hline
\verb|assume|& add a symbolic parameter (or an hypothesis)\\
\verb|element|& add a numeric parameter\\
\hline
\verb|polygon| & draws a polygon\\
\verb|open\_polygon| & draws an open polygon\\
\hline
\verb|coordinates| & coordinates of a point\\
\verb|equation| & cartesian equation\\
\verb|parameq| &  parametric equation\\
\hline
\verb@homothety(A,k,M)@& image of $M$ by the homothety of center $A$ and\\
                       & coefficient $k$\\
\verb@translation(B-A,M)@& image of $M$ by the translation $\overrightarrow{AB}$\\
\verb@rotation(A,t,M)@& image of $M$ by the rotation of center
                        $A$ and of angle $t$\\
\verb@similarity(A,k,t,M)@& image of $M$ by the similarity of center $A$, coefficient\\
                       &  $k$ and angle $t$\\
\verb@reflection(A,M)@& image of $M$ by the reflection 
                       (w.r.t. point or line $A$)\\
\hline
\end{tabular}
\end{center}
You can either type a geometric command with the keyboard, or select it in the {\tt Geo} 
menu. Additionnally, inside a figure, you can select a geometric object shape in {\tt Mode}, 
and click with the mouse to construct it. Clicks will by default build 
geometric objects with approx coordinates unless you uncheck \framebox{$\sim$}. 
If you choose \framebox{{\tt Landscape}},
the graphic screen will be larger and the commandlines will be below the figure.
If you modify one commandline and press Enter, all the following commandlines will be 
re-evaluated and the figure will be synchronized.

\pagebreak

\noindent {\bf Example}, draw a triangle $ABC$, 
the perpendicular bissector to $AB$ and
the circumcircle to $ABC$.
\begin{itemize}
\item Choose {\tt Mode$\blacktriangleright$Polygon$\blacktriangleright$triangle}. Click at the desired
position for the point $A$, move the mouse (a segment joining to the
first point is displayed) and click at the desired
second point position, move the mouse (a triangle following the mouse
is displayed) and click again at the desired position for $C$.
The triangle is now constructed and a few commandlines appear
at the left of the figure (\verb|A:=point(...)|, ...).
\item Choose {\tt Mode$\blacktriangleright$Line$\blacktriangleright$perpen\_bisector}.
Click on \verb|A|, move the mouse to \verb|B| (a perpendicular
bisector will follow the move), click, the perpendicular bissector
to $AB$ is constructed and the corresponding commandline is added
at the left of the figure\\
\verb|E:=perpen_bissector(A,B,display=0)|
\item Choose {\tt Mode$\blacktriangleright$Circle$\blacktriangleright$circumcircle}, click
on $A$, move, click on $B$, move (a circle follows the mouse move)
and click on $C$, the circumcircle is constructed and the corresponding
commandline is added at the left of the figure\\
\verb|F:=circumcircle(A,B,C,display=0|
\item Choose {\tt Mode$\blacktriangleright$Pointer}. In this mode you can drag
one of the point $A, B$ or $C$ and see the consequences on the figure.
\end{itemize}
Alternatively, one can also enter the commands directly in the
commandline at the left of the figure\\
\verb|A:=point(-1,2);|\\
\verb|B:=point(1,0);|\\
\verb|C:=point(-3,-2);|\\
\verb|D:=triangle(A,B,C);|\\
\verb|E:=perpen_bisector(A,B);|\\
\verb|F:=circumcircle(A,B,C);|

\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf 3-d geometry}\\
\hline\hline
\verb|plotfunc| & surface $z=f(x,y)$ given by $f(x,y)$ \\
\verb|plotparam| & parametric surface or 3-d parametric curve\\
\hline\hline
\verb|point| & point given by the list of its 3 coordinates\\
\verb|line| & line given by 2 equations or 2 points\\
\verb|inter| & intersection \\
\verb|plane| & plane given by 1 equation or 3 points \\
\verb|sphere| & sphere given by center and radius\\
\verb|cone| & cone given by vertex, axis and half-angle \\
\verb|cylinder| & cylinder given by axis and radius, [altidude] \\
\verb|polyhedron| & polyhedron\\
\verb|tetrahedron| & regular direct tetrahedron or pyramid\\
\verb|centered_tetrahedron| & regular direct tetrahedron\\
\verb|cube| & cube \\
\verb|centered_cube| & centered cube \\
\verb|parallelepiped| & parallelepiped\\
\verb|octahedron| & octahedron\\
\verb|dodechedron| & dodecahedron\\
\verb|icosahedron| & icosahedron\\
\hline
\end{tabular}
\end{center}

\newpage
\part*{{\tt Xcas} reference card : programmation}

\noindent {\bf 1. \ How to write a function}\\
You have to :
\begin{enumerate} 
\item[$\bullet$] choose a syntax, we describe here the {\tt Xcas} syntax~:
\begin{itemize}
\item either with the menu {\tt Cfg$\blacktriangleright$Mode(syntax)$\blacktriangleright$xcas}, 
\item or press on the button {\tt Config :..} to open the CAS configuration 
window and choose {\tt Xcas} in {\tt Prog style},
\end{itemize}
\item[$\bullet$] open a program editor either with
{\tt Alt+p}, or with the menu {\tt Prg$\blacktriangleright$New program}. 
Note the {\tt :;} at the end.
\item[$\bullet$] write the function with the instructions separated by {\tt ;}\\
Check that the name of the function, arguments and variables are not
reserved keywords (they should be written in black, programming key words 
are in blue and the commandnames in brown), this can be achieved
by beginning the function name by a Capital, 
\item[$\bullet$] click {\tt OK} or press {\tt F9} to compile the program.
\item[$\bullet$] you are now ready to test your program in a commandline,
write it's name followed by parenthesis, with the argument values separated with commas.
\end{enumerate}

\vspace{0.1cm}

\noindent {\bf 2. \  The {\tt add} menu of a program editor}\\
This menu may be used to remind the syntax of a function, of a test and of 
loops.
\noindent
\begin{minipage}[h]{7cm}
Syntax of a function :
\begin{verbatim}
f(x,y):={
  local z,a,...,val;
  instruction1;
  instruction2;
  val:=...;
  .....
  instructionk;
  return val;
}:;
\end{verbatim}
\end{minipage}
\hspace{1cm}
\begin{minipage}[h]{7cm}
\ \\
Example, Bezout's algorithm :
\begin{verbatim}
Bezout(a,b):={
 local la,lb,lr,q;
  la:=[1,0,a];
  lb:=[0,1,b];
 while (b!=0){
   q:=iquo(la[2],b)
   lr:=la+(-q)*lb;
   la:=lb;
   lb:=lr;
   b:=lb[2];
 }  
 return la;
}:;
\end{verbatim}
\end{minipage}
\ \\
{\bf 3. Compilation} If compilation is successfull, you should see {\tt Done} (if the program ends with 
{\tt :;}) or the translation of your program\\ 
For the example, click {\tt OK} (or {\tt F9}), you should
obtain {\tt // Parsing Bezout// Success compiling Bezout} and {\tt Done}. Then
input {\tt Bezout(78,56)} which should return {\tt [-5,7,2]} (-5*78+7*56=2=gcd(78,56)).
\ \\
{\bf 4. Step by step} 
You can run a program line by line (for debugging or pedagogical
illustration) using the debug command, like e.g.~:\\
{\tt debug(Bezout(78,56))}\\ 
A new window opens, press {\tt sst} (shortcut F5) to run the next
instruction. 

\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Instructions}\\
\hline\hline
affectation& \verb@ a:=2;@\\
input expression& \verb@ input("a=",a);@ \\
input string& \verb@ textinput("a=",a);@ \\
output& \verb@ print("a=",a);@\\
returned value& \verb@ return a;@\\
quit a loop& \verb@ break;@\\
alternative& \verb@ if <condition> then <inst> end_if;@ \\
           & \verb@ if <condition> then <inst1> else <inst2>end_if;@ \\
for loop & \verb@ for j from a to b do <inst> end_for;@\\
           & \verb@ for j from a to b by p do <inst> end_for;@\\
repeat loop & \verb@ repeat <inst> until <condition>;@\\
while loop& \verb@ while <condition> do <inst> end_while;@\\
do loop& \verb@ do<inst1> if (<condition>)break;<inst2>end_do;@\\
\hline
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf C-like instructions}\\
\hline\hline
affectation& \verb@ a:=2;@\\
input expression& \verb@ input("a=",a);@ \\
input string& \verb@ textinput("a=",a);@ \\
output& \verb@ print("a=",a);@\\
returned value& \verb@ return(a);@\\
stop& \verb@ break;@\\
alternative& \verb@ if (<condition>) {<inst>};@ \\
           & \verb@ if (<condition>) {<inst1>} else {<inst2>};@ \\
for loop & \verb@ for (j:= a;j<=b;j++) {<inst>};@\\
           & \verb@ for (j:= a;j<=b;j:=j+p) {<inst>};@\\
repeat loop & \verb@ repeat <inst> until <condition>;@\\
while loop & \verb@ while (<condition>) {<inst>};@\\
do loop & \verb@ do <inst1> if (<condition>) break;<inst2> od;@\\
\hline
\end{tabular}
\end{center}


\vskip 1mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Ponctuation symbols}\\
\hline\hline
\verb|.|& between the integer part and the decimal part\\
\verb|,|& between the terms of a list or of a sequence \\
\verb|;|& ends each instruction of a program\\
\verb|:;|& ends an instruction whose answer will not be displayed\\
\verb|!|& n! is the factorial of $n$\\
\hline
\end{tabular}
\end{center}
%\section{Les op\'erateurs}
\vskip 1mm
\begin{center}
\begin{tabular}{|ll|ll|}
\hline
\multicolumn{4}{|c|}{\bf Operators}\\
\hline\hline
\verb@+@& addition&\verb@-@& substraction \\
\verb@*@& mutiplication& \verb@/@& division\\
\verb@^ @& power& \verb@a mod p@& a modulo p\\
\verb@==@& tests equality&
\verb@!=@& tests difference \\
\verb@<@& strictly less &
\verb@<=@& less or equal\\
\verb@>@& strictly greater &
\verb@>=@& greater or equal \\
\verb@||, or@&  boolean infixed operator &
\verb@\&\&, and@& boolean infixed operato\\
\verb@not@& logical not &
\verb@!(..)@& logical not\\
\verb@true@&  is the boolean true or 1&
\verb@false@& is the boolean false or 0\\
\hline
\end{tabular}
\end{center}


\newpage
\part*{{\tt Xcas} reference card : the turtle}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Moves}\\
\hline\hline
\verb@clear efface@& clears the screen\\
\verb@forward@& forward\\
\verb@backward@& back\\
\verb@jump@& jump\\
\verb@side_step@& side step\\
\verb@turn_left@& turns left\\
\verb@turn_right@& turns right\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Colors}\\
\hline\hline
\verb@pen@& gives the color of the pencil.\\
\verb@hide_turtle@& hides the turtle\\
\verb@show_turtle@& shows the turtle\\
\verb@draw_turtle(n)@& draws the turtle, the shape is filled if $n$ is 0\\
\hline
\end{tabular}
\end{center}
\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Shapes}\\
\hline\hline
\verb@turtle_circle@& circle or arc of circle\\
\verb@filled_triangle@& filled triangle\\
\verb@filled_rectangle@& filled rectangle (or square, rhombus, parallelogram)\\
\verb@disc@& filled circle (or angle sector) tangent to the turtle.\\
\verb@centered_disc@& circle (or angle sector) with the turtle as center\\
\verb@filled_polygon@& fill the polygon that has just been drawn before\\
\hline
\end{tabular}
\end{center}
%\vskip 2mm
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Legends}\\
\hline\hline
\verb@write_string@& write on the screen at the turtle position\\
\verb@signature@& put a signature at the screen left botton\\
\hline
\end{tabular}
\end{center}


\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Turtle programs}\\
\hline\hline
\verb@if <c> then <inst> end_if@& $<inst>$ are done if condition $<c>$ is true\\
\verb@if <c> then <inst1> else@& $<inst1>$ (or $<inst2>$) are done if\\
\verb@       <inst2> end_if@& condition $<c>$ is true (or false)\\
\verb@repeat_turtle n,<i1>,<i2> @& repeat $n$ times the instructions $<i1>,<i2>$\\ 
\verb@for j from j1 to j2> do@&$<inst>$ are done with an iteration variable\\
 \verb@      <inst> end_for@& $j$ with a step=1 for the iteration\\ 
\verb@for j from j1 to j2 by@&$<inst>$ are done with an iteration variable\\
 \verb@    p do <inst> end_for@& $j$ with a step $p$ for the iteration\\ 
\verb@while <c> do <inst>@& $<inst>$ are done while condition $<c>$is\\
\verb@          end_while@& true\\ 
\verb@return@& return the value of a function\\ 
\verb@input(a)@& get a value from the keyboard, stores it in $a$,\\ 
\verb@textinput(a)@& get a string from the keyboard, stores it in $a$\\ 
\verb@write("toto",a,b)@& write functions $a,b$ in a file named $toto$\\ 
\verb@read("toto")@& read the functions from the file named $toto$\\ 
\hline
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{|ll|}
\hline
\multicolumn{2}{|c|}{\bf Position}\\
\hline\hline
\verb@position@& give the turtle position or change it's position\\
\verb@cap@& give the turtle direction or change it's direction\\
\verb@towards@& put the turtle direction to a point.\\
\hline
\end{tabular}
\end{center}


There should be at most one turtle picture level in a given session.\\
To drive the turtle, you can write a command, use the 
{\tt Turtle} menu, or click on a button below the turtle picture, each button 
is named after the first letters of a turtle command ({\tt cr} button displays 
also all the colors).
At the right of the screen, there is a small editor which records 
all your commands (called ``recording editor'').
You may change commands there and synchronize the turtle picture by running all 
these commands (press {\tt F7}).
\begin{center}\includegraphics[width=8cm]{tortuefrisen}\end{center}
This picture is obtained by repetition of a pattern, which is isolated
above (turtle start position is in yellow). Let's make first the pattern: 
open a turtle level ({\tt Alt+d}) then enter in the 
commandlines at the left of the picture~:\\
\verb|pen 1;|\\
\verb|filled_rectangle ;|\\
\verb|jump ;|\\
\verb|turn_right ;|\\
\verb|pen 4;|\\
\verb|filled_rectangle ;|\\
\verb|turn_left ;|\\
\verb|jump ;|\\
You can enter most commands by pressing buttons {\tt pe, fr, ju, tr, ...}.
The commands are echoed in the recording editor 
at the right of the
picture. If you make a mistake, modify the command in the small editor
and press {\tt F7} to synchronize.\\
Once the commands are all entered, open a program editor ({\tt Alt+p})
and copy-paste the text from the small editor to the program editor.
Replace \verb|efface;| at the beginning by \verb|motif():={|
then add a \verb|}| at the end before \verb|  :;| and press {\tt F9}.\\
Enter in a commandline at the left of the picture :\\
{\tt repeat\_turtle 10, motif()}\\
You can move or zoom the picture with mouse drags and with the mousewheel.

This example shows how to make a complex picture by decomposing it
in simple tasks, and how to properly use the recording editor to extract
a procedure from a picture built step by step.
\end{document}
