\documentclass[papersize,a4paper,12pt]{article} \usepackage{ketpic,ketlayer} \usepackage{amsmath} % \usepackage{amsmath,newtxmath} %\usepackage[dvipdfmx]{graphicx,color} \usepackage{graphicx,color} \usepackage{wrapfig} %\usepackage[dvipdfmx,bookmarks=false,colorlinks=true,linkcolor=blue]{hyperref} \usepackage[bookmarks=false,colorlinks=true,linkcolor=blue]{hyperref} \setmargin{20}{20}{15}{25} \usepackage{setspace} \usepackage{comment} \usepackage{bm,enumerate} %\newcommand{\cmd}[1]{ %\begin{center}{\bf\large #1}\end{center} %\hypertarget{#1}{} %} \newenvironment{cmd}[2]{ \hypertarget{#2}{} \begin{center}{\bf\large #1}\end{center} \begin{description} }{ \end{description} \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$Command List}\end{flushright} } % item command for this documentation \newcommand{\itemket}[1]{ \item[\Ltab{27mm}{#1}] } \begin{document} \title{\ketcindy\ Command Reference} \author{\ketcindy\ Project Team} \maketitle \begin{center} - ver.3.2 -\end{center} \hypertarget{index}{} \tableofcontents \newpage %===== Plane Figure ===================== \section{Plane figure} %========= Setting and Defining =========== \subsection{Setting and Defining} %========= Setting environment =========== \subsubsection{Setting environment} %----------Ketinit---------------------------------- \begin{cmd}{Ketinit}{ketinit} \itemket{Usage}Ketinit(); \itemket{Description}Generic function to initialize \ketcindy. \itemket{Examples}\mbox{} \verb|Ketinit();|\ \ The work sub folder is set to \verb|"fig"| in the folder of the cindy file.\\ \verb|Ketinit("");|\ \ The work folder is set to the folder of the cindy file. \itemket{Details}\mbox{}\\ This function should be written at the first line on Draw slot page. In case of space figure (KeTCindy's 3D-mode), write it in the initialization slot page \verb|ketlib|. \end{cmd} %----------Initglist,Setglist,Addglist---------------------------------- \begin{cmd}{Initglist}{initglist} \itemket{Usage}Initglist(), Setglist(), Addglist() \itemket{Description}Add the list generated in \verb|"ketlib"| slot to that of \verb|"ketlib"| slot. \itemket{Examples}\mbox{} \begin{verbatim} Initglist(); // in ketlib slot Implicitplot(''1'',fun,rng); Setglist(); Ketinit(); // in figures slot Addglist(); \end{verbatim} \end{cmd} %-----------Setfiles--------------------------------- \begin{cmd}{Setfiles}{setfiles} \itemket{Usage}Setfiles(filename) \itemket{Description}Generic function to set the name of texfile. \itemket{Details}Default file name is working Cinderella file name. \itemket{Examples}\mbox{} If working Cinderella file name is "triangle.cdy" then default files name are "triangle.tex". By \verb|Setfiles("grav");| output files name are "grav.tex".\\ \end{cmd} %----------Setparent---------------------------------- \begin{cmd}{Setparent}{setparent} \itemket{Usage}Setparent(filename) \itemket{Description}Generic function to set the name of texfile by using the Parent push button. \itemket{Details}There is no default file name when we use the Figpdf() function and the Parent push button, so we have to define the name of output texfile. \itemket{Examples}\mbox{} If working Cinderella file name is "triangle.cdy" , by \verb|Setparent("grav");| output files name are "triangle.tex" and "grav.tex". PDF name is "grav.pdf". \end{cmd} %-----------Changework--------------------------------- \begin{cmd}{Changework}{changework} \itemket{Usage}Changework(name of pass) \itemket{Description}Generic function to change the working directory(folder). Default working directory is "fig". \end{cmd} %--------Addpackage------------------------------------ \begin{cmd}{Addpackage}{addpackage} \itemket{Usage}Addpackage(list of style fies) \itemket{Description}Generic function to add packages of \TeX\ to the main file for previewing. \itemket{Details}Basically, \verb|ketpic,ketlayer,amsmath,amssymb,graphicx,color| are used. \itemket{Examples}\mbox{} \verb|Addpackage(["[dvipdfmx]{media9}","[dvipdfmx]{animate}","ketmedia"]);| \end{cmd} %--------Usegraphics------------------------------------ \begin{cmd}{Usegraphics}{usegraphics} \itemket{Usage}Usegraphics("pict2e") \itemket{Description}This function changes the graphics package to \verb|"pict2e"|. \itemket{Details}The defaut package is \verb|"tpic"|. \itemket{Examples}\mbox{}\\ \verb|Usegraphics("pict2e");| \end{cmd} %========= Drawing and defining =========== \subsubsection{Drawing and defining} %-------Addax------------------------------------- \begin{cmd}{Addax}{addax} \itemket{Usage}Addax(1/0); \itemket{Description}Generic function to decide axis are drawn or not. \itemket{Details}If argument is 1, axis are output in the TeX file (default) but there are no axis on the Euclidean view. \itemket{Examples} \mbox{} To draw a triangle. \verb| Listplot([B,A,C]);|\\ \verb| Letter([A,"ne","A",B,"se","B",C,"se","C"]);| \begin{center} \input{Fig/addax1} \end{center} Hide coordinate axes. \verb| Addax(0);|\\ \verb| Listplot([B,A,C,B]);|\\ \verb| Letter([A,"ne","A",B,"sw","B",C,"se","C"]);| \begin{center} \input{Fig/addax2} \end{center} \end{cmd} %----------Setax---------------------------------- \begin{cmd}{Setax}{setax} \itemket{Usage}Setax(a list of parameters); \itemket{Description}Generic function to set the style of axis. \itemket{Details}Parameters are:\\ 1. Style of axis ("l" ; line(default), "a" : arrow)\\ 2. Name of horizontal ax ( default is x)\\ 3. Posion of horizontal name (default is "e")\\ 4. Name of horizontal ax ( default is y)\\ 5. Posion of horizontal name (default is "n")\\ 6. Name of origin (default is O)\\ 7. Position of origin (default is "sw")\\ 8. Linestyle\\ 9. Color of axes\\ 10. Color of labels\\ \itemket{Examples}\mbox{} \verb|Setax(["a","","","","","","nw"]);|\\ \verb|Setax(["","","","","","","","do","red"]);|\\ \verb|Setax([7,"nw"]);|\\ \verb|Setax(["a","\theta","","x","w"]);| \begin{center} \input{Fig/setax-theta} \end{center} \end{cmd} %-----------Drwxy--------------------------------- \begin{cmd}{Drwxy}{drwxy} \itemket{Usage}Drwxy(), Drwxy(options) \itemket{Description}Generic function to draw axis in the \TeX\ figure. \itemket{Details}\mbox{}\\ By default the axes are drawn last. Use this function when axis should be drawn in the middle of commands. There are no axis on the Euclidean view. Options is a list of ["Origin=", "Xrng=", "Yrng="]. \itemket{Examples}\mbox{} To draw a point in the void mode. \verb|Setax([7,"se"]);|\\ \verb|Setpt(8);|\\ \verb|Pointdata("1",[[-pi,0]],["Inside=0"]);|\\ \verb|Drwxy();|\\ \verb|Plotdata("1","sin(x)","x",["dr","Num=300"]);|\\ \verb|Pointdata("2",[[pi,0]],["Inside=0"]);| \begin{center} \input{Fig/drwxy} \end{center} \end{cmd} %-----------Definecolor--------------------------------- \begin{cmd}{Definecolor}{definecolor} \itemket{Usage}Definecolor(name of a color,colorcode) \itemket{Description}Generic function to define the name of colorcode in the \TeX\ figure. \itemket{Examples}\mbox{} \verb|Definecolor("darkmaz",[0.8,0,0.8]);|\\ \verb|Setcolor("darkmaz");| \end{cmd} %---------Setcolor----------------------------------- \begin{cmd}{Setcolor}{setcolor} \itemket{Usage}Setcolor(color,options) \itemket{Description}Generic function to set the color of figures and characters in the \TeX\ figure. \itemket{Examples}\mbox{} \verb|C.xy=|B.xy|/|C.xy|*C.xy;|\\ \verb|Listplot([B,A,C]);|\\ \verb|Setcolor([1,0,0]);|\\ \verb|Anglemark("1",[B,A,C],[3]); //size=3|\\ \verb|Arrowhead(1,"ag1",[2]); //position=1,size=2| %\verb|Setcolor("red",opacity);|\\ %\hspace*{20mm} opacity is real number from 0 to 1 \itemket{Remark}You can also use color option in each command of drawing. \verb|Arrowhead(1,"ag1",["Color=[1,0,0]"]);| \vspace{\baselineskip} \hspace{20mm}% \includegraphics[width=35mm,bb=0.00 0.00 176.00 165.00]{Fig/anglearrowscreen.pdf}% \hspace{20mm}\scalebox{0.5}{\input{Fig/anglearrow.tex}} Refer to Color table on Appendix. \end{cmd} %----------Deffun---------------------------------- \begin{cmd}{Deffun}{deffun} \itemket{Usage}Deffun(name of a function,a list of commands); \itemket{Description}Generic function to define a function common to both Cindyscript and R. \itemket{Examples}\mbox{} $f(x)=\dfrac{1}{x^2+1}$ \vspace{\baselineskip} \verb|Deffun("f(x)",["regional(y)","y=1/(x^2+1)","y"]);|\\ \verb|Plotdata("1","f(x)","x");| \vspace{\baselineskip} \hspace{20mm}\input{Fig/deffun01} $f(x)=\left\{\begin{array}{l}1 (x\geq 0)\\ -1 (x<0)\\ \end{array}\right.$ \vspace{\baselineskip} \verb|Deffun("f(x)",["regional(y)","if(x>=0,y=1,y=-1)","y"]);|\\ \verb|Plotdata("1","f(x)","x",["Dis=1","Num=100"]);| \vspace{\baselineskip} \hspace{20mm}\input{Fig/deffun02} "If" command can be nesting. \vspace{\baselineskip} \verb|Deffun("f(x)",["regional y","if(x>1,y=1,if(x>-1,y=x,y=-1))","y"]);| \vspace{\baselineskip} \hspace{20mm}\input{Fig/deffun03} \end{cmd} %----------Defvar---------------------------------- \begin{cmd}{Defvar}{defvar} \itemket{Usage}Defvar([name,value,...]); \itemket{Description}Generic function to define variables common to both Cindyscript and R. \itemket{Examples}\mbox{} \begin{tabbing} 123456789012345678901234\=\kill \verb|Defvar(["const",3]);| \> //const=3;\\ \verb|Defvar(["a",3,"b",1]);| \> //a=3;b=1; \end{tabbing} \end{cmd} %-----------Fontsize--------------------------------- \begin{cmd}{Fontsize}{fontsize} \itemket{Usage}Fontsize(size symbol) \itemket{Description}Generic function to define the font size in the \TeX\ figure. \itemket{Details}The symbol is \verb|"t", "ss", "f", "s", "n", "la", "La", "LA", "h", "H"|. \itemket{Examples}\mbox{} \verb|Ptsize(2);|\\ \verb|Drawpoint([A,B,C,D,E,F,G]);|\\ \verb|Fontsize("t"); Letter([A,"s2","A"]);|\\ \verb|Fontsize("ss"); Letter([B,"s2","B"]);|\\ \verb|Fontsize("s"); Letter([C,"s2","C"]);|\\ \verb|Fontsize("la"); Letter([D,"s2","D"]);|\\ \verb|Fontsize("La"); Letter([E,"s2","E"]);|\\ \verb|Fontsize("h"); Letter([F,"s2","F"]);|\\ \verb|Fontsize("H"); Letter([G,"s2","G"]);| \begin{center} \input{Fig/fontsize} \end{center} \end{cmd} %-----------Ptsize--------------------------------- \begin{cmd}{Ptsize}{ptsize} \itemket{Usage}Ptsize(ratio); \itemket{Description}Generic funtion to set the size of points. \itemket{Details}This function is same as Setpt().\\ \end{cmd} %-----------Setpt--------------------------------- \begin{cmd}{Setpt}{setpt} \itemket{Usage}Setpt(ratio); \itemket{Description}Generic funtion to set the size of points. \itemket{Details}"ratio" is the ratio from the standard size.\\ Size can be change as a option of "Pointdata". \itemket{Examples}\mbox{} \verb|Pointdata("1",A,["Size=1"]);|\\ \verb|Pointdata("2",B,["Size=2"]);|\\ \verb|Pointdata("3",C,["Size=3"]);|\\ \verb|Pointdata("4",D,["Size=4"]);| \hspace{20mm}\input{Fig/pointsize} \end{cmd} %------------Setmarklen-------------------------------- \begin{cmd}{Setmarklen}{setmarklen} \itemket{Usage}Setmarklen(real number) \itemket{Description}Generic function to set the length of tickmarks on the axsis. \itemket{Details}Set the length of tickmarks on the axsis when we use the functions \hyperlink{htickmark}{Htickmark()} and Vtickmark().\\ \end{cmd} %-------------Setorigin------------------------------- \begin{cmd}{Setorigin}{setorigin} \itemket{Usage}Setorigin(coordinate) \itemket{Description}Generic function to set or transtate the coordinate of apparent origin. \itemket{Examples}\mbox{} \verb|Setorigin([3,2]);|\\ if A is identification name of some point, \verb|Setorigin(A);|\\ \itemket{Remark} Coordinate system is not changed as the following examples.\\ \itemket{Examples}\mbox{} The coordinate of apparent origin is $(3,2)$ but we use the original coordinate system in the script.\\ \verb| Setorigin([3,2]);|\\ \verb| Listplot([A,B,C,A]);|\\ \verb| Ptsize(3);|\\ \verb| Drawpoint([1,1]);|\\ \verb| Letter([[1,1],"s2","P"]);|\\ Left figure is Euclidean view, right figure is the result of \TeX. \begin{center} \includegraphics[bb=0 0 299.02 250.01 , width=4cm]{Fig/setorigin.pdf}\hspace{10mm}% \input{Fig/setorigin} \end{center} \end{cmd} %------------Setpen-------------------------------- \begin{cmd}{Setpen}{setpen} \itemket{Usage}Setpen(real number) \itemket{Description}Generic function to set the thickness of lines. \end{cmd} %------------Setscaling-------------------------------- \begin{cmd}{Setscaling}{setscaling} \itemket{Usage}Setscaling(scale) \itemket{Description}Generic function to set the scale of vertical direction. Argument is real number or list. If it is a real number, vertical scaling. If the list [a, b], scaling a in the horizontal direction and b in the vertical direction. \itemket{Examples}\mbox{} \verb|Setscaling(0.5);|\\ \verb|Plotdata("1","-2*x^2+10*x","x");|\\ \verb|p1=[5/2,0]; p2=[5/2,25/2]; p3=[0,25/2];|\\ \verb|Listplot(``1",[p1,p2,p3],["da"]);|\\ \verb|Expr([[5,0],"s2w","5",p3,"w2","\frac{25}{2}",p1,"s4","\frac{5}{2}"]);| \begin{center} \input{Fig/setscaling} \end{center} \end{cmd} %-----------Setunitlen--------------------------------- \begin{cmd}{Setunitlen}{setunitlen} \itemket{Usage}Setunitlen(scale); \itemket{Description}Generic function to set the scale of unit length. (default is 1cm)\\ It is recommended to put this function to the beginning of a script. \itemket{Examples}\mbox{} \verb|Setunitlen("8mm");|\\ \end{cmd} %--------------Setwindow------------------------------ \begin{cmd}{Setwindow}{setwindow} \itemket{Usage}Setwindow(range of x , range of y); \itemket{Description}Generic function to set a output area on a Euclidean view. \itemket{Details}A output area is normally specified by a rectangle with SW and NE as diagonal two vertices. (i.e range of x is [XMIN,XMAX] and range of y is [YMIN,YMAX]) By dragging these two vertices on a Euclidean view, we can change the output area. This command is used to set the window manually and fix it. \itemket{Examples}\mbox{} \verb|Setwindow([-5,5],[-1,3]);| \vspace{\baselineskip} \hspace{20mm}\includegraphics[bb=0.00 0.00 415.02 199.01,width=8cm]{Fig/setwindow.pdf} \end{cmd} %======== Commands for Drawing ============ \subsection{Commands for Drawing} \subsubsection{Options of drawing command} \begin{cmd}{Options of drawing command}{options} \item Line type \begin{tabbing} 1234\=5678901234567\=\kill \> "dr, n" \>solid line\\ \> \> n : thickness\\ \> "da(,m,n)" \>broken line \\ \> \> m : length, n : gap \\ \> \>m,n option are not draw Euclidean view and can be omitted.\\ \> "id(,m,n)" \>broken line start gap.\\ \> "do(,m,n)" \>dot line\\ \> \>m : gap, n : thickness \end{tabbing} \item Color \hspace{10mm}"Color=col" : col: RGB or CMYK or color name \item Num \hspace{10mm}"Num=n" : Number of divisions of plotting data \vspace{\baselineskip} \hspace{5mm} Example \hspace{10mm} \verb|Plotdata("1","x^2","x",["Color=red","do,2,3","Num=100"]);| \item Output \begin{tabbing} 1234\=56789012345\=\kill \> "notex" \>not output to \TeX.\\ \> "nodisp" \>not output to \TeX and Euclidean view but make PD.\\ \> "Size=n" \> size of point and thin of line\\ \> "Num=n" \>Number of PD \end{tabbing} \item Direction The direction is represented by e(east : right), w(west: left), n(north : upper), s(south:lower) and c(center). The distance from the specified position can also be given as a numerical value. For example, "e2" and "e3" are placed twice and three times of the slightly unit distance away from "e", respectively. \begin{center}\input{Fig/ewns} \end{center} \item Others In addition, there are options specific to each function. \end{cmd} %========= Point , line ====================== \subsubsection{Point, line } %---------Pointdata----------------------------------- \begin{cmd}{Pointdata}{pointdata} \itemket{Usage}Pointdata(name, point list, options) \itemket{Description}Generic function to make a point data. \itemket{Detailse}Options are "Size=", "Color=", "Inside=","notex/nodisp". \itemket{Examples}\mbox{} \verb|Pointdata("1",[[1,2],[-2,3]]); | // make 2 points (1,2),(-2,3)\\ \verb|Pointdata("2",[A,B]); | // A and B are draw by drawing tool.\\ \verb|Pointdata("3",A,["size=4"]); | // size of point A is 4.\\ \verb|Pointdata("4",[A,B],["Inside=0"]); | // white circles\\ \verb|Pointdata("5",[[3,4],[5,6]],["notex"]); | //not draw in the \TeX file.\\ \verb|Pointdata("6",[[3,4],[5,6]],["nodisp"]);| //not draw \TeX file and Euclidean view.\\ Draw node of tree. \verb|Ptsize(3);|\\ \verb|Pointdata("1",[[1,2],[3,4],[5,2]]);|\\ \verb|Listplot("1",[[0,0],[1,2],[3,4],[5,2],[4,0]]);|\\ \verb|Listplot("2",[[1,2],[2,0]]);|\\ \verb|Listplot("3",[[5,2],[6,0]]);|\\ \hspace{20mm} \input{Fig/pointdata} \itemket{Remark} \hyperlink{mkpttable}{Comparative chart of drawing of points} \end{cmd} %---------Drwpt ----------------------------------- %\begin{cmd}{Drwpt}{drwpt} %\itemket{Usage}Drwpt(point, option) or Drawpoint(point, options) %\itemket{Description}Draw a point. %\itemket{Details} %The position of point is specified via its coordinate or the name of geometric object. %When the point is to be displayed not only on \TeX\ final output but also on the Euclidean view, you should generate geometric point on the screen. %Also \verb|Pointdata()| or \verb|Putpoint()| can be used. %When several points are to be generated, %the list of them should be given as the argument. %When 0 is input as the option, the point is displayed in a solid-white manner. %\itemket{Examples}\mbox{} %Draw the points $(1,1)$ and $(4,3)$. %\verb| Drwpt([[1,1],[4,3]]);|\\ %After generating points A, B, and C on the Euclidean view, display their image on \TeX\ document. %\verb| Drwpt([A,B,C]);|\\ %The endpoint B of segment AB in a solid-white manner. %\verb| Ptsize(5);|\\ %\verb| Listplot([A,B]);|\\ %\verb| Drawpoint(B,0);| %\begin{center} %\input{Fig/drawpoint} %\end{center} %\itemket{Remark} \hyperlink{mkpttable}{Comparative chart of drawing of points} %\end{cmd} %--------------Putpoint------------------------------ \begin{cmd}{Putpoint}{putpoint} \itemket{Usage}Putpoint(name of point, A, B); \itemket{Description}Generic function to put a point. \itemket{Details}Put a point at A. If there already exists a point at A, it is put at B. \itemket{Examples}\mbox{} \verb|Putpoint("P",[1,1]); | // P is fixed point.\\ \verb|Putpoint("P",[1,1],[P.x,P.y]); | // for a movable point. \itemket{Remark} \hyperlink{mkpttable}{Comparative chart of drawing of points} \end{cmd} %-------------Putintersect------------------------------- \begin{cmd}{Putintersect}{putintersect} \itemket{Usage}Putintersect(name of point, PD1 ,PD2, [Number] ) \itemket{Description}Generic function to make a intersection point of two curves. \itemket{Details}PD1 and PD2 are plotting data names of two curves. Only one intersection point exists inside the drawing range, we have the point. If there exist many intersection points inside the drawing range then we have the list of coordinates for the points and the message:"Choose point number" on the console. The "Number" argument is this point number. We have to use the function Pointdata() when we need the figure of points in the output \TeX file. \itemket{Examples}\mbox{} In the following example We have three intersection points for a cubic curve and a line. \begin{minipage}{80mm} \verb|Plotdata("1","x^3-4*x","x",["Num=200"]);|\\ \verb|Plotdata("2","1/2*x+1","x");|\\ \verb|Putintersect("P","gr1","gr2",1);|\\ \verb|Putintersect("Q","gr1","gr2",2);|\\ \verb|Putintersect("R","gr1","gr2",3);|\\ \verb|Pointdata("1",[P,Q,R],["size=4"]);| \end{minipage}\hspace{5mm} \begin{minipage}{30mm} \vspace{3mm} \input{Fig/putintersect} \end{minipage} If there exist no such points, we have the message:"No intersect point" on the console. \end{cmd} %-------------PutonCurve------------------------------- \begin{cmd}{PutonCurve}{putoncurve} \itemket{Usage}PutonCurve(name of point, PD, options); \itemket{Description}Generic function to put a point on the curve. \itemket{Details}Put a point on the curve of PD. \itemket{Examples}\mbox{} \verb|Paramplot("1","[2*cos(t)^3,2*sin(t)^3]","t=[0,2*pi]");|\\ \verb|PutonCurve("P","gp1",[-1,1]);|\\ This Point P on the asteroid can be move along the curve on the Euclidean view. \begin{center} \input{Fig/putoncurve.tex} \end{center} \end{cmd} %------------PutonLine-------------------------------- \begin{cmd}{PutonLine}{putonline} \itemket{Usage}PutonLine(name of point, A, B); \itemket{Description}Generic function to put a point on the line. \itemket{Details}Put a point on the straight line through the two points A and B. \itemket{Examples}\mbox{} \verb|PutonLine("P",A,B);| \end{cmd} %--------------PutonSeg------------------------------ \begin{cmd}{PutonSeg}{putonseg} \itemket{Usage}PutonSeg(name of point, A, B); \itemket{Description}Generic function to put a point on the segment. \itemket{Details}Put a point on the line segment AB. \itemket{Examples}\mbox{} \verb|PutonSeg("P",A,B);| \end{cmd} %-------------Reflectpoint------------------------------- \begin{cmd}{Reflectpoint}{reflectpoint} \item[Usage]Reflectpoint(a point, center or axis of symmetry); \itemket{Description}Generic function do return the reflect point. \itemket{Examples}\mbox{} \verb|C.xy=Reflectpoint(A,B);|\\ \verb|D.xy=Reflectpoint(A,[[2,3]]);|\\ \verb|E.xy=Reflectpoint([-1,1],[[1,0]]);|\\ \verb|F.xy=Reflectpoint(A,[C,E]);|\\ \verb|Lineplot([C,E],["do"]);| \begin{center} \input{Fig/reflectpoint} \end{center} \end{cmd} %-----------Rotatepoint--------------------------------- \begin{cmd}{Rotatepoint}{rotatepoint} \itemket{Usage}Rotatepoint(point, angle(degree), center); \itemket{Description}Generic function to rotate a point. \itemket{Examples}\mbox{} \verb|C.xy=Rotatepoint(A,2*pi/3,B);|\\ \verb|D.xy=Rotatepoint((5,2),pi/3,B);|\\ \verb|E.xy=Rotatepoint([3,0],-pi/4,A);| \begin{center} \input{Fig/rotatepoint} \end{center} \end{cmd} %-----------Scalepoint--------------------------------- \begin{cmd}{Scalepoint}{scalepoint} \itemket{Usage}Scalepoint(point, scale, center): \itemket{Description}Generic function to scale a point. \itemket{Examples}\mbox{} \verb| D.xy=Scalepoint(A,[3,2],[0,0]);|\\ \verb| E.xy=Scalepoint(A,[3,2],B);|\\ \verb| F.xy=Scalepoint(A,C.xy,[0,0]);|\\ \verb| Arrowdata("1",[[0,0],C]);|\\ \verb| Pointdata("1",[A,B,C,D,E,F],["size=2"]);|\\ \verb| Letter([A,"e2","A("+A.x+","+A.y+")"]);|\\ \verb| Letter([B,"e2","B("+B.x+","+B.y+")"]);|\\ \verb| Letter([C,"e2","C("+C.x+","+C.y+")"]);|\\ \verb| Letter([D,"e2","D("+D.x+","+D.y+")"]);|\\ \verb| Letter([E,"e2","E("+E.x+","+E.y+")"]);|\\ \verb| Letter([F,"e2","F("+F.x+","+F.y+")"]);|\\ \begin{center} \input{Fig/scalepoint} \end{center} \end{cmd} %-------------Translatepoint------------------------------- \begin{cmd}{Translatepoint}{translatepoint} \itemket{Usage}Translatepoint(point, vector); \itemket{Description}Generic function to translate a point. \itemket{Examples}\mbox{} \verb|C.xy=Translatepoint(A,[2,3]);|\\ \verb|D.xy=Translatepoint(A,B.xy);| \begin{center} \input{Fig/translatepoint} \end{center} \end{cmd} %------------Setarrow-------------------------------- \begin{cmd}{Setarrow}{setarrow} \itemket{Usage}Setarrow(size(1), angle(18), position(1), cut(0.2) \itemket{Description}set the style of arrow \end{cmd} %------------Arrowdata-------------------------------- \begin{cmd}{Arrowdata}{arrowdata} \itemket{Usage}Arrowdata(name,[starting point, ending point] , options) \itemket{Description}draw an arrow line between two points. Options : Those of Setarrow and "Line=n(y)"(with line),"Cutend="(trimming),"Color=" \itemket{Examples}\mbox{} \verb| Arrowdata("1",[A,B]);|\\ \verb| Arrowdata("2",[[1,0],[2,3]],[2]);|\\ \verb| Arrowdata("3",[[2,0],[3,3]],[3,45]);|\\ \verb| Arrowdata("4",[[3,0],[4,3]],[3,1,0.5]);|\\ \verb| Arrowdata("5",[[4,0],[5,3]],[3,1,1,0]);|\\ \verb| Arrowdata("6",[[5,0],[6,3]],[3,"Line=y"]);|\\ \verb| Arrowdata("7",[[6,0],[7,3]],[3,"dr,2"]);|\\ \verb| Arrowdata("8",[[7,0],[8,3]],[3,1,1,0.5,"Color=red"]);|\\ %\vspace{6mm} \hspace{20mm}\scalebox{0.9}{\input{Fig/arrowhead}} \begin{minipage}{80mm} \verb| Circledata("1",[A,A.xy+[0.5,0]]);|\\ \verb| Circledata("2",[B,B.xy+[0.7,0]]);|\\ \verb| Arrowdata([A,B],["Cutend=[0.5,0.7]"]);|\\ \verb| Letter([A,"c","A",B,"c","B"]);|\\ \end{minipage} \hspace{5mm} \begin{minipage}{40mm} \input{Fig/trimarrow} \end{minipage} \end{cmd} %--------------Arrowhead------------------------------ \begin{cmd}{Arrowhead}{arrowhead} \itemket{Usage}(1) Arrowhead(point, direction , options) \\ \hspace*{18.8mm}(2) Arrowhead(point/positon ratio, PD(curve), options) \itemket{Description}(1) draw an arrowhead with specified direction at a point.\\ \hspace*{18.8mm}(2) draw an arrowhead on a PD(curve)\\ Options are the same as Arrowdata\\ Position ratio of a point on the curve is from 0 to 1. \itemket{Examples}\mbox{} \vspace{2mm} \begin{layer}{150}{0} \putnotese{110}{8}{\input{Fig/ForRef-Arrowhead-1}} \end{layer} Let A=[1,1]. \begin{enumerate}[(a)] \item \verb|Arrowhead(A,[-1,1]);| \item \verb|Arrowhead([1,1],[-1,1],[2,60]);| \item \verb|Arrowhead(A,[-1,1],[2,30,0.5);| \item \verb|Arrowhead([1,1],[-1,1],[2,20,0.5,"Line=y"]);| \end{enumerate} \vspace{5mm} \begin{layer}{150}{0} \putnotese{0}{0}{(a)} \putnotese{30}{0}{(b)} \putnotese{60}{0}{(c)} \putnotese{90}{0}{(d)} \putnotese{0}{7}{ \input{Fig/ForRef-Arrowhead-2}} \putnotese{30}{7}{ \input{Fig/ForRef-Arrowhead-3}} \putnotese{60}{7}{ \input{Fig/ForRef-Arrowhead-4}} \putnotese{90}{7}{ \input{Fig/ForRef-Arrowhead-5}} \end{layer} \vspace{30mm} \begin{layer}{150}{0} \putnotese{110}{4}{\input{Fig/ForRef-Arrowhead2-6}} \end{layer} Let A whose position ratio is 0.6 be on the curve cr1. \begin{enumerate}[(a)]% \setcounter{enumi}{4}% \item \verb|Arrowhead(A,"cr1");| \item \verb|Arrowhead(0.6,"cr1",[2,1,0.5,"Color=red"]);| \item \verb|Arrowhead(1,"cr1");| \item \verb|Arrowhead(1,"Invert(cr1)",["Line=y"]);| \end{enumerate} \vspace{5mm} \begin{layer}{150}{0} \putnotese{0}{0}{e)} \putnotese{30}{0}{(f)} \putnotese{60}{0}{(g)} \putnotese{90}{0}{(h)} \putnotese{0}{7}{ \input{Fig/ForRef-Arrowhead2-7}} \putnotese{30}{7}{ \input{Fig/ForRef-Arrowhead2-8}} \putnotese{60}{7}{ \input{Fig/ForRef-Arrowhead2-9}} \putnotese{90}{7}{ \input{Fig/ForRef-Arrowhead2-10}} \end{layer} \vspace{30mm} \end{cmd} %---------Lineplot----------------------------------- \begin{cmd}{Lineplot}{lineplot} \itemket{Usage}Lineplot(name, [A, B], options) \itemket{Description}Draw the straight line through the two points A, B. \itemket{Details} The list of two points is given by the coordinates or the geometric elements. \\ If the list of points is given by geometric elements, "name" can be omitted. \\ options : "+" means drawing a half straight line. \\ Both the line type and "+" can be specified as a list. \\ \item[Example]\mbox{} Draw a straight line connecting the coordinates. \hspace{5mm}\verb|Lineplot("1",[[0,0],[1,2]]);| Draw the two points A, B in the Cinderella main screen and draw a straight line AB. \hspace{5mm}\verb|Lineplot([A,B]);| Some examples of options. \hspace{5mm}\verb|Lineplot([A,B],["dr,0.5","+"]);| // Draw a half line with A as the end point. \hspace{5mm}\verb|Lineplot([C,D],["dr,2"]); | // Draw the straight line CD with double thickness. \hspace{5mm}\verb|Lineplot([E,F],["da"]); | // Draw the straight line EF as a broken line. \hspace{5mm}\verb|Lineplot([G,H],["do"]); | // Draw the straight line GH as a dotted line. The results are shown in order from the top left of the next figure. \begin{center} \input{Fig/lineplot} \end{center} \end{cmd} %-----------Listplot--------------------------------- \begin{cmd}{Listplot}{listplot} \itemket{Usage}Listplot(name, a list of points, options) \itemket{Description}Connect points by line segments. \itemket{Details} The list of two points is given by the names of the coordinates or the geometric elements. \\ If the list of points is given by geometric element names, the name of the plotting data can be omitted. \\ \item[Example1]\mbox{} Line style \hspace{10mm} \verb|Listplot([A,B]);| \hspace{10mm} \verb|Listplot([C,D],["dr,2"]); | \hspace{10mm} \verb|Listplot([E,F],["da"]); | \hspace{10mm} \verb|Listplot([G,H],["da,3,1"]);| \hspace{10mm} \verb|Listplot([K,L],["da,1,3"]);| \hspace{10mm} \verb|Listplot([M,N],["do"]); | \hspace{10mm} \verb|Listplot([O,P],["do,3"]); | \hspace{10mm} \verb|Listplot([Q,R],["do,3,3"]);| \hspace{20mm} \includegraphics[bb=0.00 0.00 328.02 157.01,width=8cm]{Fig/listplot3view.pdf} \hspace{20mm} \input{Fig/listplot3} \item[Example2]\mbox{} Draw a triangle. \\ Draw the triangle ABC or simply creating 3 points A, B, C with the Euclidean view. \hspace{10mm}\verb|Addax(0);| \hspace{10mm}\verb|Listplot([A,B,C,A]);| \hspace{20mm}\input{Fig/listplot1} The position of the points can be specified by coordinates. In this case "name" is necessary. \hspace{10mm}\verb|Listplot("1",[[0,0],[2,0],[1,2],[0,0]]);| \item[Example3]\mbox{} Expansion of finite Fourier series \hspace{20mm}$\displaystyle{\cfrac{\pi}{2}+\sum_{n=0}^{30} \cfrac{1-(-1)^n}{n}\sin nx}$ The plotting data is a list of the coordinates of points. Therefore, define the function in Cindyscript as follows, create plotting data \verb|pd| and pass it as argument. \\ \verb|f(x):=(|\\ \verb| s=pi/2;|\\ \verb# repeat(30,n,s=s+(1-(-1)^n)/n*sin(n*x));#\\ \verb|);|\\ \verb|pd=apply(0..200,t,|\\ \verb| x=-2*pi+t*4*pi/200;|\\ \verb| [x,f(x)];|\\ \verb|);|\\ \verb|Listplot("1",pd);|\\ \verb|Expr([[-2*pi,-0.5],"s","-2\pi",[-pi,-0.5],"s","-\pi",[pi,-0.5],"s",|\\ \verb| "\pi",[2*pi,-0.5],"s","2\pi",[0,pi],"w2","\pi"]);|\\ \begin{center} \input{Fig/fourier} \end{center} There is a limit on the length of the list, so it is impossible to use a long list or to use it many times. For example, in the Shellpinski gasket using Turtle Graphics, the next size is possible, but in the growth model of plants there are many branches so it can not be a big figure. We devise a script and divide it into lists of about 200. \\ \begin{center} \input{Fig/listplot2} \end{center} \end{cmd} %--------------Mksegments------------------------------ \begin{cmd}{Mksegments}{mksegments} \itemket{Usage}Mksegments() \itemket{Description}Create plotting data of all geometric segments. \itemket{Details} All the line segments drawn by the "Add line segment" tool in the Euclidean view are used as plotting data as they are. For example, if the line segment AB is created, plotting data \verb|sgAB| is created. After that, if you change the identification name of point B (for example to Q) in the inspector of the Euclidean view, the plotting data name is also changed. Even if the line segmen has already been drawn, it can be changed. \\ \item[Example]\mbox{} Examples of geometric progression\\ Draw a figure of a geometric progression that makes triangles by connecting the midpoints of each edge of a triangle one after another. \\ First draw the triangle ABC with the "Add line segment" tool in the Euclidean view. \\ Take the midpoint of each edge with the "Add midpoint" tool in the Euclidean view and connect the midpoints with the "Add line segment" tool in the Euclidean view. \\ Repeat this process. If you write \verb|Mksegments();|, you can obtain the data of the figure at the completion of drawing, without writing \verb|Listplot ([A, B, C]);|. \\ \begin{center} \includegraphics[bb=0.00 0.00 438.00 327.00,width=5cm]{Fig/gpro01.pdf}\hspace{10mm}\input{Fig/gpro02} \end{center} \end{cmd} %---------Framedata----------------------------------- \begin{cmd}{Framedata}{framedata} \itemket{Usage}Framedata(name,expr,options) \itemket{Description}Generic function to draw a rectangle. \itemket{Details} expr type1 : [center,lx,ly] : lx and ly are a half of the horizontal and vertical length. expr type2 : [p1, p2] : if p1 and p2 are name of point, 1st argument can be omitted. options : usual options and "center"/"corner" (type2). \hspace{10mm} If "center", p1 is center, p2 is apex of rectangle. (Default) \hspace{10mm} If "corner", p1 and p2 are diagonal point of rectangle. \itemket{Examples}\mbox{} \verb|Framedata("1"); | // same as \verb|Framedata([SW,NE],["corner"]);|\\ \verb|Framedata("2",[[0,0],2,2]);|\\ \verb|Framedata("3",[A,1.5,1.2]); | // left figure\\ \verb|Framedata([B,C]); | // center figure\\ \verb|Framedata([D,E],["corner"]); | // right figure \begin{center}\includegraphics[bb=0.00 0.00 348.15 106.16,width=12cm]{Fig/Framedata.pdf}\end{center} \itemket{Reference} \hyperlink{ovaldata}{Ovaldata}. \end{cmd} %------------Polygonplot-------------------------------- \begin{cmd}{Polygonplot}{polygonplot} \itemket{Usage}Polygonplot(name, point list, integer, options) \itemket{Description}Generic function to draw a polygon inscribed inside the circle. \itemket{Details}If the point list is [A,B] then the center is A and the radius is AB for the circle. Corresponding circle is not drawing. Two points A,B allowed to be coordinates. option : If A and B are geometric point , make geometric apex by "Geo=y". \itemket{Examples}\mbox{} \verb| Addax(0); |\\ \verb| Polygonplot("1",[[-4,1],[-4,3]],7); |\\ \verb| Polygonplot("2",[A,B],7); |\\ \verb| Polygonplot("3",[C,D],7,["Geo=y"]); |\\ \hspace{10mm}\includegraphics[bb=0.00 0.00 541.03 175.01,width=10cm]{Fig/polygonplot2.pdf} \hspace{10mm}\input{Fig/polygonplot1} We can draw the regular polygon whose one side is the line segment AB. \verb| n=5;|\\ \verb| pti=[complex(A),complex(B)];|\\ \verb| th=2*pi/n;|\\ \verb| repeat(n-2,s,|\\ \verb| z1=pti_s;|\\ \verb| z2=pti_(s+1);|\\ \verb| z=z2+(z2-z1)*(cos(th)+i*sin(th));|\\ \verb| pti=append(pti,z);|\\ \verb| );|\\ \verb| pt=apply(pti,gauss(#));|\\ \verb| pt=append(pt,A.xy);|\\ \verb| Listplot("1",pt);|\\ \verb|pti| is the list of complex numbers correspond to each vertex, \verb|pt| is the list of coordinates of vertexes. \end{cmd} %=============- Curves line ============ \subsubsection{Curved line} %----------Bezier---------------------------------- \begin{cmd}{Bezier}{bezier} \itemket{Usage}Bezier(name,nodes of curve, control points, options) \itemket{Description}Draw a bezier curve.\\ For each interval, control points are given in two lists for 3rd-order and one list for 2nd-order Bezier curve.\\ You can specify the number of division among nodes (default value is 10). \itemket{Examples}\mbox{} \begin{minipage}[t]{70mm} 2nd-order Bezier curve\\ \verb|Bezier("1",[A,B],[C]);| \end{minipage}% \hspace{5mm}bz1% \begin{minipage}[t]{60mm} \mbox{}\vspace{-15mm}\\ \input{Fig/checkbe1} \end{minipage}% \begin{minipage}[t]{70mm} 3rd-order Bezier curve\\ \verb|Bezier("c",[A,B],[C,D]);| \end{minipage}% \hspace{5mm}bzc% \begin{minipage}[t]{60mm} \mbox{}\vspace{-15mm}\\ \input{Fig/checkbe2} \end{minipage}% \begin{minipage}[t]{70mm} Connecting two curves,\\ \verb|Bezier("3",[A,B,C],[[D],[E,F]]);| \end{minipage}% \hspace{5mm}bz3% \begin{minipage}[t]{60mm} \mbox{}\vspace{-15mm}\\ \input{Fig/checkbe3} \end{minipage}% \begin{minipage}[t]{70mm} If D,B,E are on the straight line,\\ the curve becomes smoothly.\\ \verb|Bezier("S",[A,B,C],[[D],[E,F]]);| \end{minipage}% \hspace{5mm}bzS% \begin{minipage}[t]{60mm} \mbox{}\vspace{-15mm}\\ \input{Fig/checkbe4} \end{minipage}% \noindent \verb|Bezier("name",[A,B,C,D],[E,F,G,H,K,L] );| \begin{center} \input{Fig/checkbe7} \end{center} \noindent \verb|Bezier("1a",[A,B,C],[[D],[E,F]],["Num=3"]);| \begin{center} \input{Fig/checkbe5} \end{center} \noindent \verb|Bezier("d5e",[A,B,C],[[D],[E,F]],["Num=200","da"]);| \begin{center} \input{Fig/checkbe6} \end{center} \noindent \verb|Bezier("1",[A,B,C,D],[E,F,G,H,K,L],["Num=[2,3,4]"]);|\\ \begin{center} \input{Fig/checkbe8} \end{center} \end{cmd} %------------Beziersmooth-------------------------------- \begin{cmd}{Beziersmooth}{beziersmooth} \itemket{Usage}Beziersmooth(name, a list of nodes, options); \itemket{Description}Generic function to draw a smooth B\'ezier curve. \itemket{Details}Control points are added to keep smoothness. \itemket{Examples}\mbox{} \verb|Beziersmooth("1",[A,B,C,D]);| \begin{center} \input{Fig/checksm1} \end{center} \itemket{Remark}Control points are movable. \begin{center} \input{Fig/checksm2} \end{center} \end{cmd} %-----------Beziersym--------------------------------- \begin{cmd}{Beziersym}{beziersym} \itemket{Usage}Beziersym(name, a list of nodes, options); \itemket{Description}Generic function to draw a smooth B\'ezier curve. \itemket{Details}Control points are added to be symmetric with respect to each node. \itemket{Examples}\mbox{} \begin{center} \input{Fig/checksy1} \end{center} \itemket{Remark}Some control points are movable. \begin{center} \input{Fig/checksy2} \end{center} \end{cmd} %------------Mkbeziercrv-------------------------------- \begin{cmd}{Mkbeziercrv}{mkbeziercrv} \itemket{Usage}Mkbeziercrv(name, [nodes, control points], options) \itemket{Description}Draw some B\'ezier curves. \itemket{Details} In the case of a single B\'ezier curve, \verb|[ ]| outside the list can be omitted. \\ Mkbeziercrv(name, [nodes, control points], options) is same as Bezier(name, [nodes, control points], options). \\ \verb|Mkbeziercrv("n",[[A,B,C],[[D],[E,F]]])| is same as \verb|Bezier("n",[A,B,C],|\\ \verb|[[D],[E,F]])|. The name of the plotting data is "bz". \item[Example1]\mbox{} \verb|Mkbeziercrv("5",[[[A,B,C],[[D],[E,F]]],[[G,H,K,L],[[M],[N,O],[P]]]]);| \begin{center} \input{Fig/checkmc1} \end{center} \end{cmd} %---------Mkbezierptcrv----------------------------------- \begin{cmd}{Mkbezierptcrv}{mkbezierptcrv} \itemket{Usage}Mkbezierptcrv(a list of points, options) \itemket{Description}Draw a B\'ezier curve. \itemket{Details} Arrange the control points automatically. After that, move the nodes and the control points and correct the B\'ezier curve to what you want to draw. \\ In the case of multiple curves, \verb|[ ptlist1, ptlist2.... ]|\\ The name is automatically attached in order from A. \\ The options are as follows:\\ "Deg=...”\hspace{5mm}You can specify the degree (Default is 3rd order). \\ "Num=..."\hspace{5mm}You can specify the partition number ($\mathrm{the\ partition\ point\ number}-1$) for each section (Default is 10). \\ \item[Example]\mbox{} \verb|Mkbezierptcrv([A,B,C]);| \hspace{20mm}\input{Fig/checkb8} After that, move the nodes and the control points and correct the B\'ezier curve to what you want to draw. \\ \hspace{20mm}\input{Fig/checkb11} \verb|Mkbezierptcrv([A,B,C],["Deg=2"]);|\\ If Deg = 2, it is the B\'ezier curve of 2nd order. \\ One control point can be set for each section. \\ \hspace{20mm}\input{Fig/checkb9} In the case of multiple curves, \verb|[ ptlist1, ptlist2.... ]|\\ \verb|Mkbezierptcrv([[A,B,C],[D,E,F,G]]);|\\ \hspace{10mm}\input{Fig/checkb10} \end{cmd} %--------------Bspline------------------------------ \begin{cmd}{Bspline}{bspline} \itemket{Usage}Bspline(name ,list of control points, options) \itemket{Description}Draw second degree B-spline curve. \itemket{Details}Though not displayed, nodal points are calculated automatically. \itemket{Examples}\mbox{} \verb|Bspline("1",[A,B,C,D,E]);|($=$\verb|Bezier("1",[A,(B+C)/2,(C+D)/2,E],[B,C,D]);|)\\ The name becomes \verb|bzb1| instead of \verb|bz1|. Endpoints can be moved instead of control points. \begin{center} \input{Fig/checkbs1} \end{center} \verb|Bspline("1",[A,B,C,D,A]);|\\ The generated curve becomes closed when the first component of the list is the same as the last one. \begin{center} \input{Fig/checkbs2} \end{center} \end{cmd} %-------CRspline------------------------------------- \begin{cmd}{CRspline}{crspline} \itemket{Usage}CRspline(name, list of node points, options) \itemket{Description}Draw single Catmull-Rom spline curve. \itemket{Details} Only node points are free and control points cannot be moved.\\ Extra options is :\\ \verb|"size->"| specifies the thickness of line on the Euclidean view. \\ \itemket{Examples}\mbox{} \verb|CRspline("1",[A,B,C,D]);| \begin{center} \input{Fig/checkCR} \end{center} \end{cmd} %----------Ospline---------------------------------- \begin{cmd}{Ospline}{ospline} \itemket{Usage}Ospline(name, a list of control points, options); \itemket{Description}Generic function to draw a spline curve of Oshima. %\itemket{Details}If the beginning and end of the list are the same, it is a closed curve. \itemket{Examples} \mbox{} \verb| Ospline("1",[A,B,C,D,E]);| \\ \verb| Ospline("1",[A,B,C,D,A]);| \hspace{20mm} \input{Fig/ospline1} \hspace{10mm} \input{Fig/ospline2} \itemket{Reference} \hyperlink{bspline}{Bspline}. \end{cmd} %---------Circledata----------------------------------- \begin{cmd}{Circledata}{circledata} \itemket{Usage}Circledata(name, list, options) \itemket{Description}Draw a circle or polygon. \itemket{Details} The list consists of the central point and some point on the circle or the radius. It is also permitted that three points on the circle are given in the list. The name can be omitted when the central point and a point on the circle are given with the names of their geometric components.\\ Options :\\ \verb|"Rng=[|$\theta_1,\theta_2$\verb|]"| specifies the range of argument in which the circle is drawn.\\ \verb|"Num=number of division"| specifies the number of dividing points used to draw circle. When this number is small, the corresponding polygon is drawn. \itemket{Examples}\mbox{} The circle with center \verb|[0,0]| or A and radius 2 ( draw A by drawing tool) \verb| Circledata("1",[[0,0],[2,0]]);|(or \verb|[[0,0],2]|)\\ \verb| Circledata("1",[A,A+[2,0]]);|(or \verb|[A,2]|)\\ The circle with center A and radius AB \verb| Circledata([A,B]);|\\ The circle which passes through three points A, B, and C \verb| Circledata([A,B,C]);|\\ When we use \verb|Circledata([A,B,C])|, the central point of the circle can be drawn by the following command. \verb|Pointdata("1",[crABCcenter]);|\\ When we add options \verb|"dr,2"|, \verb|"da"|, \verb|"do"|, the following figures are generated respectively. \begin{center} \input{Fig/circledata1} \end{center} The circular arc with center A, radius AB, and the range of argument $\displaystyle \left[0,\frac{\pi}{3}\right]$ \verb|Circledata([A,B],["Rng=[0,pi/3]"]);|\\ The sector. Draw A, B , C by drawing tool. \verb| th=arctan2(B-A);| \\ \verb| C.xy=Rotatepoint(B,pi/3,A);|\\ \verb| Circledata([A,B],[Assign("Rng=[th,th+pi/3]","th",th)]);|\\ \verb| Listplot([B,A,C]);|\\ \verb| Letter([A,"s","A",B,"e","B",C,"nw","C"]);| \begin{center} \includegraphics[bb=0.00 0.00 180.01 177.01,width=4cm"] {Fig/circledata3.pdf}\hspace{12mm} \input{Fig/circledata2} \end{center} The circle with center A and radius AB, together with the inscribed equilateral hexagon (left figure) \verb| Circledata("1",[A,B]);|\\ \verb| Circledata("2",[A,B],["Num=6"]);|\\ The position of vertices can be changed via the option \verb|"Rng="|. (right figure) \verb| Circledata("2",[A,B],["Num=6","Rng=[pi/6,13/6*pi]"]);| \begin{center} \input{Fig/circledata4} \hspace{20mm}\input{Fig/circledata5} \end{center} \end{cmd} %-------------Mkcircles------------------------------- \begin{cmd}{Mkcircles}{mkcircles} \itemket{Usage}Mkcircles() \itemket{Description}Create plotting data of all geometric circles. \itemket{Details} All circles drawn by the "add circle" tool (any one of three types) in the Euclidean view are used as plotting data as they are. For example, if you create a circle with the center A and the point on the circumference as B, the plotting data \verb|crAB| is created. After that, if you change the identification name of point B (for example to Q) in the inspector of the Euclidean view, the geometric point name is also changed. Even if the circle has already been drawn, it can be changed. \\ \end{cmd} %---------Ellipseplot----------------------------------- \begin{cmd}{Ellipseplot}{ellipseplot} \itemket{Usage}Ellipseplot(name, [F1,F2,A/a], range, options) \itemket{Description}Generic function to draw ellipse. %\itemket{Details} \itemket{Examples}\mbox{} F1,F2 are focus points, A is a point on the ellipse, a is the length F1-A-F2.\\ Default of the range is [-5,5]. \itemket{Examples}\mbox{} \verb|Ellipseplot("1",[A,B,4]); | //sum of distance from Focus is 4.\\ \verb|Ellipseplot("1",[A,B,C],"[0,pi]");| //half of ellipse. \vspace{\baselineskip} Now draw tangent and normal. Draw figures by draw tool on Euclidean view. Put point D on tangent and E on normal. \verb| Ellipseplot("1",[A,B,C]);|\\ \verb| Lineplot([C,D]);|\\ \verb| Lineplot([C,E]);|\\ \verb| Arrowdata([A,C]);|\\ \verb| Arrowdata([C,B]);|\\ \verb| Anglemark([A,C,B]);|\\ \verb| Expr([A,"s2","F_1",B,"s2","F_2"]);| \begin{center} \includegraphics[bb=0 0 272.01 240.01, width=5cm]{Fig/ellipsecindy.pdf}\hspace{10mm} \input{Fig/ellipseplot1} \end{center} Now draw point D and E on ellipse. \verb| Ellipseplot("1",[A,B,C]);|\\ \verb| Listplot([A,C,B]);|\\ \verb| Listplot([A,D,B]);|\\ \verb| Listplot([A,E,B]);|\\ \verb| Expr([A,"s2","F_1",B,"s2","F_2"]);| \begin{center} \input{Fig/ellipseplot2} \end{center} \end{cmd} %----------Hyperbolaplot---------------------------------- \begin{cmd}{Hyperbolaplot}{hyperbolaplot} \itemket{Usage}Hyperbolaplot(name,[F1,F2,A], range, options) \itemket{Description}Generic function to draw a hyperbola. \itemket{Details}Option is as usual except "Asy=line style".This option is for drawing asymptotes. \itemket{Reference} \hyperlink{ellipseplot}{Ellipseplot} and \hyperlink{parabolaplot}{Parabolaplot}. \itemket{Examples}\mbox{} \verb|Hyperbolaplot("1",[A,B,C]);|\\ \verb|Hyperbolaplot("1",[A,B,2]);|\\ \verb|Hyperbolaplot("1",[A,B,C],["Asy=do"]);| \begin{center} \input{Fig/hyper1} \end{center} \end{cmd} %--------Parabolaplot------------------------------------ \begin{cmd}{Parabolaplot}{parabolaplot} \itemket{Usage}Parabolaplot(name, [A, B, C], range, options); \itemket{Description}Generic function to draws a parabola.% determined by the focus and the directrix indicated by the list [A, B, C] of points. \itemket{Details}A is the focus point, BC is the directrix. Default of the range is $[-5, 5]$. \itemket{Examples} \mbox{} \verb|Parabolaplot("1",[A,B,C]); | \verb|Parabolaplot("1",[A,B,C],"[-4,4]"); | //range is [-4,4] \verb|Parabolaplot("1",[[0,1],[-1,-1],[1,-1]]);| // coordinate \vspace{\baselineskip} Area enclosed by parabola and tangent \verb|Parabolaplot("1",[A,B,C]);|\\ \verb|Putoncurve("D","gr1para");|\\ \verb|Putoncurve("E","gr1para");|\\ \verb|Tangentplot("1","gr1para","x="+D.x);|\\ \verb|Tangentplot("2","gr1para","x="+E.x);|\\ \verb|pts=Intersectcurves("lntn1","lntn2");|\\ \verb|Listplot("1",[E,pts_1,D]);|\\ \verb|Hatchdata("1",["ii"],[["gr1para","s"],["sg1","n"]]);| \begin{center} \input{Fig/parabolaplotE} \end{center} \end{cmd} %-----------Ovaldata--------------------------------- \begin{cmd}{Ovaldata}{ovaldata} \itemket{Usage}Ovaldata(name, [A, B], options); \itemket{Description}Generic function to draw a rectangle with rounded corners. \itemket{Details}A is the center, B is a diagonal point. option : ratio of the roundness ( default is 0.2) . \itemket{Examples} \mbox{} \verb| Ovaldata("1", [A,B]);| \\ \verb| Ovaldata("2", [C,D],[0]);| \\ \verb| Ovaldata("3", [E,F],[1,"dr,3"]);| \\ \verb| Ovaldata("4", [G,H],[1.5,"da"]);| \begin{center} \input{Fig/ovaldata} \end{center} \end{cmd} %=========== Graph of function ============ \subsubsection{Graph of function} %--------Plotdata------------------------------------ \begin{cmd}{Plotdata}{plotdata} \itemket{Usage}Plotdata(name, function, variable and range, options) \itemket{Description}Generic function to draw the graph of function. \itemket{Details} Options : next options and usual options. \hspace{20mm} "Dis=real number": discontinuity \hspace{20mm} "Exc=list of real numbers": exclusion points \hspace{20mm} "Exc=function": exclude the zero points of the function \itemket{Examples}\mbox{} \verb| Plotdata("1","x^2-2*x","x");|\\ \hspace{20mm} \input{Fig/plotdata1}\\ Draw in red. \verb| Plotdata("1","x^2-2*x","x",["Color=[1,0,0]"]);|\\ \verb| Plotdata("3","2*sin(2*x-pi/4)","x=[0,2*pi]");|\\ \hspace{20mm} \input{Fig/plotdata2}\\ \verb| Plotdata("1","sin(x)","x",["do"]);|\\ \verb| Plotdata("2","sin(x)+1","x",["da"]);|\\ \verb| Plotdata("3","sin(x)+2","x",["dr,2"]);|\\ \verb| Plotdata("4","sin(x)+3","x");|\\ \hspace{20mm} \input{Fig/plotdata3}\\ Draw smoothly by "Num=n" option. Left figure: "Num=50"(default),\quad Right figure: "Num=200"\\ \hspace{20mm}\input{Fig/plotdata4}\\ Draw discontinuity accurately by "Dis" option. \verb| Plotdata("1","tan(x)","x",["Num=200"]); | // left figure \\ \verb| Plotdata("1","tan(x)","x",["Num=200","Dis=50"]); | // right figure \\ \hspace{20mm}\input{Fig/plotdatatan1}\hspace{20mm}\input{Fig/plotdatatan2} \vspace{\baselineskip} Draw floor function. \verb| Plotdata("1","floor(x)","x",["Num=100","Dis=0.9"]); |\\ \verb| Drwxy(); |\\ \verb| repeat(7,s,start -> -2, |\\ \verb| Pointdata(text(s+3),[s+1,s],["Inside=0","Size=3"]);|\\ \verb| ); | \vspace{\baselineskip} \hspace{40mm} \input{Fig/plotdata5}\\ Assign a value to the letter "b".\\ \verb| repeat(50,t,|\\ \verb| cb=t/5-5;|\\ \verb| Plotdata(text(t),Assign("b*x-b^2","b",cb),"x");|\\ \verb| );|\\ \hspace{40mm} \input{Fig/assign}\\ \end{cmd} %----------Implicitplot---------------------------------- \begin{cmd}{Implicitplot}{implicitplot} \itemket{Usage}Implicitplot(name,functionstring,range of x, range of y, options); \itemket{Usage}Generic function to draw the graph of a implicit function. \itemket{Examples}\mbox{} \verb| Implicitplot("1","x^2-x*y+2*y^2=4","x=[-3,3]","y=[-2,2]");| \begin{center} \input{Fig/implicit1} \end{center} \verb|Implicitplot("1","x^2+2*y^2=4","x=[-2,2]","y=[-2,2]");|\\ \verb|Hatchdata("1",["i"],[["imp1"]]);| \begin{center} \input{Fig/implicit} \end{center} \end{cmd} %-------Deqplot------------------------------------- \begin{cmd}{Deqplot}{deqplot} \itemket{Usage}Deqplot(name, expression, names of variations, options) \itemket{Description}Draw the solution curve of a differential equation. \itemket{Details} The differential equation and its initial conditions should be specified as arguments. \itemket{Examples}\mbox{} The solution curve of the equation $y"=-y$ with initial conditions $y(0)=1,y'(0)=0$ \verb|Deqplot("1","y``=-y","x",0, [1,0]);|\\ \begin{center} \input{Fig/deqplot1} \end{center} \itemket{Remark} Derivative symbol \verb|y`| is a backquate, not a single quote.\\ The solution curve of the equation $y'=y*(1-y)$ with initial condition $y(0)=0.5$ \verb|Deqplot("2","y`=y*(1-y)","x",0, 0.5,["Num=100"]);|\\ \begin{center} \input{Fig/deqplot2} \end{center} The solution curve of the equation $[x,y]'=[x(1-y),0.3y(x-1)]$ of variable $t$ with initial conditions $x(0)=1, y(0)=0.5$ \verb|Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",[1,0.5],["Num=200"]);|\\ \begin{center} \input{Fig/deqplot3} \end{center} \end{cmd} %----------Paramplot---------------------------------- \begin{cmd}{Paramplot}{paramplot} \itemket{Usage}Paramaplot(name, expression, variable and domain, options); \itemket{Description}Generic function to draw a curve of parametric representation.% The head of the plotting data is gp. %\itemket{Details} \itemket{Examples} \mbox{} Draw a cycloid curve. \verb| Paramplot("1","[t-sin(t),1-cos(t)]","t=[0,2*pi]");|\\ \begin{center} \input{Fig//paramplot1} \end{center} Draw ellipses with options.\\ \verb| Paramplot("1","[2*cos(t)-5,sin(t)]","t=[0,2*pi]");| \\ \verb| Paramplot("2","[2*cos(t),sin(t)]","t=[0,2*pi]",["dr,2"]);| \\ \verb| Paramplot("3","[2*cos(t)+5,sin(t)]","t=[0,2*pi]",["da"]);| \\ \verb| Paramplot("4","[2*cos(t)+10,sin(t)]","t=[0,2*pi]",["do"]);| \begin{center} \input{Fig//paramplot2} \end{center} \end{cmd} %----------Polarplot---------------------------------- \begin{cmd}{Polarplot}{polarplot} \itemket{Usage}Polarplot(name, expression, variable and domain, options); \itemket{Description}This function draws a curve of polar equation. %\itemket{Details} \itemket{Examples} To draw a cardioid. \verb| Polarplot("1","2*(1+cos(t))","t=[0,2*pi]",["Num=200"]);|\\ \begin{center} \input{Fig//cardioid1} \end{center} \end{cmd} %------Periodfun-------------------------------------- \begin{cmd}{Periodfun}{periodfun} \itemket{Usage}Periodfun(defL,repeat,options) \itemket{Description}Function to draw the graph of a periodic function. \itemket{Details} \verb|defL| is a list of fun(str),interval,division number.\\ The options are "Con=n/do, Color=name" for discontinuous parts. ex. "Con=do,Color=red" , " Con=n". Default is broken line and draw. Repeat count is a count number or a list of count numbers of left side and right side. The return value are a list of function in Maxima format and the period. \itemket{Remark}The functions should be defined on the symmetrical interval [-a,a]. \itemket{Examples} \mbox{} \verb| defL=["0",[-1,0],1,"1",[0,1],1];|\\ \verb| Periodfun(defL, 2,["dr,2"]);|\\ \verb| memori=apply(-5..5,x,[x,text(x)]);|\\ \verb| memori=flatten(remove(memori,[[0,"0"]]));|\\ \verb| Htickmark(memori);|\\ \verb| Vtickmark([1,"1"]);| \hspace{20mm}\input{Fig/periodfun.tex} \vspace{\baselineskip} \verb| defL=["0",[-1,0],1,"x^2",[0,1],50];|\\ \verb| Periodfun(defL, 2, ["Con=n","dr,2"]);|\\ \verb| memori=apply(-5..5,x,[x,text(x)]);|\\ \verb| memori=flatten(remove(memori,[[0,"0"]]));|\\ \verb| Htickmark(memori);|\\ \verb| Vtickmark([1,"1"]);| \hspace{20mm}\input{Fig/periodfun2.tex} \end{cmd} %--------Fourierseries------------------------------------ \begin{cmd}{Fourierseries}{fourierseries} \itemket{Usage}Fourierseries(name,coeff,period,terms) \itemket{Description}Function to draw the graph of a fourier series. \itemket{Details} $a_0+\displaystyle{\sum _{n=1} ^{\infty}(a_n \cos nx + b_n \sin nx)}$ \verb|coeff| is a list of [$a_0, a_n, b_n$]. Each element are string.\\ \verb|term| is a number of terms. \itemket{Examples} \mbox{} \verb|Fourierseries("1",["1/2","0","(1-(-1)^n)/(pi*n)"],2,6,["Num=200"]);| \hspace{20mm}\input{Fig/fourierseries.tex} \end{cmd} %-----------Tangentplot--------------------------------- \begin{cmd}{Tangentplot}{tangentplot} \itemket{Usage}Tangentplot(name,PD, pointinfo, options); \itemket{Description}Generic funtion to draw a tangent line of a plotting data. \itemket{Details} The pointinfo is one of "x=xvalue","y=yvalue", [point, parameter].\\ The option "nth" is used to set the number when plotting data has multi intersects. \itemket{Examples}\mbox{} \verb|Plotdata(`"1","x^2","x")|\\ \verb|Tangentplot("1","gr1","x=2");|\\ \verb|Tangentplot("2","gr1","y=1",["Color=red"]);|\\ \verb|Tangentplot("3","gr1","y=1",[2,"Color=blue"])|\\ \begin{center} \input{Fig/tangent} \end{center} \itemket{Reference} \hyperlink{derivative}{Derivative}. \end{cmd} %==========- Letter ================= \subsubsection{Letter} %-----------Letter--------------------------------- \begin{cmd}{Letter}{letter} \itemket{Usage}Letter([position, direction, string],options) \itemket{Description}Display the string. \itemket{Details} Write the string at the position specified by position (or coordinates) and direction. \\ The position (or coordinates) can also be specified by the geometric point name. \\ The direction is "e", "w", "n", "s", "c". The distance from the specified position can also be given as a numerical value. For example, "e2" and "e3" are placed twice and three times of the slightly unit distance away from "e", respectively. \\ Multiple strings can be passed in the form of a list. \\ \itemket{Remark}\mbox{} The derivative symbol $'$ uses \$ $'$ \$ (single quart) in mathematical mode (interleaved with two \$ s). Option is size of font. For example, ["size=32"] \item[Example]\mbox{} \verb|Letter([[2,1] ,"se","P"]); | // Display P in the southeast of the coordinates (2, 1). \\ \verb|Letter([C ,"c", "C"]); | // Display C with the point C as the center. \\ \verb|Letter([A,"sw","A",E,"s","$ f(x)=\frac{1}{4} x^2 $"]);| \hspace{5mm} //Display A in the southwest of point A and $ f(x)=\frac{1}{4} x^2 $ in the south of the point E. \\ \end{cmd} %-------Letterrot------------------------------------- \begin{cmd}{Letterrot}{letterrot} \itemket{Usage}Letterrot([pos, dir, move, string]) \itemket{Description}Rotate a string and display it. \itemket{Details} At the position of the coordinates, rotate to the direction specified by the direction vector and write the string.\\ The third argument is a minute movement amount and can be abbreviated.\\ \item[Example]\mbox{} \hspace{10mm}\verb|Letterrot(C,B-A,"t2n5","AB");| It is also possible to write as follows, abbreviated for the amount of movement. \hspace{10mm}\verb|Letterrot(C,B-A,"AB");| \itemket{Reference} \hyperlink{exprrot}{Exprrot}. \end{cmd} %--------Expr ------------------------------------ \begin{cmd}{Expr}{expr} \itemket{Usage}Expr([pos, dir, string]); \itemket{Description}Generic function to write an expression in \TeX style. \itemket{Details}pos : position \hspace{14mm} dir : direction(e,w,s,n,ne,nw,se,sw,c) \hspace{14mm} string : expression\\ \hspace{14mm}Also see \hyperlink{letter}{Letter} \itemket{Examples}\mbox{} \verb|Expr([[-3,3],"e","f(x)=\frac{1}{4}x^2"]);|\\ \verb|Expr([[3,1.5],"s2e2","f‘(x)=\frac{1}{2}x",[2,0],"s","2",[0,1],"w","1"]);| \begin{center} \input{Fig/expr} \end{center} \verb|Arrowdata(Q,P);|\\ \verb|Expr([Q,"ne2","\displaystyle\int_a^b \log x\,dx="|\\ \verb| +text(L.x*(log(L.x)-1)-G.x*(log(G.x)-1))]);| \vspace{5mm} \begin{center} \input{Fig/intlog} \end{center} \end{cmd} %------ Exprrot ------------------------------------- \begin{cmd}{Exprrot}{exprrot} \itemket{Usage}Exprrot([pos, dir,[move(optional)], string); \itemket{Description}Generic function to write a rotated expression in \TeX style. \itemket{Details}pos : position : coordinate or name \hspace{15mm} dir : direction vector : coordinate or name \hspace{15mm} move: "t":tangent , "n":normal \hspace{15mm} string : expression \itemket{Examples}\mbox{} \verb|Exprrot(C,B-A,"\frac{2}{3}");|\\ \verb|Exprrot([3,2],[2,-1],"t0n1","\sqrt{3}");| \vspace{\baselineskip} \vspace{\baselineskip} \hspace{10mm}\includegraphics[bb=0.00 0.00 181.01 131.01,width=4cm]{Fig/exprrot.pdf} \hspace{10mm} \input{Fig/exprrot} \end{cmd} %============== Marking ================ \subsubsection{Marking} %------------Anglemark-------------------------------- \begin{cmd}{Anglemark}{anglemark} \itemket{Usage}Anglemark( a list of points, options); \itemket{Description}draw an angle mark with an arc at the angle determined by [A,B,C] \hspace{10mm} Options : \hspace{15mm} numerical value size of mark (default is 1) \hspace{15mm} draw text \verb|"Expr=n,str"| or \verb|"Let=n,str"| \itemket{Examples}\mbox{} draw an angle mark at interior angles of a triangle, write characters.\\ \verb| Listplot([A,B,C,A]);|\\ \verb| Letter([A,"n1","A",B,"w1","B",C,"e1","C"]);|\\ \verb| Anglemark([B,A,C]);|\\ \verb| Anglemark([C,B,A],["Expr=\theta"]);|\\ \verb| Anglemark([A,C,B],[2,"dr,3","Expr=2,\alpha"]);|\\ \begin{center} \input{Fig/anglemark} \end{center} draw $\circ$ at interior angles of a triangle.\\ \verb| Listplot([A,B,C,A]);|\\ \verb| Letter([A,"n1","A",B,"w1","B",C,"e1","C"]);|\\ \verb| Anglemark([C,B,A],["Expr=\circ","nodisp"]);|\\ \begin{center} \input{Fig/anglemark2} \end{center} \item{Remark} You can draw an angle mark with a parallelogram. Refer to \hyperlink{paramark}{Paramark} . \end{cmd} %--------Paramark------------------------------------ \begin{cmd}{Paramark}{paramark} \itemket{Usage}Paramark([A, B, C], options); \itemket{Description}Generic function to draw an angle mark with a parallelogram at the angle determined by [A,B,C].\\ Options : numerical value size of mark (default is 1) and usual options. \itemket{Examples} Draw an angle mark at interior angles of a triangle, write characters.\\%\mbox{} \verb| Listplot([A,B,C,A]);| \\ \verb| Paramark([A,B,C]); |\\ \verb| Paramark([C,A,B],[3,"Expr=\alpha"]); |\\ \verb| Paramark([B,C,A],["dr,2","Expr=2,\theta"]);| \\ \begin{center} \input{Fig/paramark} \end{center} \itemket{Reference} \hyperlink{anglemark}{Anglemark}. \end{cmd} %------------Bowdata-------------------------------- \begin{cmd}{Bowdata}{bowdata} \itemket{Usage}Bowdata(a list of points, options); \itemket{Description}draw the shape of bow connecting two points in the list counterclockwise \itemket{Details} Options :\\ curvature (default is 1)\\ size of the blank space in the middle of bow\\ expression located at the blank space \verb|"Expr=expressions"|\\ The location of expressions can be modified via \verb|"Expr=tn, expressions"| where \verb|t| specifies the movement in the direction of segment and \verb|n| specifies that of normal direction. Both positive and negative numbers are permitted.\\ line type \verb|"dr,n" , "da,m,n" , "do,m,n"| \itemket{Examples}\mbox{} draw the shapes of bow along with the edges of triangle ABC and add marks.\\ \verb| Listplot([A,B,C,A]);|\\ \verb| Letter([A,"n1","A",B,"w1","B",C,"e1","C"]);|\\ \verb| Bowdata([A,B]);|\\ \verb| Bowdata([B,C],[1,"Expr=t0n3,a"]);|\\ \verb| Bowdata([C,A],[2,1.2,"Expr=10","da"]);| \begin{center} \input{Fig/bowdata} \end{center} Expressions can be displayed in rotated manner via \verb|"Exprrot=tn,expressions"| though the Euclidean view does not correspond to this modification. Adding \verb|r| to \verb|tn| results in the turning round. \itemket{Examples}\mbox{} \verb| Bowdata([B,A],[1,1,"Exprrot=a"]);|\\ \verb| Bowdata([D,C],[1,1,"Exprrot=t3n0,a"]);|\\ \verb| Bowdata([F,E],[1,1,"Exprrot=t-3n0,a"]);|\\ \verb| Bowdata([H,G],[1,1,"Exprrot=t0n3,a"]);|\\ \verb| Bowdata([L,K],[1,1,"Exprrot=t0n0r,a"]);|\\ \verb| Bowdata([N,M],[1,1,"Exprrot=t3n0r,a"]);| \begin{center} \input{Fig/bowdata2} \end{center} \end{cmd} %------Drawsegmark-------------------------------------- \begin{cmd}{Drawsegmark}{drawsegmark} \itemket{Usage}Drawsegmark(name, list, options) or Segmark(name, list, options) \itemket{Description}Add a mark to a segment. \itemket{Details} Add a mark to the segment determined by the end points specified in the list. Four kinds of marks can be used.\\ Extra options :\\ \verb|"Type=n"| (n=1,2,3,4) specifies the kind of mark.\\ \verb|"Width="| specifies the distance between two segments of the mark (in case when $n=2$). \itemket{Examples}\mbox{} \verb|Listplot([A,B,C,D,A]);|\\ \verb|Segmark("1",[A,B],["Type=1"]);|\\ \verb|Segmark("2",[B,C],["Type=2","Width=1.5"]);| //width of two lines\\ \verb|Segmark("3",[C,D],["Type=3"]);|\\ \verb|Segmark("4",[D,A],["Type=4"]);| \begin{center} \input{Fig/segmark} \end{center} \end{cmd} %--------Htickmark------------------------------------ \begin{cmd}{Htickmark}{htickmark} \itemket{Usage}Htickmark([x-coord,[direction(optional)],expression,...]); \itemket{Description}Generic function to tick on the horizontal axis. \itemket{Details}Default of direction is \verb|"s1"|. Minor adjustments are not displayed on the Euclidean view, you have to check the results on the PDF file. The length of tickmarks can be set by the function \hyperlink{setmarklen}{Setmarklen()}. \itemket{Examples}\mbox{} \verb|Htickmark([1,"1",2,"n1","2",3,"se","3",4,"4"]);| \begin{center} \input{Fig/htickmark01} \end{center} \verb|ticks=apply(-5..5,x,[x,text(x)]);| // ticks is [ [-5,"5"],...,[5,"5"] ]\\ \verb|ticks=remove(ticks,[[0,"0"]]); | // [0,"0"] is removed\\ \verb|ticks=flatten(ticks); | // ticks becomes [-5,"5",...,5,"5"]\\ \verb|Htickmark(ticks);| \begin{center} \input{Fig/htickmark} \end{center} \itemket{Reference} \hyperlink{vtickmark}{Vtickmark}. \end{cmd} %------------Vtickmark-------------------------------- \begin{cmd}{Vtickmark}{vtickmark} \itemket{Usage}Vtickmark([y-coord,[direction(optional)],expression,...]); \itemket{Description}Generic function to tick on the vertical axis. \itemket{Details}Default of direction is \verb|"w1"|. \itemket{Examples}\mbox{} \verb|Vtickmark([1,"1",2,"2"]);| \itemket{Reference} \hyperlink{htickmark}{Htickmark}. \end{cmd} %--------------Rulerscale------------------------------ \begin{cmd}{Rulerscale}{rulerscale} \itemket{Usage}Rulerscale(starting point, horizontal marks, vertical marks); \itemket{Description}Generic functio to put ruler marks. \itemket{Details} The marks are give as a list.\\ \verb|["r",a,b,c,d]| to put marks from \verb|a| to \verb|b| with intervals \verb|c|, scales \verb|d|.\\ \verb|["f",n1,"str",n2,"str",・・] | to put marks as the same format as Htickmark. \itemket{Examples1}\mbox{} \verb|Listplot("1",[[2,1],[9,1]]);|\\ \verb|Rulerscale([2,1],["r",2,9,1,10],[]);| \begin{center}\input{Fig/ruler1}\end{center} \itemket{Examples2}\mbox{} \verb|Framedata("1",[A,B],["corner"]);|\\ \verb|Rulerscale(A,["r",0,5,1],["f",1,"d1",3,"d2"]);| \begin{center}\input{Fig/ruler}\end{center} \end{cmd} %========== Using plotting data =============== \subsection{Using plotting data} %--------------Changestyle------------------------------ \begin{cmd}{Changestyle}{changestyle} \itemket{Usage}Changestyle(list of PD, options) \itemket{Description}Change the option for drawing. \itemket{Details} Change the option for drawing several shapes altogether. \itemket{Examples}\mbox{} Draw segment AB and Circle AB with broken line on the Euclidean view and keep them from being drawn on \TeX\ final output. \verb| Listplot([A,B]);|\\ \verb| Circledata([A,B]);|\\ \verb| Changestyle(["sgAB","crAB"],["da","notex"]);| \end{cmd} %--------Drawfigures ------------------------------------ \begin{cmd}{Drawfigures}{drawfigures} \itemket{Usage}Drawfigures(or Drwfigs)(name,List of PDs,List of Options) \itemket{Description}Manipulate a plural number of PDs together. \itemket{Remark} List of Options should corrensponds to that of PDs. %\itemket{Details} \itemket{Examples}\mbox{} After manipulating PDs of a circle and a point on the circle by AddGraph, you can translate or rotate them together.\\ \begin{verbatim} opcr=["dr"]; oppt=["Size=2","Color=red"]; Circledata("1",[[0,1],[0,0]],opcr); Pointdata("1",[0,0],oppt); ad1=["cr1","pt1"]; dt=2*pi/32; opcr=["dr,0.3"]; nn=32; forall(1..nn, t=dt*#; Rotatedata(2,ad1,-t,[[0,1],"nodisp"]); Translatedata(2,"rt2",[t,0],["nodisp"]); Drawfigures(text(#),["tr2_1","tr2_2"],[opcr,oppt]); ); \end{verbatim} \begin{center} \input{Fig/drawfigures1} \end{center} \end{cmd} %------------Invert-------------------------------- \begin{cmd}{Invert}{invert} \itemket{Usage}Invert(PD) \itemket{Description}Rearrange plotting data in the reverse order. \itemket{Examples}\mbox{} See the examples in \hyperlink{shade}{Shade} \end{cmd} %-------------Joincrvs------------------------------- \begin{cmd}{Joincrvs}{joincrvs} \itemket{Usage}Joincrvs(name, list of PDs, options) \itemket{Description}Create a plotting data of one curve by connecting a list of plotting data of adjacent curves. \itemket{Details} The list of curves is specified in the adjacent order. \\ Options is line type. \itemket{Examples}\mbox{} Draw the closed curve obtained from the line segment $y=x\ (-\sqrt{2} \leq x \leq \sqrt{2})$ and the half circle, and paint the interior of the closed curve using the yellow color.\\ Put the point A at the origin and the point B in the appropriate place.\\ \verb|Plotdata("1","x","x=[-sqrt(2),sqrt(2)]");|\\ \verb|B.xy=[sqrt(2),sqrt(2)];|\\ \verb|Circledata("2",[A,B],["Rng=[pi/4,pi/4*5]"]);|\\ \verb|Joincrvs("1",["gr1","cr2"]);|\\ \verb|Shade(["join1"],["Color=yellow"]);|\\ \begin{center} \input{Fig/joincrvs.tex} \end{center} \end{cmd} %--------Partcrv------------------------------------ \begin{cmd}{Partcrv}{partcrv} \itemket{Usage}Partcrv(name, A, B, PD, options) \itemket{Description}Generic function to make a piece of curve from the PD between the points A and B. \itemket{Details}The order of two points A, B must be same as the direction of the curve.\\ Options are "dr, n", "da,m,n" or "do,m,n"\\ \itemket{Examples}\mbox{} In the following example We draw a parabola with dotted line and draw a piece of curve with real line.\\ \verb| Plotdata("1","x^2","x",["do"]);|\\ \verb| Partcrv("1", [0,0], [1,1], "gr1");| \begin{center} \input{Fig/partcrv1} \end{center} In the next example we draw a piece of circle with real line. The direction of a circle is counterclockwise direction.\\ \verb| Circledata([A,B], ["do"]);|\\ \verb| Plotdata("1","x^2","x",["do"]);|\\ \verb| tmp=Intersectcrvs("crAB","gr1");|\\ \verb| P.xy=tmp_1;|\\ \verb| Q.xy=tmp_2;|\\ \verb| Partcrv("1", P, Q, "crAB");|\\ \verb| Partcrv("2", Q, P, "crAB");| \vspace{5mm} \begin{center} \begin{minipage}{45mm} \begin{center} \input{Fig/partcrv3}\\ figure of part1 \end{center} \end{minipage} \hspace{10mm} \begin{minipage}{45mm} \begin{center} \input{Fig/partcrv4}\\ figure of part2 \end{center} \end{minipage} \end{center} In the last example we draw the pice of parabola:$y=x^2$ which is cut off by the circle.\\ \verb| Circledata("1",[[0,2],[0,0]],["da"]);|\\ \verb| Plotdata("1","x^2","x",["do"]);|\\ \verb| tmp=Intersectcrvs("cr1","gr1");|\\ \verb| Partcrv("2",tmp_2,tmp_1,"gr1",["dr,2"]);| \begin{center} \input{Fig/partcrv} \end{center} \end{cmd} %-------- Enclosing ------------------------------------ \begin{cmd}{Enclosing}{enclosing} \item[Usage]Enclosing(name, a list of plotdata, options); \item[Description]This function makes a closed curve form the list of plotdata. \item[Details]Options are:\\ near point from start position : Set in case where the first curve and the last curve have multi intersects.\\ \verb|"dr","da", "do","`notex","nodisp","Color= "| : as usual. \item[Examples]\mbox{} \verb|Plotdata("1","x^2","x");|\\ \verb|Lineplot("1",[[0,0],[1,0]]);|\\ \verb|Lineplot("2",[[2,0],[2,1]]);|\\ \verb|Enclosing("1",["Invert(gr1)","ln1","ln2"],["nodisp"]);|\\ \verb|Shade(["en1"],["Color=red"]);| \begin{center} \input{Fig/enclosing} \end{center} \item{Remark}The followings have the opposite direction. \verb|Enclosing("1",["ln1","ln2","Invert(gr1)"]);|\\ \verb|Enclosing("1",["gr1","Invert(ln2)","Invert(ln1)"]);| \end{cmd} %---------Hatchdata----------------------------------- \begin{cmd}{Hatchdata}{hatchdata} \itemket{Usage}Hatchdata(name, a list of "i" or "o" , a list of a list of PD , options) \itemket{Description}Generic function to draw hatch lines in the close curve. \itemket{Details}Options are:\\ \hspace*{5mm}angle(degree,45), interval(ratio,1) of hatches, \\ \hspace*{5mm}\verb|"Max=(default:20)"| maximum of the number of hatches.\\ \hspace*{5mm}\verb|"No=pointlist"| not executed when any point is selected\\ \hspace*{5mm}\verb|"File=y/m/n(default:n)"| whether to make data file or not\\ \hspace*{5mm}\verb|"Check=pointlist"| data file updated if any point is changed \itemket{Examples}\mbox{} \verb|Circledata([A,B],["dr"]);|\\ \verb|Hatchdata("1",["i"],[["crAB"]],["dr,0.7"]);| \verb|Circledata([A,B],["dr"]);|\\ \verb|Paramplot("1","[4*cos(t),2*sin(t)]","t=[0,2*pi]");|\\ \verb|Paramplot("2","[2*cos(t),4*sin(t)]","t=[0,2*pi]");|\\ \verb|Hatchdata("1",["ioi"],[["crAB"],["gp1"],["gp2"]],["dr,0.7"]);|\\ \verb|Hatchdata("2",["iio"],[["crAB"],["gp1"],["gp2"]],["dr,0.7"]);| \begin{center} \input{Fig/hatch1}\hspace{10mm}\input{Fig/hatch2} \end{center} \verb|Plotdata("1","2*sin(x)","x=[-pi,3*pi]",["Num=100"]);|\\ \verb|Listplot([A,B]);|\\ \verb|Listplot([A,C]);|\\ \verb|Hatchdata("1",["ii"],[["sgAB","n"],["gr1","s"]],["dr,0.7"]);|\\ \verb|Hatchdata("2",["ii"],[["sgAC","s"],["gr1","n"]],["dr,0.7"]);| \begin{center} \input{Fig/hatch3} \end{center} \verb|Plotdata("1","2*sin(x)","x=[-pi,3*pi]",["Num=100"]);|\\ \verb|Listplot([A,B]);|\\ \verb|Listplot([A,C]);|\\ \verb|Hatchdata("1",["iio"],[["sgAB","s"],["sgAC","n"],["gr1","n"]]);| \begin{center} \input{Fig/hatch4} \end{center} \verb|Deffun("f(x)",["regional(y)","y=x^3-2*x","y"]);|\\ \verb|Plotdata("1","f(x)","x",["Num=100"]);|\\ \verb|Putoncurve("A","gr1");|\\ \verb|coef=Derivative("f(x)","x",A.x);|\\ \verb|Defvar(["coef",coef]);|\\ \verb|Deffun("g(x)",["regional(y)","y=coef*(x-A.x)+A.y","y"]);|\\ \verb|Plotdata("2","g(x)","x",["Num=1"]);|\\ \verb|if(!Ptselected(), // if any point is not selected|\\ \verb| Enclosing("1",["gr2","Invert(gr1)"],[A,"nodisp"]);|\\ \verb| Hatchdata("1",["i"],[["en1"]]);|\\ \verb|);| \begin{center} \input{Fig/hatch5} \end{center} \verb|Circledata([A,B]);|\\ \verb|Hatchdata("1",["i"],[["crAB"]]);|\\ \verb|Hatchdata("2",["i"],[["crAB"]],[-40,2]);|// $\mbox{angle}=-40^{\circ}, \mbox{interval}=\times 2$|\\ \verb|Hatchdata("3",["i"],[["crAB"]],["dr,0.5"]);|\\ \verb|Hatchdata("4",["i"],[["crAB"]],[-45,2,"dr,0.5"]);| \begin{center} \input{Fig/HatchZuKita1.tex} \end{center} \verb|Lineplot("1",[A,B]);// name of this data is ln1|\\ \verb|Lineplot("2",[A,C]);|\\ \verb|Hatchdata("5",["iii"],[["crAB"],["ln1","n"],["ln2","n"]]);|\\ \verb|Hatchdata("6",["ioo"],[["crAB"],["ln1","n"],["ln2","n"]]);| \begin{center} \input{Fig/HatchZuKita5E.tex}\hspace{10mm}\input{Fig/HatchZuKita6E.tex} \end{center} \verb|Circledata([A,B],["nodisp"]);|\\ \verb|Hatchdata("7",["i"],[["crAB"]]);|\\ \verb|Circledata([A,B],["da"]);|\\ \verb|Hatchdata("8",["i"],[["crAB"]]);| \begin{center} \input{Fig/HatchZuKita7E.tex}\hspace{10mm}\input{Fig/HatchZuKita8.tex} \end{center} %\verb|Hatchdata("9a",["iii"],[["crAB"],["ln1","n"],["ln2","n"]]);|\\ %\verb|Hatchdata("9b",["ioo"],[["crAB"],["ln1","n"],["ln2","n"]],[90,2]);| \end{cmd} %---------Dotfilldata----------------------------------- \begin{cmd}{Dotfilldata}{dotfilldata} \itemket{Usage}Dotfilldata(name, list of the dotted sides "i" or "o", list of PD, option) \itemket{Description}Fill a domain with dots. \itemket{Details} R is called to generate the data. Arguments are the same as Hatchdata. \\ Option is the density of dots from 0.1 to 0.8 (default is 0.3). \itemket{Examples}\mbox{} A pie chart\\ After making closed curve via \verb|Partcrv()| and \verb|Enclosing()|, the surrounded region is filled with dots. \verb| r=3;|\\ \verb| p0=r*[cos(pi/2),sin(pi/2)];|\\ \verb| p1=r*[cos(-pi/6),sin(-pi/6)];|\\ \verb| p2=r*[cos(-3*pi/4),sin(-3*pi/4)];|\\ \verb| Circledata("1",[[0,0],[r,0]]);|\\ \verb| Listplot("1",[[0,0],p0]);|\\ \verb| Listplot("2",[[0,0],p1]);|\\ \verb| Listplot("3",[[0,0],p2]);|\\ \verb| Partcrv("1",p1,p0,"cr1");|\\ \verb| Enclosing("1",["sg2","part1","Invert(sg1)"],[[0,0]]);|\\ \verb| Partcrv("2",p2,p1,"cr1");|\\ \verb| Enclosing("2",["sg3","part2","Invert(sg2)"],[[0,0]]);|\\ \verb| Dotfilldata("1",["i"],[["en1"]]);|\\ \verb| Dotfilldata("2",["i"],[["en2"]],[0.1]);| \begin{center} \input{Fig/dotfill} \end{center} \end{cmd} %-----------Shade--------------------------------- \begin{cmd}{Shade}{shade} \itemket{Usage}Shade(("name"),list of PD, options); \itemket{Description}This function fills a domain surrounded by a closed curve. \itemket{Details}Options are as follows. () means the default.\\ \begin{itemize} \item Starting point. The defaults are the intersect of the first curve and the last one. \item "Color=" \item "Enc=n(y)"\ \ Whether \verb|Enclosing| is used. \item "Trim=n(y)"\ \ Whether it is trimmed in the window. \item "First=y(n)"\\ \hspace*{5mm}Whether \verb|Shade| is placed at the top in \TeX. The default is just before Gdata. \end{itemize} \itemket{Examples}\mbox{}\\ \verb|Setax([7,"nw"]);|\\ \verb|Plotdata("1","2*sin(x)","x",["Num=100"]);|\\ \verb|Lineplot("1",[[0,1],[1,1]]);|\\ \verb|Shade(["ln1","Invert(gr1)"],[[2.5,1],"Color=0.2*[0,0,0,1]"]);| \begin{center} \input{Fig/shade} \end{center} \verb|Plotdata("1","x^2-1","x=[-3,3]");|\\ \verb|Plotdata("2","x^2/2","x=[-3,3]");|\\ \verb|Shade("1",["gr2","Invert(gr1)"],[[-1.5,1],"Color=[1,0,0]","alpha->0.4"]);| \begin{center} \input{Fig/shade01E} \end{center} \verb|r1=2;|\\ \verb|r2=1.5;|\\ \verb|Circledata("1",[A,A+[r1,0]]);|\\ \verb|Circledata("2",[A,A+[r2,0]]);|\\ \verb|Listplot("1",[A+[r1,0],A+[r2,0]],["nodisp"]);|\\ \verb|Shade(["cr1","sg1","Invert(cr2)","Invert(sg1)"],["Enc=n","Color=green"]);| \begin{center} \input{Fig/greenring} \end{center} \itemket{Reference} \hyperlink{joincrvs}{Joincrvs}. \end{cmd} %--------------Reflectdata------------------------------ \begin{cmd}{Reflectdata}{reflectdata} \itemket{Usage}Reflectdata(name, PD, center or axis of symmetry, options); \itemket{Description}Generic function to draw a reflective curve. \itemket{Details}axis of symmzetry is defined as a list of 2 points. \itemket{Examples}\mbox{} \verb|Circledata([A,B]);|\\ \verb|Reflectdata("1","crAB",[C]);|\\ \verb|Reflectdata("2","crAB",[[-1,2]],["dr,2"]);|\\ \verb|Reflectdata("3","crAB",[D,E],["da"]);| \begin{center} \input{Fig/reflectdata} \end{center} \end{cmd} %------------Rotatedata-------------------------------- \begin{cmd}{Rotatedata}{rotatedata} \itemket{Usage}Rotatedata(name, (a list of )PD, angle(degree), options); \itemket{Description}Generic function to rotate plotting data. \itemket{Details}Options are center, and as usual. The default of center is [0,0].\\ \itemket{Examples}\mbox{} \verb|Circledata([A,B]);|\\ \verb|Rotatedata("1","crAB",pi/2,[C]);|\\ \verb|Rotatedata("2","crAB",pi/3,[[1,5],"dr,2"]);|\\ \verb|Rotatedata("3","crAB",-pi/3,[D,"da"]);| \begin{center} \input{Fig/rotatedata} \end{center} \end{cmd} %---------Scaledata----------------------------------- \begin{cmd}{Scaledata}{scaledata} \itemket{Usage}Scaledata(name, list of PD, horizontal ratio, vertical ration, [options]); \itemket{Description}Generic function to scale plotting data. \itemket{Details}Options are Center, and as usual. The default of center is [0,0].\\ \itemket{Examples}\mbox{} \verb|Circledata([A,B]);|\\ \verb|Scaledata("1","crAB",3,2,[[0,0]]);|\\ \verb|Scaledata("2","crAB",3,2,[C,"dr,2"]);|\\ \verb|Scaledata("3","crAB",D.x,D.y,[[0,0],"da"]);| \begin{center} \input{Fig/scaledata} \end{center} \end{cmd} %------------Translatedata-------------------------------- \begin{cmd}{Translatedata}{translatedata} \itemket{Usage}Translatedata(name, list of PD, vector, options); \itemket{Description}Generic function to translate plotting data. \itemket{Details}Options are Center, and as usual. The default of center is [0,0].\\ \itemket{Examples}\mbox{} \verb|Circledata([A,B]);|\\ \verb|Translatedata("1","crAB",[2,3]);|\\ \verb|Translatedata("2","crAB",C,["dr,2"]);|\\ \verb|Translatedata("3","crAB",D,["da"]);| \begin{center} \input{Fig/translatedata} \end{center} \end{cmd} %=====Calculus and I/O ============================ \subsection{Calculus and I/O} %-------Derivative------------------------------------- \begin{cmd}{Derivative}{derivative} \itemket{Usage}\mbox{}\\ Derivative(function(string), variable(string), value);\\ Derivative(PD(string), pointinfo, ([nth of intersects])); \itemket{Description}Generic funtion to find the derivative of a function or a plotting data. \itemket{Details} The pointinfo is one of "x=xvalue","y=yvalue", [point, parameter].\\ The option of nth is used to set the number when plotting data has multi intersects. \itemket{Examples}\mbox{} \verb|Deffun("f(x)",["regional(y)","y=x^3-4*x","y"]);|\\ \verb|coef=Derivative("f(x)","x",A.x);|\\ \verb|A.y=f(A.x);|\\ \verb|B.y=coef*(B.x-A.x)+A.y;|\\ \verb|Plotdata("1","f(x)","x",["Num=200"]);|\\ \verb|Lineplot([A,B]);|\\ \verb|Letter([A,"ne","A"]);| \begin{center} \input{Fig/derivative} \end{center} \itemket{Reference} \hyperlink{tangentplot}{Tangentplot}. \end{cmd} %---------Integrate----------------------------------- \begin{cmd}{Integrate}{integrate} \itemket{Usage}\mbox{}\\ Integrate(function or name of PD, "varname=range", [options]); \itemket{Description}Generic funtion to find the value of numerical integration. \itemket{Details}Oshima's Bezier formula is used. \itemket{Examples}\mbox{} \verb|f(x):=x^3-2*x^2+2;|\\ \verb|val=Integrate("f(x)","x=[0,3]");|\\ \verb|println(val);| // 8.25 will be displyed. \verb|plotting data("1","x^3-2*x^2+2","x");|\\ \verb|println(Integrate("gr1",[0,3]));| \end{cmd} %------------Inversefun-------------------------------- \begin{cmd}{Inversefun}{inversefun} \itemket{Usage}Inversefun(function(string), range, value); \itemket{Description}Generic function to find the value of the inversefunction. \itemket{Details}The value is found in the range. \itemket{Examples}\mbox{} \verb|x=Inversefun("sin(x)","x=[0,pi/2]",0.5);|\\ \hspace*{20mm}The value of x is $0.5236$. \end{cmd} %------------Crossprod-------------------------------- \begin{cmd}{Crossprod}{crossprod} \itemket{Usage}Crossprod(vec1, vec2); \itemket{Description}Generic function to return the cross product of 2 vectors. \itemket{Details}The vectors are a list with length 3 or 2. \itemket{Examples}\mbox{} \verb|v=Crossprod([1,0,0],[1,1,1]);| // The result is v=[0,-1,1]. \end{cmd} %-----------Dotprod--------------------------------- \begin{cmd}{Dotprod}{dotprod} \itemket{Usage}Dotprod(vec1, vec2); \itemket{Description}Generic function to return the dot product of 2 vectors. \itemket{Examples}\mbox{} \verb|v=Dotprod([1,2,3],[1,-1,1]);| // The result is v=2. \end{cmd} %------------Findarea-------------------------------- \begin{cmd}{Findarea}{findarea} \itemket{Usage}Findarea(plotting data( or string of pd )); \itemket{Description}Generic function to return the area enclosed with a close curve. \itemket{Details}Oshima's B\'ezier formula is used. \itemket{Examples}\mbox{} \verb|Paramplot("1","[3*cos(t),2*sin(t)]","t=[0,2*pi]");|\\ \verb|area=Findarea("gp1");|\\ \verb|println(Sprintf(area,6));| // The result is 18.849536. \end{cmd} %-----------Findlength--------------------------------- \begin{cmd}{Findlength}{findlength} \itemket{Usage}Findlength(plotting data( or string of pd )); \itemket{Description}Generic function to return the length of a curve. \itemket{Details}Oshima's B\'ezier formula is used. \itemket{Examples}\mbox{} \verb|Circledata("1",[[0,0],[2,0]]);|\\ \verb|len=Findlength("cr1");|\\ \verb|println(Sprintf(len,6));| // The result is 12.558097. \end{cmd} %-----------Intersectcurves--------------------------------- \begin{cmd}{Intersectcurves}{intersectcurves} \itemket{Usage}Intersectcrvs(plotting data1(string), plotting data2(string)); \itemket{Description}Generic funtion to return a list of intersects of 2 plotting data. \itemket{Examples}\mbox{} \verb|Plotdata("1", "sin(x)", "x", ["Num=100"]);|\\ \verb|Circledata([A, B]);|\\ \verb|tmp=Intersectcrvs("gr1","crAB");|\\ \verb|pP=tmp_1;|\\ \verb|pQ=tmp_2;| \begin{center} \input{Fig/Intersectcrvs1} \end{center} \end{cmd} %------------IntersectcurvesPp-------------------------------- \begin{cmd}{IntersectcurvesPp}{intersectcurvesPp} \itemket{Usage}IntersectcrvsPp(plotting data1(string), plotting data2(string)); \itemket{Description}Generic funtion to return a list of intersects with parameters of 2 plotting data. \itemket{Details}Parameters are positons of the intersect. \end{cmd} %-------------Nearestpt------------------------------- \begin{cmd}{Nearestpt}{nearestpt} \itemket{Usage}Nearestpt(plotting data1, plotting data2); \itemket{Description}Generic funtion to return the nearest point with the parameter and the distance. \itemket{Examples}\mbox{} \verb|Plotdata("1", "x^2+2", "x=[-2,2]");|\\ \verb|Plotdata("2", "-(x-2)^2+1","x=[0,4]");|\\ \verb|plist=Nearestpt("gr1","gr2");|\\ \verb|Listplot("1",plist_1,plist_3);|\\ \verb|pB=plist_3;| \itemket{Remark}The returned list is [[0.4,2.16],31,[1.58,0.82],20.73,1.78]. \begin{center} \input{Fig/nearestpt} \end{center} \end{cmd} %--------------Nearestptcrv------------------------------ \begin{cmd}{Nearestptcrv}{nearestptcrv} \itemket{Usage}Nearestptcrv(point1, PD); \itemket{Description}Generic funtion to return the nearest point on the PD from the point1. \itemket{Examples}\mbox{} \verb|Plotdata("1", "x^2", "x");|\\ \verb|tmp=Nearestptcrv(A,"gr1");| //Tjhe coordnates will be returned.\\ \verb|Putpoint("B",tmp);|\\ \verb|Listplot([A,B],["do"]);| \begin{center} \input{Fig/nearestpt1} \end{center} \itemket{Remark}The return value is [[0.4,2.16],31,[1.58,0.82],20.73,1.78]. \end{cmd} %-------------Numptcrv------------------------------- \begin{cmd}{Numptcrv}{numptcrv} \itemket{Usage}Numptcrv (PD) \itemket{Description}Generic function to return the number of PD. \itemket{Details}This is the same as \verb|length(PD)|. \itemket{Examples}\mbox{} Compare the order of PD, Implicit() and Paramplot(). ( on Euclidean view ) \verb|Slider("A-C-B",[0,-2],[6,-2]); |\\ \verb|Implicitplot("1","x^2+4*y^2=4","x=[-2,2]","y=[-2,2]",["do"]); |\\ \verb|Paramplot("1","[2*cos(t)+5,sin(t)]","t=[0,2*pi]",["do","Num=140"]); |\\ \verb|println([Numptcrv(imp1),Numptcrv(gp1)]);| //display number of PD on console\\ \verb|n=floor(C.x*2); |\\ \verb|repeat(n,s,start->0, |\\ \verb| t=s*10+1; |\\ \verb| draw(imp1_t,color->hue(s/10)); |\\ \verb| draw(gp1_t,color->hue(s/10)); |\\ \verb|); | \begin{center} \includegraphics[bb=0.00 0.00 305.02 133.01,width=8cm]{Fig/numptcrv.pdf} \end{center} \end{cmd} %-----------Paramoncurve--------------------------------- \begin{cmd}{Paramoncurve}{paramoncurve} \itemket{Usage}Paramoncurve(point, PD) \itemket{Description}Generic function to return the parameter value of the point on the curve. \itemket{Details}The integer part is the number of the segment on which the point lies, the fractional part is the position on the segment. \itemket{Examples}\mbox{} \verb|Listplot([A,B,C,A]);|\\ \verb|Putonseg("D",[B,C]);|\\ \verb|tmp=Paramoncurve(D,"sgABCA");|\\ \verb|println(tmp);| // for example display \verb|2.35| on console. %\begin{center} %\input{Fig/paramoncrv} %\end{center} \end{cmd} %---------Pointoncurve----------------------------------- \begin{cmd}{Pointoncurve}{pointoncurve} \itemket{Usage}Pointoncrv(parameter value, plotting data); \itemket{Description}Generic function to return the point which has the parameter value \itemket{Examples}\mbox{} \verb|Circledata("1",[[0,0],[2,0]],["Num=5","Rng=[0,pi]"]);|\\ \verb|tmp=Pointoncurve(4.5,"cr1");|\\ \verb|Pointdata("1",tmp,["Size=3"]);|\\ \verb|Letter(tmp,"nw","A");| \begin{center} \input{Fig/pointoncrv} \end{center} \end{cmd} %-----------Ptcrv--------------------------------- \begin{cmd}{Ptcrv}{ptcrv} \itemket{Usage}Ptcrv(n,PD); \itemket{Description}Returns n-th point from PD. \itemket{Details}Same as \verb|PD_n| of Cindyscript. \itemket{Examples}\mbox{}\\ \verb| Circledata([O,P],["do","Num=100","notex"]); |\\ \verb| Scaledata("1","crOP",4/3,1); |\\ \verb| F.xy=[-sqrt(7),0]; |\\ \verb| A=Ptcrv(9,sc1); |\\ \verb| B=Ptcrv(16,sc1); |\\ \verb| Listplot("1",[A,F,B],["da"]); |\\ \verb| Partcrv("1",A,B,"sc1",["dr,3"]); |\\ \verb| Shade(["part1","sg1"],0.1); |\\ \verb| Arrowhead(B,"sc1",[1.5]); |\\ \verb| Letter([A,"ne","A",B,"ne","B",F,"s2","F"]); |\\ \begin{center}\input{Fig/ptcrv}\end{center} \end{cmd} %-------------Ptstart, Ptend------------------------------- \begin{cmd}{Ptstart, Ptend}{ptstart, ptend} \itemket{Usage}Ptstart(PD) , Ptend(PD) \itemket{Description}Returns start point and end point of PD. respectively. \itemket{Details} It returns coodinates of point. \itemket{Examples} Gets the points at both ends of the graph with limited domain and draw the line segments.\\ \verb| Deffun("f(x)",["regional(y)","y=x^2","y"]); |\\ \verb| Plotdata("1","f(x)","x",["do"]); |\\ \verb| Plotdata("2","f(x)","x=[-1,2]"); |\\ \verb| Lineplot("1",[Ptstart(gr2),Ptend(gr2)],["do"]); |\\ \verb| Listplot("1",[Ptstart(gr2),Ptend(gr2)]); |\\ \verb| Letter([A,"w2","A",B,"e2","B"]); |\\ \begin{center} \input{Fig/ptstart} \end{center} \end{cmd} %------------Readcsv-------------------------------- \begin{cmd}{Readcsv}{readcsv} \itemket{Usage}Readcsv(path,filename,option) \itemket{Description}read an external data file in csv format. The return value is a list of the data. \itemket{Details}The first argument sets a path to the current working folder where the data file is (the default is fig). If you put the data file in fig folder, the pathname can be omitted. Otherwise a full pathname is required.\\ option: By the argument "Flat=y", you can flatten a list of the data (the default is "Flat=n" ). \itemket{Examples} \mbox{} Examples can be found in the command Boxplot(). \end{cmd} %------------Readlines-------------------------------- \begin{cmd}{Readlines}{readlines} \itemket{Usage}Readlines(path,filename,option) \itemket{Description}read a text file line by line. The return value is a list of strings. \itemket{Details}The first argument sets a path to the current working folder where the data file is (the default is fig). If you put the data file in fig folder, the pathname can be omitted. Otherwise a full pathname is required.\\ option: By the argument "Flat=y", you can flatten a list of the data (the default is "Flat=n" ). \end{cmd} %----------ReadOutData---------------------------------- \begin{cmd}{ReadOutData}{readoutdata} \itemket{Usage}ReadOutdata(filename); \itemket{Description}Generic function to read external data of \ketcindy\ format. \itemket{Details}If the data is outside the working directory, add the path name as the first argument. For example, \verb|ReadOutdata("/datafolder","file.txt");| \vspace{\baselineskip} \ketcindy\ format data is next style. \verb|variable name// |\\ \verb|start // | : start of list \\ \verb|[ , , ], .... // | : coordinates ( 2 or 3 dimension )\\ \verb|....|\\ \verb|end// | : end of list\\ \verb|start// | : start of next list\\ \verb|....|\\ \verb|end// |\\ \verb|variable name// |\\ \verb|start// |\\ \verb|… |\\ \verb|end//// |\\ %\itemket{Examples}\mbox{} \itemket{Reference} \hyperlink{writeoutdata}{WriteOutData}. \end{cmd} %------------WriteOutData-------------------------------- \begin{cmd}{WriteOutData}{writeoutdata} \itemket{Usage}WriteOutdata(filename, a list of varname and value); \itemket{Description}Function to write out data in \ketcindy\ format. \itemket{Details}The file is available commonly from \ketcindy,\ R and C. \itemket{Examples}\mbox{} Write out the plotting data of the parabola and the circle. \vspace{\baselineskip} \verb|Plotdata("1", "x^2","x");|\\ \verb|Circledata("1",[[0,0],[1,0]]);|\\ \verb|WriteOutData("figdata.txt",["gr1",gr1,"cr1",cr1]);| \vspace{\baselineskip} The written data is as follows. \verb| gr1//|\\ \verb| start// [[-2.68843,7.22765],[-2.51807,6.34067],・・,[-2.00698,4.02798]]// |\\ \verb| [[-1.83662,3.37318],[-1.66626,2.77642],・・,[-1.15518,1.33443]]// | \hspace{20mm} and so on \verb| [[5.82965,33.98479]]//|\\ \verb| end//|\\ \verb| cr1//|\\ \verb| start// [[1,0],[0.99211,0.12533],[0.96858,0.24869],・・,[0.80902,0.58779]]//| \hspace{20mm} and so on \verb| [[0.87631,-0.48175],[0.92978,-0.36812],・・,[1,0]]//|\\ \verb| end////| \itemket{Reference} See \hyperlink{readoutdata}{ReadOutData}. \end{cmd} %---------------Extractdata----------------------------- \begin{cmd}{Extractdata}{extractdata} \itemket{Usage}Extractdata(dataname,options); \itemket{Description}Function to add properties to a data. \itemket{Details}The default properties are ["dr"]. \itemket{Examples}\mbox{} \verb|ReadOutData("figdata.txt");|\\ \verb|Extractdata("gr1",["da"]);|\\ \itemket{Reference} See \hyperlink{writeoutdata}{WriteOutData} and \hyperlink{readoutdata}{ReadOutData}. \end{cmd} %========Making Tables========================== \subsection{Making Tables} %------------Tabledata-------------------------------- \begin{cmd}{Tabledata}{tabledata} \itemket{Usage}Tabledata(a list of widths, a list of height,a list of removals,[options]); \item[Descritption]Table function to draw rules of a table. \itemket{Details} The lower left is the origin.\\ The options are\\ \hspace*{10mm}''Setwindow=y/n''\ if "n", command setwindow is not executed.\\ \hspace*{10mm}''Move=point''\ The lower left changes to the point.\\ \hspace*{10mm}''Geo=n/y''\ if ''y'', geometric points are created.\\ \hspace*{10mm}integer\ decides to put names par each interval.\\ The unit of length is 1/10 of the grid of Euclidean view. The default is 1mm.\\ Control points are put on the row and column. The names are r0,r1,... and c0,c1,....\\ The points are movable. \itemket{Remark}See \verb|Tabledatalight| \itemket{Examples}\mbox{} \verb|xL=[20,20,20,20];|\\ \verb|yL=[10,10,10,10,10];|\\ \verb|Tabledata(xL,yL,["Geo=y"]);| \begin{center} \includegraphics[bb=0.00 0.00 403.52 249.51,height=30mm]{Fig/table01.pdf}\hspace{10mm}\input{Fig/table02} \end{center} \verb|Rmv=["r1c0c1","c3r0r1","c3r3r5","r4c2c4"];|\\ \verb|Tabledata(xL,yL,Rmv);| \begin{center} \includegraphics[bb=0.00 0.00 392.02 251.51, height=36mm]{Fig/table03.pdf} \end{center} \end{cmd} %--------Changetablestyle------------------------------------ \begin{cmd}{Changetablestyle}{changetablestyle} \itemket{Usage}ChangeTablestyle(a list of Rules, [changed style]); \itemket{Description}Table function to change line styles of rules. \itemket{Examples}\mbox{} \verb|Tabledata([10,20,10,20],[10,10,10],[]);|\\ \verb|ChangeTablestyle(["r1c0c4"],["da"]);|\\ \verb|ChangeTablestyle(["r2c0c2","c1r0r3"],["nodisp"]);| \begin{center} \includegraphics[bb=0.00 0.00 324.00 174.00,height=50mm]{Fig/changetable.pdf} \end{center} \end{cmd} %-----------Findcell--------------------------------- \begin{cmd}{Findcell}{findcell} \itemket{Usage}Findcell(grid name of upper left, grid name of lower right); \itemket{Description}Table function to return the information of a cell. \itemket{Details} The grid name is, for example, "c0r1".\\ The result is a list of center, half of width, half of height. \itemket{Examples}\mbox{} \verb|Tabledata([10,20,10,20],[10,10,10],[]);|\\ \verb|tmp=Findcell("c2r0","c3r1");| The return is [[3.5,2.5],0.5,0.5].\\ \verb|tmp=Findcell("c0r1","c2r3");| The return is [[1.5,1],1.5,1] . \end{cmd} %------------Putcell-------------------------------- \begin{cmd}{Putcell, Putcellexpr}{putcell} \itemket{Usage}Putcell(grid name of upper left, grid name of lower right, postion, a string); \itemket{Description}Table function to put a string at the cell. \itemket{Details} The position is one of \verb|c, r, l, t, b| (center, right, left, top, bottom).\\ Minute movements can be added. \itemket{Examples}\mbox{} \verb|xL=apply(1..5,20);|\\ \verb|yL=apply(1..2,20);|\\ \verb|rL=["c2r2r3","c5r2r3"];|\\ \verb|Tabledata(xL,yL,rL);|\\ \verb|Putcell("c0r0","c1r1","c","A");|\\ \verb|Putcell("c1r0","c3r1","l2","B");|\\ \verb|Putcell("c0r1","c2r2","rt","C");|\\ \verb|Putcell("c3r1","c5r2","lb","D");|\\ \begin{center} \input{Fig/putcellE} \end{center} \end{cmd} %----------Putcol---------------------------------- \begin{cmd}{Putcol}{putcol} \itemket{Usage}Putcol (column number, position, a list of strings); \itemket{Description}Table function to put strings to a column. \itemket{Details} The position is as \verb|Putcell|.\\ It's unnecessary to enclose with double quotes in case of numbers.\\ Null string is available. \itemket{Reference} \hyperlink{putrow}{Putrow}. \end{cmd} %--------------Putcolexpr------------------------------ \begin{cmd}{Putcolexpr}{putcolexpr} \itemket{Usage}Putcolexpr (column number, position, a list of mathematical expressions); \itemket{Description}Table function to put strings to a column. \itemket{Reference} \hyperlink{putrowexpr}{Putrowexpr}. \end{cmd} %-------------Putrow------------------------------- \begin{cmd}{Putrow}{putrow} \itemket{Usage}Putrow (row number, position, a list of strings); \itemket{Description}Table function to put strings to a row. \itemket{Reference} \hyperlink{putcol}{Putcol}. \end{cmd} %--------------Putrowexpr------------------------------ \begin{cmd}{Putrowexpr}{putrowexpr} \itemket{Usage}Putrowexpr(row number, position, a list of strings); \itemket{Description}Table function to put strings to a row. \itemket{Examples} In Putcolexpr (), Putrowexpr (), formulas and general \TeX sentences can be entered. \verb|xL=apply(1..5,20);|\\ \verb|xL=apply(1..3,15);|\\ \verb|Tabledata(xL,yL,["c1r1r2","r1c2c3","r2c2c3"]);|\\ \verb|Putcol(3,"c",["A","B","C"]);|\\ \verb|Putcolexpr(4,"l",["x^2","y=\sqrt{x^3}"]);|\\ \verb|Putrow(1,"c",[1,"two"]);|\\ \verb|Putrowexpr(3,"c",["","\frac{\pi}{2}","","","\sum{x^2}"]);|\\ \begin{center} \input{Fig/putcolE} \end{center} \itemket{Remark} r0, c0, ... are numbers displayed on the screen. \itemket{Examples} The graphs can be placed in the cells of the table. These are drawn at the position of the cell. \verb|Tabledata("",3,3,120,90,["dr,2"]);|\\ \verb|ChangeTablestyle(["r1c0c3"],["dr"]);|\\ \verb|ChangeTablestyle(["r2c0c3"],["da"]);|\\ \verb|Plotdata("1","(x-2)^2+1.5","x=[0.5,3.5]");|\\ \verb|Plotdata("2","(x-6)^2+2","x=[4.5,7.5]");|\\ \verb|Plotdata("3","(x-10)^2+2.5","x=[8.5,11.5]");|\\ \verb|Listplot([A,B]);|\\ \verb|Listplot([C,D]);|\\ \verb|Listplot([E,F]);|\\ \verb|Putrowexpr(1,"c",["D>0","D=0","D<0"]);|\\ \verb|Putrow(2,"c",["2","1","0"]);|\\ \verb|Letter(G,"c","The discriminant and the number of intersections");|\\ \begin{center} \input{Fig/tablesample1E} \end{center} \itemket{Examples}\mbox{} \verb|Column=[6,6,10,6,10,6,40];|\\ \verb|Row=[30,6,6,6];|\\ \verb|Rmv=["c1r0r1","c2r0r1","c3r0r1","c4r0r1","c5r0r1", "r1c6c7","r2c6c7","r3c6c7"];|\\ \verb|Tabledata("",Column,Row,Rmv,["dr"]);|\\ \verb|Tlistplot("23d",["c1r2","c2r3"]);|\\ \verb|Tlistplot("23u",["c1r3","c2r2"]);|\\ \verb|Putrowexpr(2,"c",["x",0,"\cdots","\tfrac{1}{4}","\cdots",4]);|\\ \verb|Putrowexpr(3,"c",["y`","","-",0,"+"]);|\\ \verb|Putrowexpr(4,"c",["y",0,"\searrow","-\tfrac{1}{4}","\nearrow",2]);|\\ \verb|Putcell(1,1,"l2t2","{\small\begin{minipage}{44mm}$y=x-\sqrt{x}$\\$y`=|\\ \verb|\dfrac{2\sqrt{x}-1}{2\sqrt{x}}=0$\vspace{1mm}\\\hspace*{5mm}$x=|\\ \verb|\dfrac{1}{4}$\vspace{1mm}The following table is obtained.\\\end{minipage}}" );|\\ \verb|Plotdata("1","x-sqrt(x)","x=[0,3]",["do","notex"]);|\\ \verb|Listplot("2",[[0,0],[3,0]],["do","notex"]);|\\ \verb|Listplot("3",[[0,-0.5],[0,3]],["do","notex"]);|\\ \verb|Translatedata("1","gr1",[4.9,1],["dr"]);|\\ \verb|Translatedata("2","sg2",[4.9,1],["dr"]);|\\ \verb|Translatedata("3","sg3",[4.9,1],["dr"]);|\\ \verb|Letter(Ptend(tr2),"e1","\small{$x$}");|\\ \verb|Letter(Ptend(tr3),"n1","\small{$y$}");|\\ \verb|Letter(Ptstart(tr2),"w1","\small O");|\\ \verb|Expr(Ptend(tr1),"nw-2","y=x-\sqrt{x}");|\\ \begin{center} \input{Fig/tablesample2E} \end{center} \itemket{Examples}\mbox{} \verb|Tabledata("",8,4,80,40,[]);|\\ \verb|Putrowexpr(1,c,["x","\cdots","-1","\cdots","0","\cdots","1","\cdots"]);|\\ \verb|Putrowexpr(2,c,["y`","+","+","+","0","-","-","-"]);|\\ \verb|Putrowexpr(3,c,["y``","+","0","-","-","-","0","+"]);|\\ \verb|Putrowexpr(4,c,["y","\nelarrow","\frac{1}{\sqrt{e}}","\nerarrow",|\\ \verb|"1","\serarrow","\frac{1}{\sqrt{e}}","\selarrow"]);|\\ \begin{center} \input{Fig/zogen3} \end{center} \itemket{Remark} The arrows here are defined in ketpic.sty.\\ nelarrow, nerarrow, selarrow, serarrow, NELarrow, NERarrow, SELarrow, SERrarrow\\ The first ne and se represent northeast and southeast (upper right and lower right), respectively. The next r and l represent the direction of rotation (r: right: counterclockwise, l: left: clockwise).\\ The straight arrows are NEarrow, SEarrrow. Since these arrows do not exist in Cindy\TeX, they are not displayed on the drawing surface of Cinderella. \end{cmd} %------------Tgrid-------------------------------- \begin{cmd}{Tgrid}{tgrid} \itemket{Usage}Tgrid(grid name); \itemket{Description}Table function to return the coordinates of the grid name. \end{cmd} %-------------Tlistplot------------------------------- \begin{cmd}{Tlistplot}{tlistplotgrid} \itemket{Usage}Tlistplot(grid name, grid name); \itemket{Description}Table function to connect two lattice points by line segments. \itemket{Examples} \mbox{} \verb|Tlistplot(["c0r1","c1r2"]);| \end{cmd} %=========Data Processing========================= \subsection{Data Processing} This section describes data processing by \ketcindy . Cooperation with spreadsheet software enables efficient data processing. %------------Tab2list-------------------------------- \begin{cmd}{Tab2list}{tab2list} \itemket{Usage}Tab2list(string data, option); \itemket{Description}Sheet function to convert contents of string data to list. \item[Ditails]The options are as follows.\\ \verb|"Blank=a"| : translate cells that is NULL to ``a"\\ \verb|"Sep=b"| : separators of the string are ``b". The default separators are Tab code. \itemket{Examples} \mbox{} In the Cindyscrpt editor, prepare a local variable, for example "data". \begin{center} \includegraphics[bb=0.00 0.00 261.01 139.01,width=6cm]{Fig/tab2list02E.pdf} \end{center} Copy the data on the spreadsheet to the clipboard. \begin{center} \includegraphics[bb=0.00 0.00 449.02 164.01,width=8cm]{Fig/tab2list01E.pdf} \end{center} Paste it during double quotes. \begin{center} \includegraphics[bb=0.00 0.00 465.02 140.01,width=8cm]{Fig/tab2list001E.pdf} \end{center} By executing \verb|"Tab2list(data)"| get a list of matrix form. \begin{center} \includegraphics[bb=0.00 0.00 482.02 134.01,width=10cm]{Fig/tab2list03E.pdf} \end{center} If it contains a null character cell (NULL), it defaults to null character.Therefore, if you want to set NULL to 0 for questionnaire processing etc., use option \verb|Blank|. \hspace{20mm}\verb|dlist=Tab2list(data,["Blank=0"];| When CSV format data is copied from the file, the option is set to \verb|sep|. \hspace{20mm}\verb|dlist=Tab2list(data,["Sep=,"];| \end{cmd} %-------------Dispmat------------------------------- \begin{cmd}{Dispmat}{dispmat} \itemket{Usage}Dispmat(list); \itemket{Description}Display the list to matrix form in the console. \itemket{Examples}In the example of Tab2list, put the obtained data in a matrix format. \begin{center} \includegraphics[bb=0.00 0.00 422.52 178.01,width=8cm]{Fig/tab2list04E.pdf} \end{center} You can copy this directly to spreadsheet. \end{cmd} %--------------Writecsv------------------------------ \begin{cmd}{Writecsv}{writecsv} \itemket{Usage}Writecsv(namelist, data, filename, option); \itemket{Description}Make a CSV file consisting of the contents of data. \item[Ditails]namelist is item name added to the first line of the CSV file. If the namelist omitted, the item names "c1, c2, ..." are appended. The filename is the name of CSV file. option : \verb|"Col=nn"| : Specify the number of columns in the CSV file as a natural number \verb|nn|. When specifying the number of columns is omitted, if data is a matrix, use that number of columns, and if data is a vector, use the number of items in namelist. \itemket{Examples}\mbox{}\\ %(1)\\ Let \verb|data=[13,25,17,22,14,26] , name2=["aa","ab"] , name3=["ba","bb","bc"]|\\ \verb|Writecsv(name2,data,"aaa");|\\ makes the file "aaa.csv" consists of\\ aa,ab\\ 13,25\\ 17,22\\ 14,26\\ %(2)\\ \verb|Writecsv(name3,data,"aaa");|\\ makes the file "aaa.csv" consists of\\ ba,bb,bc\\ 13,25,17\\ 22,14,26\\ %(3)\\ \verb|Writecsv(,data,"aaa",["Col=3"]);|\\ makes the file "aaa.csv" consists of\\ c1,c2,c3\\ 13,25,17\\ 22,14,26\\ \end{cmd} \newpage % =====the others=========================== \subsection{Others} %-------Assign------------------------------------- \begin{cmd}{Assign}{assign} \itemket{Usage}Assign(string0, string1, number) \itemket{Description}Generic function to replace the string1 in the string0 with the number. Number is real number or string of real number. \itemket{Examples}\mbox{} \verb|Assign("x^2+a*x","a","1.3"); | // \verb|a*x| $\to$ \verb|1.3*x|\\ \verb|Assign("x^2+a*x","a",1.3); | //same as above\\ \verb|repeat(50,t,|\\ \verb| cb=t/5-5;|\\ \verb| Plotdata(text(t),Assign("b*x-b^2","b",cb),"x");|\\ \verb|);|\\ \hspace{40mm} \input{Fig/assign} Perform multiple replacements by list. \verb|Assign("a*x^2+b*x",["a",1,"b",2]);| \hspace{10mm}// \verb|a| $\to$ \verb|1 and b| $\to$ \verb|2| \end{cmd} %-----------BBdata--------------------------------- \begin{cmd}{BBdata}{bbdata} \itemket{Usage}BBdata(file name, options); \itemket{Description}Generic function to return the size of an image file. \itemket{Details}In the \TeX document, find the BB size when pasting the image with the inputgraphics command. Create BB data from an image file using extractbb of \TeX processing system and write it as a text file to the working directory. Read this and write the ingludegarphics command to the console.\\ Options : specifies width and height. "w=" : width, "h=" : height The value of bb is not an integer value, and it is indicated by rounding off the high definition value to two decimal places.\\ The image files are PDF, PNG, JPG, and so on.\\ \itemket{Examples} \mbox{} \includegraphics[bb=0.00 0.00 562.03 124.01,width=12cm]{Fig/bbdata.pdf} \end{cmd} %-----------Asin--------------------------------- \begin{cmd}{Asin}{asin} \itemket{Usage}Asin(real) , Acos(real) \itemket{Description} Return arcsine and arccosine. \end{cmd} %-----------Sqr--------------------------------- \begin{cmd}{Sqr}{sqr} \itemket{Usage}Sqr(real) \itemket{Description} Return square root. \end{cmd} %---------Colorcode----------------------------------- \begin{cmd}{Colorcode}{colorcode} \itemket{Usage}Colorcode(colortype1,colortype2,colorcode) \itemket{Description}Generic function to change colorcode from colortype1 to colortype2. \itemket{Details}Return value is changed color code. Color type is one of "rgb","cmyk","hsv". \item[Example]\mbox{} RGB to CMYK \hspace{10mm} \verb|col=Colorcode("rgb","cmyk",[1,0,0]); | CMYK to RGB \hspace{10mm} \verb|col=Colorcode("cmyk","rgb",[0,1,1,0]);| RGB to HSV \hspace{10mm} \verb|col=Colorcode("rgb","hsv",[1,0,0]);| \end{cmd} %----------Dqq---------------------------------- \begin{cmd}{Dqq}{dqq} \itemket{Usage}Dqq(string); \itemket{Description}This function returns a string surrounded by double quotes. \itemket{Exaample}\mbox{}\\ \verb|parse("a");| // The value of variable \verb|a| is returned.\\ \verb|parse(Dqq("a"));| // String \verb|"a"| is returned.\\ \end{cmd} %----------Factorial---------------------------------- \begin{cmd}{Factorial}{factorial} \itemket{Usage}Factorial(n); \itemket{Description}This function returns the factorial of \verb|n|. \itemket[Details]\verb|n| should be a positive integer. \itemket{Exaample}\verb|x=Factorial(5); // x is 120.| \end{cmd} %----------Figpdf---------------------------------- \begin{cmd}{Figpdf}{Figpdf} \itemket{Usage}Figpdf(option) \itemket{Description}Generic function to make a pdf with the same size of figure. \itemket{Details}Option is a list of margin and the amount of translation. (1) Set the output file name with the command \verb|Setparent("filename")|. (2) Push the "Parent" button. "figure.tex" and "filename.tex" is created in fig folder. ( use "figure.cdy") filename.tex creates filename.pdf using figure.tex. \itemket{Examples}\mbox{} \begin{tabbing} 1234678901234567890123456789012\=\kill \verb|Figpdf();| \> : default\\ \verb|Figpdf([5,5,10,10]);| \> : left and right margins are 5mm\\ \> : top and bottom margins are 10mm.\\ \verb|Figpdf([[5,10]]);| \> : translation to right 5mm and to down 10mm. \\ \verb|Figpdf([5,8,10,10,[5,-5]]);| \> : margin and translation \end{tabbing} We have to take the right margin at least 3mm to draw the axis name. \end{cmd} %------------Cindyname-------------------------------- \begin{cmd}{Cindyname}{cindyname} \itemket{Usage}Cindyname(); \itemket{Description}Generic function to return the name of a current file without ".cdy". \itemket{Examples}\mbox{} \verb|name=Cindyname();| // If cuurent file is "sample.cdy", name="sample". \end{cmd} %------------Indexall-------------------------------- \begin{cmd}{Indexall}{indexall} \itemket{Usage}Indexall(string1,string2); \itemket{Description}Generic function to return all positions of string2 in string1. \itemket{Examples}\mbox{} \verb|str="abcadeaf"|\\ \verb|pos=Indexall(str,"a");|// Result is [1,4,7]. \item[Remarks]This command is an extension of "indexof" which is a command of CindyScript. \end{cmd} %-----------Help--------------------------------- \begin{cmd}{Help}{help} \itemket{Usage}Help(string) \itemket{Description}Generic function to display usages of the function. \itemket{Examples}\mbox{} \verb|Help("L");| then we have the following result in console. \vspace{\baselineskip} \verb|Letter([C,"c","Graph of $f(x)$"]);|\\ \verb|Letter([C,"c","xy"],["size->30"]);|\\ \verb|Letterrot(C,B-A,"AB");|\\ \verb|Letterrot(C,B-A,"t0n5","AB");|\\ \verb|Letterrot(C,B-A,0,5,"AB");|\\ $\cdots\cdots\cdots$ \end{cmd} %-------------Norm------------------------------- \begin{cmd}{Norm}{norm} \itemket{Usage}Norm(vector); \itemket{Description}This function returns the norm of the vector. \itemket{Details}\mbox{} The vector is 2D or 3D.\\ If two vectors \verb|v1|, \verb|v2| are given, the value of \verb|Norm(v2-v1)| is returned. \itemket{Examples}\verb|Norm([1,1,2]);| // $\sqrt{6}$ is returned. \end{cmd} %-------------Op------------------------------- \begin{cmd}{Op}{op} \itemket{Usage}Op(number, list or string); \itemket{Description}Generic function to return the n-th element of a list or a string. \itemket{Examples}\mbox{} \verb|str="abcde"|\\ \verb|list=[3,1,2,5];|\\ \verb|s=Op(2,str); |// Result is "b".\\ \verb|x=Op(3,list); |// Result is 2. \end{cmd} %---------Ptselected----------------------------------- \begin{cmd}{Ptselected}{ptselected} \itemket{Usage}Ptselected(name of points) \itemket{Description}Generic function to returns "true" if a point is selected. \itemket{Details}Commands such as \verb|Hachdata| take time to execute, so interactive operations slow down the reaction. Therefore, while interactively operating, you can use this command to stop drawing. \itemket{Examples}\mbox{} Draw the point A near the origin. \verb| Deffun("f(x)",["regional(y)","y=x^3-2*x","y"]);|\\ \verb| Plotdata("1","f(x)","x",["Num=100"]);|\\ \verb| Putoncurve("A","gr1");|\\ \verb| coef=Derivative("f(x)","x",A.x);|\\ \verb| Defvar(["coef",coef]);|\\ \verb| Deffun("g(x)",["regional(y)","y=coef*(x-A.x)+A.y","y"]);|\\ \verb| Plotdata("2","g(x)","x",["Num=1"]);|\\ \verb| if(!Ptselected(A),|\\ \verb| Enclosing("1",["gr2","Invert(gr1)"],[A,"nodisp"]);|\\ \verb| Hatchdata("1",["i"],[["en1"]]);|\\ \verb| );| \vspace{\baselineskip} \hspace{20mm} Dragging point A (select) \hspace{5mm} Unselected \hspace{20mm}\includegraphics[bb=0.00 0.00 218.01 204.51,width=40mm]{Fig/ptselected01.pdf} \hspace{10mm}\includegraphics[bb=0.00 0.00 219.01 204.51,width=40mm]{Fig/ptselected02.pdf} \end{cmd} %-------------Reparse------------------------------- \begin{cmd}{Reparse}{reparse} \itemket{Usage}Reparse(string or list of string) \itemket{Description}function to return the real part after \verb|parse| \itemket{Remark}\verb|parse| of CindyJS has a bug to return an imaginary number in some cases. \itemket{Examples}\mbox{} \verb|str="(0-1)^2"; |\\ \verb|format(parse(str),0);| // returns \verb|1+i*0| in CindyJS\\ \verb|format(Reparse(str),0);| // returns \verb|1|\\ \end{cmd} %-------------Slider------------------------------- \begin{cmd}{Slider}{slider} \itemket{Usage}Slider("endpoint1-pt-endpoint2",endpoint1,endpoint2);\vspace{-2mm} \itemket{}Slider("pt",endpoint1,endpoint2);\\ \itemket{Description}Generic function to make a slider on a Euclidean view. \itemket{Examples}\mbox{} \verb|Slider("A-C-B",[-5,-2],[5,-2]); | // \verb|C| is movable.\\ \verb|Slider("D-F-E",[-6,-2],[-6,2]); | // \verb|F| is movable.\\ \verb|Plotdata("1",Assign("y=a*sin(x-b)",["a",F.y,"b",C.x]),"x"); | \vspace{\baselineskip} \hspace{15mm} \includegraphics[bb=0.00 0.00 445.02 193.01,height=40mm]{Fig/slider.pdf} \end{cmd} %-----------Sprintf--------------------------------- \begin{cmd}{Sprintf}{sprintf} \itemket{Usage}Sprintf(value,number); \itemket{Description}Converts a real number to a string. \itemket{Details}\hspace{9mm} Convert a real value to a string to the specified number of digits after the decimal point. \itemket{Examples}\mbox{} \verb|Sprintf(pi,2);| // returns "3.14".\\ \verb|Sprintf(pi,7);| // returns "3.1415927".\\ \verb|Remark| : \verb|pi| is a reserved variable in Cindyscript, representing the number $\pi$. \itemket{Reference} See \hyperlink{textformat}{Textformat}. \end{cmd} %------------Strsplit-------------------------------- \begin{cmd}{Strsplit}{strsplit} \itemket{Usage}Strsplit(string,char); \itemket{Description}Generic function to return the list of strings separated by \verb|char|. \itemket{Examples}\mbox{} \verb|str="abcadeaf"|\\ \verb|strL=Strsplit(str,"a"); |// Result is ["","bc","de","f"]. \end{cmd} %\newpage %----------Texcom---------------------------------- \begin{cmd}{Texcom}{texcom} \itemket{Usage}Texcom(command); \itemket{Description}Generic function to add the command in the \TeX file. \itemket{Details}Command is a \TeX command in string. \itemket{Examples}\mbox{} \verb|Texcommand("{");|\\ \verb|Texcommand("}");| \end{cmd} %-------------Textformat}------------------------------- \begin{cmd}{Textformat}{textformat} \itemket{Usage}Textformat(value,number); \itemket{Description}Converts a real number to a string. \itemket{Details}\hspace{9mm}Convert a real value to a string up to the specified number of digits after the decimal point. "value" is can be list. Cindyscript has a function \verb|format(value, number)|, like as Textformat. \itemket{Examples}\mbox{} \verb| Textformat(1/6,4);| // return value is string "0.1667" \\ \verb| format(1/6,4); | // return value is string "0.1667" \verb| dt=[1/6,0.5];|\\ \verb| Textformat(dt,4); | // return valu is string "[ 0.1667 , 0.5 ]" \\ \verb| format(dt,4); | // return value is list ["0.1667" , "0.5" ]\\ \verb| Sprintf(dt,4); | // return value is list ["0.1667","0.5000"] \itemket{Reference} See \hyperlink{sprintf}{Sprintf}. \end{cmd} %----------Toupper---------------------------------- \begin{cmd}{Toupper}{toupper} \itemket{Usage}Toupper(string); \itemket{Description}This function returns the upper case letters of the string. \itemket{Examples}\verb|Toupper("aBc123");| // "ABC123" is returned. %\verb|Windispg();| \end{cmd} %----------Windispg---------------------------------- \begin{cmd}{Windispg}{windispg} \itemket{Usage}Windispg(); \itemket{Description}Generic function to display all graphs on Euclidean view. \itemket{Remark}This command must be put on the final line. %\itemket{Examples}\mbox{} %\verb|Windispg();| \end{cmd} %----------Windispg---------------------------------- \begin{cmd}{Windispg}{windispg} \itemket{Usage}Windispg(); \itemket{Description}Generic function to display all graphs on Euclidean view. \itemket{Remark}This command must be put on the final line. %\itemket{Examples}\mbox{} %\verb|Windispg();| \end{cmd} %----------Fracform---------------------------------- \begin{cmd}{Fracform}{fracform} \itemket{Usage}Fracform(number,list of denominators/max number[, allowable error(5)]) \itemket{Description}returns Tex-like form of the fraction \itemket{Examples}\verb|Fracform(0.33,[2,3]); => [fr(1,3),''err=0.00333'',1,3]| \end{cmd} %----------Totexform---------------------------------- \begin{cmd}{Totexform}{totexform} \itemket{Usage}Totexform(Tex-like form) \itemket{Description}returns TeX form \itemket{Examples}\verb|Totexform(fr(1,3)); => frac{1}{3}| \end{cmd} %----------Totexform---------------------------------- \begin{cmd}{Tocindyform}{tocindyform} \itemket{Usage}Tocindyform(Tex-like form) \itemket{Description}returns Cindy form \itemket{Examples}\verb|Tocindyform(fr(1,3)); => (1)/(3)| \end{cmd} \newpage %==== Calling Other Softwares ========= \section{Calling Other Softwares} \subsection{R} %--------------Rfun------------------------------ \begin{cmd}{Rfun}{rfun} \itemket{Usage}Rfun(name, ommand,list of arguments,options) \itemket{Description}This function executes a R command and returns the. \itemket{Examples}\verb|Rfun("1","rnorm",[10]);| // The result will be assigned to "R1". \itemket{Remark}Option "Cat=n" supresses display of the result in the console. \end{cmd} %--------------CalcbyR------------------------------ \begin{cmd}{CalcbyR}{calcbyr} \itemket{Usage}CalcbyR(var,command,options) \itemket{Description}executes R commands and returns the execution result to Cinderella. \itemket{Details}exchange data with R through a batch file (kc.bat) or a shell file (kc.shell). \itemket{Examples} \mbox{} Generate 10 random samples from the standard normal distribution by R and return the result (data) to Cinderella.\\ \verb| cmdL=[|\\ \verb| "dt=rnorm",[10,50,5],|\\ \verb| "m=mean(dt)",[],|\\ \verb| "u=var(dt)",[],|\\ \verb| "dt::m::u",[]|\\ \verb| ]|\\ \verb| CalcbyR("ans",cmdL);| \verb| println("Data : "+ans_1);|\\ \verb| println("Mean : "+format(ans_2,4));|\\ \verb| println("UD : "+format(ans_3,4));|\\ %\begin{center} %\includegraphics[bb=0.00 0.00 532.53 249.51,width=12cm]{Fig/calcbyr01.pdf} %\end{center} generate 200 random samples from the Poisson distribution with mean 5 and calculate the sample mean and the unbiased variance of the data.\\ \verb| cmdL=[|\\ \verb| "tmp1=rpois",[200,5],|\\ \verb| "tmp2=mean",["tmp1"],|\\ \verb| "tmp3=var",["tmp1"],|\\ \verb| "tmp2::tmp3::tmp1",[]|\\ \verb| ];|\\ \verb| CalcbyR("rd",cmdL);|\\ \verb| dt=rd_(3..length(rd));|\\ \verb| nn=length(dt);|\\ \verb| mx=rd_1;|\\ \verb| vx=rd_2*(nn-1)/nn;|\\ \verb| sx=sqrt(vx);|\\ \verb| println(dt);|\\ \verb| println(["m="+format(mx,4),"v="+format(vx,4)]);|\\ \verb| Setscaling(1/5);| create a histogram for the data, \verb|Breaks=seq(0,14,1)| specifies the bin size.\\ \verb| Histplot("1",dt,["Breaks=seq(0,14,1)","dr,0.5"]);|\\ \begin{center} \input{Fig/poison01} \end{center} generate 2000 random samples from the Poisson distribution and calculate 200 sample means in 10 samples.\\ \verb| cmdL=[|\\ \verb| "tmp1=rpois",[2000,5],|\\ \verb| "tmp2=c()",[],|\\ \verb| "for(k in 1:200){",[],|\\ \verb| " tmp=tmp1[(10*(k-1)+1):(10*k)]",[],|\\ \verb| " tmp2=c(tmp2,mean(tmp))",[],|\\ \verb| "}",[],|\\ \verb| "=tmp2",[]|\\ \verb| ];|\\ \verb| CalcbyR("rd2",cmdL);|\\ \verb| Setscaling(1/10);|\\ \verb| Histplot("2",rd2);|\\ \end{cmd} %-------------Boxplot------------------------------- \begin{cmd}{Boxplot}{boxplot} \itemket{Usage}Boxplot(name, data, vertical position, height of box,options); \itemket{Description}draw boxplots \itemket{Examples}\mbox{} draw a boxplot of 100 uniform random numbers less than 5. \verb| dt1=apply(1..100,5*random());|\\ \verb| Boxplot("1",dt1,1,1/2);| \begin{center} \input{Fig/boxplot01} \end{center} read an external data file in csv format and draw a boxplot of the data. \verb| Boxplot("2","datafile.csv",3,1/2);| You can read a csv file with more than one column using \verb|Readcsv|. The csv flie should be stored in current working folder (defalut is fig folder). Using \verb|Framedata| and \verb|Rulerscale| together, you can mark with a scale. Before you use \verb|Framedata|, you need to take two diagonal points of the drawing area on the Euclidean view. \verb| data=Readcsv("datafile.csv");|\\ \verb| dt1=apply(data,#_1);|\\ \verb| dt2=apply(data,#_2);|\\ \verb| Boxplot("1",dt1/20,1,1/2);|\\ \verb| Boxplot("2",dt2/20,3,1/2);|\\ \verb| Framedata("1",[A,B],["corner"]);|\\ \verb| Rulerscale(A,["r",0,6,1],["f",1,"\mbox{dt1}",3,"\mbox{dt2}"]);| \begin{center} \input{Fig/boxplot} \end{center} \end{cmd} %-------------Histplot------------------------------- %\newpage \begin{cmd}{Histplot}{histplot} \itemket{Usage}Histplot(name,data,options) \itemket{Description}create histograms. \itemket{Details}data is given in a list or read an external data file in csv format.\\ Return value is list of breaks and frequency. You can specify the breaks as a vector of points to get exactly what is wanted, for example\\ \hspace{20mm} \verb|"Breaks=[0,10,20,30,40,50,60]"| .\\ The Sturges algorithm is the default.\\ Other options:\\ \verb|"Rel=yes/no"| : draw a histogram of proportions or frequencies (default is no)\\ \itemket{Examples} \mbox{} Read the data file in csv format (datafile.csv) and create a histogram of the data in a frame with a scale.\\ \verb| Addax(0);|\\ \verb| Setscaling(5);|\\ \verb| Setunitlen("0.6mm");|\\ \verb| data=Readcsv("datafile.csv");|\\ \verb| Histplot("1",data,[""]);|\\ \verb| Framedata("1",[A,B],["corner"]);|\\ \verb| Rulerscale(A,["r",0,100,10],["r",0,15,5]);|\\ \begin{center} \input{Fig/histgram} \end{center} \end{cmd} %------------PlotdataR-------------------------------- \begin{cmd}{PlotdataR}{plotdatar} \itemket{Usage}PlotdataR(name,formula,var) \itemket{Description}Draw graph of R's statistical probability function. \itemket{Details}Draw graphs of functions not built-in Cindyscript. \itemket{Examples} \mbox{} Example1\\ draw graphs of the probability density function (p.d.f.) and the cummulative distribution function of $N(5,2^2)$.\\ \verb| PlotdataR(“1”, “dnorm(x,5,2)”, ”x=[0,10]”); |\\ \verb| PlotdataR(“2”, ”pnorm(x,5,2)”, ”x=[0,10]”);| %\vspace{\baselineskip} \begin{center} \input{Fig/plotdatar1} \end{center} Example2\\ 1. draw a graph of the p.d.f. of standard normal distribution.\\ 2. shade the region under the graph and above x-axis to the left of \verb|A.x|.\\ 3. find the area of the shaded region.\\ \verb| PlotdataR("1","dnorm(x)","x=[-5,5]",["Num=100"]); |\\ \verb| Putpoint("A",[0,0],[A.x,0]); |\\ \verb| Lineplot("1",[A,A+[0,1]],["nodisp"]); |\\ \verb| Putintersect("B","grR1","ln1"); |\\ \verb| Listplot("1",[A,B]); |\\ \verb| Listplot("2",[[-5,0],[5,0]],"nodisp"); |\\ \verb| Enclosing("1",["Invert(grR1)","sg2","sg1"],[B,"notex"]); |\\ \verb| Shade(["en1"],["Color=[0.2,0,0,0]"]); |\\ \verb| tmp=0.5+Integrate("grR1",[0,A.x]); |\\ \verb| Expr([A,"s",text(A.x),C,"e","P="+text(tmp)]); | %\vspace{\baselineskip} \begin{center} \input{Fig/rshade} \end{center} \end{cmd} %--------------PlotdiscR------------------------------ \begin{cmd}{PlotdiscR}{plotdiscr} \itemket{Usage}PlotdiscR(name,fromaula,var) \itemket{Description}draw graphs of discrete distributions by calling R’s built-in functions. \itemket{Details}The "d" functions in R to draw graphs of discrete distributions:\\ dbinom (binomial distribution), dpois (poisson distribution), dgeom (geometric distribution), etc. \itemket{Examples} \mbox{} The normal distribution with the same mean and standard deviation as the binomial distribution\\ \verb| Setscaling(20);|\\ \verb| PlotdiscR("1","dbinom(k,10,0.4)","k=[0,10]");|\\ \verb| PlotdataR("1","dnorm(x,10*0.4,sqrt(10*0.4*0.6))","x=[0,10]",["do"]);| \begin{center} \input{Fig/binvsnormal} \end{center} Example2 \verb| PlotdiscR("2","dpois(k,4)","k=[0,10]");|\\ \verb| PlotdiscR("3","dgeom(k,0.3)","k=[0,10]");| \end{cmd} %------------Scatterplot-------------------------------- \begin{cmd}{Scatterplot}{scatterplot} \itemket{Usage}Scatterplot(name,filename/datalist,options1,options2) \itemket{Description}This command draw scatter plot reading a csv file. \itemket{Details} Datafile is next style csv format. \begin{verbatim} 2.3, 4.5 (LF) 3.2, 7 (LF) 2.0, 6.8 (LF) \end{verbatim} If 2nd argment is datalist, next format. \begin{verbatim} data=[[2.3,4.5],[3.2,7],[2.0,6.8], ・・・ ]; \end{verbatim} Options1 are switch of draw the regression line or no , style of point.\\ \verb|"Reg=yes(no:default)"| to decide whether to draw the regression line.\\ Options2 are position of drawing the regression line and style of line.\\ Position is coordinate or name of point. \itemket{Examples}\mbox{} \verb| Scatterplot("1","data.csv",["Size=4","Color=blue"],[A,"Color=green"]);|\\ \verb| Listplot("1",[[0,7],[0,0],[7,0]]);|\\ \verb| Rulerscale([0,0],["r",0,7,1],["r",1,7,1]);| \begin{center} \input{Fig/scatter} \end{center} \end{cmd} %\newpage %========= Maxima ======= \subsection{Maxima} %------------CalcbyM-------------------------------- \begin{cmd}{CalcbyM}{calcbym} \itemket{Usage}CalcbyM(name, command,options) \itemket{Description}Maxima's script execution \itemket{Details}The second argument is a command to be executed by Maxima.\\ Create a list (eg. cmdL) consisting of a repetition of commands and argument lists, and execute at once.\\ There is no return value. For the result (of undefined value), the value of the variable of the command list last described (argument is the empty list) is assigned to the variable specified by "name". When you want to return more than one result, if you describe it by separating it with "::", it will be substituted into the list. \itemket{Examples} \mbox{} Example1: derivative \verb| cmdL=[ |\\ \verb| "f:sin(x)", [], |\\ \verb| "df:diff",["sin(x)","x"], |\\ \verb| "f::df",[] |\\ \verb| ]; |\\ \verb| CalcbyM("fdf",cmdL); |\\ \verb| println(fdf); |\\ Example2: solution of quadratic equation \verb| cmdL=[ |\\ \verb| "ans:solve",["x^2-x-4","x"], |\\ \verb| "ans",[] |\\ \verb| ]; |\\ \verb| CalcbyM("ans",cmdL); |\\ \verb| println("ans="+ans); |\\ Example3: \verb| fx="(exp(x)+exp(-x))/2"; |\\ \verb| cmdL=[ |\\ \verb| "df:diff",[fx,"x"], |\\ \verb| "c:ev",["df","x=a"], |\\ \verb| "b:ev",[fx,"x=a"], |\\ \verb| "eq:c*(x-a)+b",[], |\\ \verb| "eq",[] |\\ \verb| ]; |\\ \verb| CalcbyM("tn1",cmdL); |\\ \verb| tn1=Assign(tn1,["%e^a","exp(a)","%e^-a","exp(-a)"]); |\\ \verb| Plotdata("1",fx,"x"); |\\ \verb| PutonCurve("A","gr1"); |\\ \verb| tmp=Assign(tn1,["a",A.x]); |\\ \verb| plotting data("2",tmp,"x",["Num=2"]); |\\ \verb| Letter([A,"se","A"]);| %\newpage Example4: Parametric \verb| fn="3*cos(t)^2*[cos(t),sin(t)]";|\\ \verb| cmdL=[|\\ \verb| "f:",[fn], |\\ \verb| "df:diff",["f","t"], |\\ \verb| "df:trigsimp",["df"], |\\ \verb| "tn:f+s*df",[], |\\ \verb| "tn",[] |\\ \verb| ]; |\\ \verb| CalcbyM("tn2",cmdL); |\\ \verb| Paramplot("1",fn,"t=[0,2*pi]",["Num=100"]); |\\ \verb| gn=Assign(tn2,["t",A.x]); |\\ \verb| Paramplot("2",gn,"s=[-3,3]"); |\\ \begin{minipage}{65mm} \begin{center} \input{Fig/maxfun01}\\ Example3 \end{center} \end{minipage} \begin{minipage}{65mm} \begin{center} \vspace*{5mm} \input{Fig/maxfun02}\vspace{10mm}\\ Example4 \end{center} \end{minipage} \end{cmd} %-------------Mxbatch------------------------------- \begin{cmd}{Mxbatch}{mxbatch} \itemket{Usage}Mxbatch(filename) \itemket{Description}Creation command to execute Maxima file \itemket{Details}Create a command for CalcbyM to execute the file in ketcindy/ketlib/maximaL. ketcindy/ketlib/maximaL contains three files: fourier\_sec.max, matoperation.max and poincare.mac. For example, when dealing with Fourier series, use fourier\_sec.max. \itemket{Examples} \mbox{} \verb| Setax(["a"]); |\\ \verb| Slider("A-C-B",[-5.5,-1.5],[4.5,-1.5]); |\\ \verb| defL=["1",[-3,-2],1,"0",[-2,-1],1,"-x",[-1,1],1,"0",[1,2],1,"-1",[2,3],1]; |\\ \verb| Drwxy(); |\\ \verb| tmp=Periodfun(defL,1,["dr,2","Color=red"]); |\\ \verb| fun=tmp_1; |\\ \verb| per=tmp_2; |\\ \verb| Htickmark([1,"n","1",2,"n","2",3,"nw","3"]); |\\ \verb| Htickmark([-1,"-1",-2,"-2",-3,"-3"]); |\\ \verb| cmdL=Concat(Mxbatch("fourier_sec"),[ |\\ \verb| "Ffun(x):="+fun,[], |\\ \verb| "c:fourier_sec_coeff",["Ffun(x)","x"], |\\ \verb| "c[1]::c[2]::c[3]",[] |\\ \verb| ]); |\\ \verb| CalcbyM("ans",cmdL,[]); |\\ \verb| nterm=round(4*(C.x-A.x)); |\\ \verb| Fourierseries("1",ans,per,nterm,["Num=400"]); |\\ \verb| Mxtex("2",ans_3); |\\ \verb| Expr([[-5,-2],"e","s_n="+tx2,[4,-2],"e","n="+text(nterm)]); | %\vspace{\baselineskip} %\hspace{20mm}\input{Fig/mxbatch}\vspace*{12mm} \begin{center} \input{Fig/mxbatch}\vspace{3mm} \end{center} \end{cmd} %-------------Mxfun------------------------------- \begin{cmd}{Mxfun}{mxfun} \itemket{Usage}Mxfun(name,formula,list,options) \itemket{Description}Execution of Maxima's function \itemket{Details}The second argument "formula" is Maxima's function name. The third argument "list" is a list of arguments to pass to the function. \\ The return value is a string if there is at least one character in the expression of the second argument. In the case of all numbers (including +, -, .), it becomes a number if it is 16 or less digits, and it becomes a string if it is more than 16 digits. Also, the return value is also assigned to the variable "mxname".\\ If "Disp = no" is added to the option, the result is not displayed on the console. \itemket{Examples} \mbox{} \verb| Mxfun("1","taylor",["sin(x)","x",0,7],[""]); |\\ \verb| Plotdata("1","sin(x)","x",["da"]); |\\ \verb| Plotdata("2",mx1,"x"); | \vspace{\baselineskip} \hspace{20mm} \input{Fig/taylor}\\ \end{cmd} %------------Mxtex-------------------------------- \begin{cmd}{Mxtex}{mxtex} \itemket{Usage}Mxtex(name, formula) \itemket{Description}Conversion of expression to TeX format \itemket{Details}The second argument "formula" is the expression directly written or the return value of Mxfun. Convert it to TeX format.\\ The return value is also assigned to the variable "txname". \itemket{Examples} \mbox{} Example1 \verb| fx="x^3/((x+1)*(x+2))"; |\\ \verb| pfx=Mxfun("1","partfrac",[fx,"x"]); |\\ \verb| form=Mxtex("1",fx)+"="+Mxtex("2",pfx); |\\ \verb| dform=Assign(form,["frac","dfrac"]); |\\ \verb| Expr([0,3],"e",form); |\\ \verb| Expr([0,1],"e",dform); |\\ \includegraphics[bb=0.00 0.00 240.01 115.51,width=70mm]{Fig/mxtex01E.pdf} \input{Fig/mxtex02} \vspace{\baselineskip} Example2 \begin{minipage}[t]{65mm} \verb| fx="x^2-x-3"; |\\ \verb| cmdL=[ |\\ \verb| "ans:solve",[fx,"x"], |\\ \verb| "ans",[] |\\ \verb| ]; |\\ \verb| CalcbyM("ans",cmdL); |\\ \verb| p1=indexof(ans,"["); |\\ \verb| p2=indexof(ans,","); |\\ \verb| p3=indexof(ans,"]"); |\\ \verb| s1=substring(ans,p1,p2-1); |\\ \verb| s2=substring(ans,p2,p3-1); |\\ \verb| s1=replace(s1,"x =",""); |\\ \verb| s2=replace(s2,"x =",""); |\\ \verb| Mxtex("1",s1); |\\ \verb| Mxtex("2",s2); |\\ \verb| Plotdata("1",fx,"x"); |\\ \verb| Expr([-2,-0.5],"e",tx1); |\\ \verb| Expr([2,-0.5],"e",tx2); |\\ \end{minipage}\hspace{5mm}% \begin{minipage}[t]{65mm} \mbox{}\vspace{20mm} \input{Fig/mxtex03} \end{minipage} \end{cmd} %========= Risa/Asir ======= \subsection{Risa/Asir} %------------CalcbyA-------------------------------- \begin{cmd}{CalcbyA}{calcbya} \itemket{Usage}CalcbyA(name, command,options) \itemket{Description}Risa/Asir's script execution \itemket{Details}The second argument is a command to be executed by Risa/Asir.\\ Create a list (eg. cmdL) consisting of a repetition of commands and argument lists, and execute at once.\\ There is no return value. The result (of undefined value) is assigned to the variable specified by "name", the value of the variable of the command list last described (argument is the empty list). If you want to return more than one result, if you describe it by separating it with "::", it will be substituted into the list. %\itemket{Examples} \mbox{} \end{cmd} %-------------Asirfun------------------------------- \begin{cmd}{Asirfun}{asirfun} \itemket{Usage}Asirfun(name, formula, list,options) \itemket{Description}Execution of Risa/Asir's function \itemket{Details}The second argument "formula" is the function name of Risa/Asir. The third argument "list" is a list of arguments to pass to the function.\\ The return value is a string if there is at least one character in the expression of the first argument. In case of all numbers (including +, -, .), it becomes a number if it is 16 digits or less, and it becomes a string if it is more than 16 digits. Also, the return value is also assigned to the variable "asname".\\ If "Disp = no" is added to the option, the result is not displayed on the console. %\itemket{Examples} \mbox{} \end{cmd} %========= MeshLab ======= \subsection{MeshLab} Write next script in Initialization slot for use \ketcindy\ 3D. \\ \verb| Ketinit();|\\ \verb| Ketinit3d();| %--------------Mkobjcmd------------------------------ \begin{cmd}{Mkobjcmd}{mkobjcmd} \itemket{Usage}Mkobjcmd(name,formula,option) \itemket{Description}generate commands for obj formatted files of surfaces without thickness. %%\itemket{Details} \itemket{Examples} \mbox{} \verb| fd=[ "z=x^2-y^2","x=[-1,1]","y=[-1,1]"," "]; |\\ \verb| Sf3data("1",fd); |\\ \verb| Windispg(); |\\ \verb| Mkobjcmd("1",fd,[40,40,"-"]); |\\ \verb| Meshlab():=( |\\ \verb| Mkviewobj("saddle",oc1, ["m","v"]); |\\ \verb| ); | Option ``$+$" is for the left figure, and ``$-$" for the right. \hspace{10mm} \includegraphics[bb=0 0 679.53 263.51 , width=12cm]{Fig/meshlab01.pdf} \end{cmd} %-------------Mkobjcrvcmd------------------------------- \begin{cmd}{Mkobjcrvcmd}{mkobjcrvcmd} \itemket{Usage}Mkobjcrvcmd(name,PD,option) \itemket{Description}generate commands for obj formatted files of spatial curves. %%\itemket{Details} \itemket{Examples} \mbox{} \verb| Spacecurve("1","[(6*pi-t)/(6*pi)*cos(t),(6*pi-t)/(6*pi)*sin(t),0.1*t]", |\\ \verb| "t=[0,6*pi]",["Num=200"]); |\\ \verb| Windispg(); |\\ \verb| Mkobjcrvcmd("1","sc3d1",[0.1,8,"yz"]); |\\ \verb| Meshlab():=( |\\ \verb| Mkviewobj("spiral",oc1,["m","v"]); |\\ \verb| ); | \hspace{10mm} \includegraphics[bb=0 0 614.53 236.51 , width=12cm]{Fig/meshlab02.pdf} \end{cmd} %--------------Mkobjnrm------------------------------ \begin{cmd}{Mkobjnrm}{mkobjnrm} \itemket{Usage}Mkobjnrm(name,formula) \itemket{Description}calculate normal vector of surface. \itemket{Details}Normal vector is calculated using the formula of surface. \itemket{Examples} \mbox{} \verb| Mkobjnrm("1","[x,y,x*y/sqrt(x^2+y^2)],x,y"); |\\ \end{cmd} %--------------Mkobjplatecmd------------------------------ \begin{cmd}{Mkobjplatecmd}{mkobjplatecmd} \itemket{Usage}Mkobjplatecmd(name,facedata,options) \itemket{Description}generate commands for obj formatted files of plates. %%\itemket{Details} \itemket{Examples} \mbox{} \verb| Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]"); |\\ \verb| p1=[2,0,0]; |\\ \verb| p2=[0,2,0]; |\\ \verb| p3=[0,0,2]; |\\ \verb| plane=[[p1,p2,p3],[[1,2,3]]]; |\\ \verb| Mkobjplatecmd("1",plane,[0.05]); |\\ \verb| Mkobjcrvcmd("2","ax3d"); |\\ \verb| Mkviewobj("plane",Concatcmd([oc1,oc2]),["m","v"]);| \begin{center} \includegraphics[bb=0 0 287.01 228.01 , width=50mm]{Fig/meshlab03.pdf} \end{center} \end{cmd} %-------------Mkobjpolycmd------------------------------- \begin{cmd}{Mkobjpolycmd}{mkobjpolycmd} \itemket{Usage}Mkobjpolycmd(name,PD,options) \itemket{Description}generate commands for obj formatted files of polyhedra. %%\itemket{Details} \itemket{Examples} \mbox{} \verb| Setdirectory(Dirhead+"/data/polyhedrons_obj"); |\\ \verb| polydt=Readobj("r01.obj",["size=-3.5"]); |\\ \verb| Setdirectory(Dirwork); |\\ \verb| pd=VertexEdgeFace("1",polydt,["Pt=fix","Edg=nogeo"]); |\\ \verb| Mkobjpolycmd("1",pd,[[0,0,0]]); |\\ \verb| Mkviewobj("plane",oc1,["m","v"]); | %% Setobj(Fhead,["m","v"]); The polyhedron obj data is downroaded from\\ \hspace*{20mm}\url{http://mitani.cs.tsukuba.ac.jp/polyhedron/} \end{cmd} %--------------Mkobjsymbcmd------------------------------ \begin{cmd}{Mkobjsymbcmd}{mkobjsymbcmd} \itemket{Usage}Mkobjsymbcmd(PD,real,real,vector,vector) \itemket{Description}generate commands for obj formatted files of some characters. \itemket{Details}Ploting data are available for characters $x$, $y$, $z$, $t$, $n$, P, Q, and R. The arguments are their siizes, angles of rotations, directions of the viewpoints, positions. \itemket{Examples} \mbox{} \verb| Mkobjsymbcmd("P",0.5,pi/3,[0,-1,0],[0,0,6]); |\\ \verb| Mkobjsymbcmd("x",0.5,0,[0,-1,0],[6,0,0]); |\\ \verb| Circledata("1",[[0,0],[1,0]],["nodisp"]); |\\ \verb| Mkobjsymbcmd("cr1",0.5,0,[0,-1,0],[0,5,0]); | \end{cmd} %-------------Mkobjthickcmd------------------------------- \begin{cmd}{Mkobjthickcmd}{mkobjthickcmd} \itemket{Usage}Mkobjthickcmd(name,formula) \itemket{Description}generate commands for obj formatted files of surfaces with thickness. %%\itemket{Details} \itemket{Examples} \mbox{} This function uses Maxima. \verb| fd=[ |\\ \verb| "z=(x^2+y^2)",|\\ \verb| "x=R*cos(T)","y=R*sin(T)",|\\ \verb| "R=[0,2]","T=[0,2*pi]","e"|\\ \verb| ];|\\ \verb| Mkobjthickcmd("1",fd,[40,40,0.2,"+n+s-e-w+","assume(R>0)"]);|\\ \verb| Mkviewobj("pala",oc1,["m","v","Wait=5"]); |\\ \begin{center} \includegraphics[bb=0 0 287.01 189.01 , width=5cm]{Fig/meshlab06.pdf} \end{center} \end{cmd} %---------------Mkviewobj----------------------------- \begin{cmd}{Mkviewobj}{mkviewobj} \itemket{Usage} Mkviewobj(name,PD,options) \itemket{Description}generate obj formatted files. \itemket{Details}options \begin{tabbing} 12345678901234567890\=\kill "m" or "make" \> for generating data \\ "v" or "view" \> for starting meshlab and viewing\\ "W=n" or "Wait=n" \> for setting culculate time\\ "Unit=mm" \> for setting unit of length \\ \>\\ \end{tabbing} %\itemket{Examples} \mbox{} \end{cmd} \newpage %=========== Animation =============== \section{Animation} \vspace{\baselineskip} \hspace{10mm} \includegraphics[bb=0 0 732.04 376.02 , width=12cm]{Fig/mvgaiyou01.pdf} Operation of Buttons. \begin{tabbing} 1234\=12345678\=1234567897890123456\=\kill \> Figure \> Viewtex(); \> Making figure.tex\\ \> Parent \> same code \>Making figure.pdf by Figpdf() \\ \> ParaF \> Parafolder(); \> Making data folder of animation data\\ \> Anime \> Mkanimation(); \> Making flip animation\\ \> Flip \> Mkflipanime(); \>Making animation \end{tabbing} %---------------Setpara----------------------------- \begin{cmd}{Setpara}{setpara} \itemket{Usage}Setpara(fname,funcstr,range,options1,options2) \itemket{Description}Set up the animation control system. \itemket{Details}"fname" is the name of output file. "funcstr" is the name of animation function. "range" is the range of parameter.\\ options1 \begin{tabbing} 1234567890123\=90123456789012345678\=\kill m/r \> Remake the new data file / Reread the existing data file (default=r)\\ Div=n \> Total number of frames (default n=25). \end{tabbing} options2 \begin{tabbing} 1234567890123\=90123456789012345678\=\kill Frate=n \> Number of frames per second (default n=20)\\ Title=str \> Title\\ Scale=n \> Magnification factor of the figures\\ opA \> option for animate.sty\\ \> loop: loop, controls: Show control button, buttonsize\\ \> step: Mode of frame feed/frame retrun\\ \> Default is \verb|"OpA=[loop,controls,buttonsize=3mm]"|\\ \> Use "+" then you can add a mode, for example \verb|"OpA=+step"| then we have\\ \> \verb|"OpA=[loop,controls,buttonsize=3mm,step]"| \end{tabbing} \itemket{Examples} \mbox{} \verb| Slider("A-C-B",[0,YMIN-1],[2*pi,YMIN-1]); |\\ \verb| Setax(["","","sw","","sw"]); |\\ \verb| Circledata("1",[[0,0],[0,2]]); |\\ \verb| mf(t):=( |\\ \verb| pt=2*[cos(t),sin(t)]; |\\ \verb| mp=(pt+[4,0])/2; |\\ \verb| Listplot("1",[[4,0],pt]); |\\ \verb| Pointdata("1",[mp,pt],["Size=2"]); |\\ \verb| if(t==0, |\\ \verb| ptlist=[mp]; |\\ \verb| , |\\ \verb| ptlist=append(ptlist,mp); |\\ \verb| ); |\\ \verb| Pointdata("2",ptlist,["Size=2","Color=red"]); |\\ \verb| Letter([[4,0],"s","A",pt,"en","P",mp,"ne","Q"]); |\\ \verb| ); |\\ \verb| Setpara("middle","mf(t)","t=[0,4*pi]"); |\\ \verb| mf(C.x); | \vspace{\baselineskip} \hspace{20mm} \includegraphics[bb=0.00 0.00 608.03 367.02,width=8cm]{Fig/moviedata01.pdf} When we make the animation, comment out \verb|//mf(C.x);| and click the Anime button. The following figure is the first page of the animatemiddle.pdf file. \hspace{30mm}\includegraphics[bb=0.00 0.00 470.02 394.02,width=6cm]{Fig/moviedata02.pdf} The animation is continued for 5 seconds with the following options.\\ \verb| Setpara("middle","mf(t)","t=[0,4*pi]",["Div=30"],["Frate=6"]);|\\ A smooth-looking animation is achieved with the options: \verb|["Div=150"],["Frate=30"]|. \end{cmd} \newpage %============== Slide ================== \section{\ketcindy\ Slide} %------------Setslidebody-------------------------------- \begin{cmd}{Setslidebody}{setslidebody} \itemket{Usage}Setslidebody(bodycolor,bodystyle,density) \itemket{Description}Set up the color and density of the letters in slide body.\\ \itemket{Details}Meanings and defaults of options are\\ \Ltab{25mm}{bodycolor}\Ltab{50mm}{color of letters}\verb|"blue"|\\ \Ltab{25mm}{bodystyle}\Ltab{50mm}{style of letters}\verb|"\Large\bf\boldmath"|\\ \Ltab{25mm}{density}\Ltab{50mm}{density of thin letters}\verb|0.1|\ (The range is from 0 to 1).\\ \hspace{10mm}Remark : density can be changed by \verb|\setthin{density}| in the text file. \end{cmd} %------------Setslidehyper------------------------------- \begin{cmd}{Setslidehyper}{setslidehyper} \itemket{Usage}Setslidehyper("dvipdfmx",options) \itemket{Description}Use \verb|hyperref.sty|. \itemket{Details}if the 1st argument is null, it will be replaced with "dvipdfmx".\\ options : \verb|["cl=true,lc=blue,fc=blue","Pos=[125,73]","Size=1"]|\\ Meanings and defaults of options are\\ \\ \Ltab{25mm}{"cl=..."}\Ltab{50mm}{colorlinks}\verb|cl=true|\\ \Ltab{25mm}{"lc=..."}\Ltab{50mm}{linkcolor}\verb|lc=blue|\\ \Ltab{25mm}{"fc=..."}\Ltab{50mm}{filecolor}\verb|fc=blue|\\ \Ltab{25mm}{"Pos=..."}\Ltab{50mm}{start position of buttons}\verb|"Pos=[125,73]"|\\ \Ltab{25mm}{"Size=..."}\Ltab{50mm}{size of buttons}\verb|"Size=1"|.\\ \end{cmd} %------------Setslidemain------------------------------- \begin{cmd}{Setslidemain}{setslidemain} \itemket{Usage}Setslidemain([letterc,boxc,framec,xpos,size]); \itemket{Description}Set up the main slide (a section delimiter). \itemket{Details}Meanings and defaults of options are\\ \Ltab{25mm}{letterc}\Ltab{50mm}{color of letters}\verb|[0.98,0.13,0,0.43]|\\ \Ltab{25mm}{boxc}\Ltab{50mm}{color of box}\verb|[0,0.32,0.52,0]|\\ \Ltab{25mm}{framec}\Ltab{50mm}{color of frame}\verb|[0,0.32,0.52,0]|\\ \Ltab{25mm}{xpos}\Ltab{50mm}{horizontal position of title}\verb|62|\\ \Ltab{25mm}{size}\Ltab{50mm}{magnification of title}\verb|2|. \itemket{Remark}If some arguments are null, the defaul is used.\\ \hspace*{10mm}\verb|Setslidemain([,,,,3]);| \end{cmd} %------------Setslidepage------------------------------ \begin{cmd}{Setslidepage}{setslidepage} \itemket{Usage}Setslidepage([letterc,boxc,framec,shadowc,xpos,size]); \itemket{Description}Set up each page of slides. \itemket{Details}Meanings and defaults of options are\\ \Ltab{25mm}{letterc}\Ltab{50mm}{color of letters}\verb|[0.98,0.13,0,0.43]|\\ \Ltab{25mm}{boxc}\Ltab{50mm}{color of box}\verb|[0,0.32,0.52,0]|\\ \Ltab{25mm}{framec}\Ltab{50mm}{color of frame}\verb|[0,0.32,0.52,0]|\\ \Ltab{25mm}{shadowc}\Ltab{50mm}{color of shadow}\verb|[0,0,0,0.5]|\\ \Ltab{25mm}{xpos}\Ltab{50mm}{horizontal position of title}\verb|6|\\ \Ltab{25mm}{size}\Ltab{50mm}{magnification of title}\verb|1.3|. \itemket{Remark}If some arguments are null, the defaul is used.\\ \hspace*{10mm}\verb|Setslidepage([,"red"]);| \end{cmd} %------------Setslidemargin----------------------------- \begin{cmd}{Setslidemargin}{setslidemargin} \itemket{Usage}Setslidepage([leftmarginchange,topmarginchange]); \itemket{Description}This function changes the margin of slides from the default. \itemket{Example}Setslidemargin([+5,-10]); \end{cmd} %------------Settitle------------------------------ \begin{cmd}{Settitle}{settitle} \itemket{Usage}Settitle(list of title components,options) \itemket{Description}Make a title slide. \itemket{Details}Meanings and defaults of options are\\ \Ltab{25mm}{"Title=..."}\Ltab{50mm}{name of the title file}\verb|"Title=slide0"|\\ \Ltab{25mm}{"Layery=..."}\Ltab{50mm}{starting vertical position}\verb|"Layery=0"|\\ \Ltab{25mm}{"Color=..."}\Ltab{50mm}{color of letters}\verb|"Color=blue"|. \itemket{Examples} \mbox{}\\ \hspace{10mm}\verb| Settitle([ |\\ \hspace{10mm}\verb| "s{60}{20}{Main Title}", |\\ \hspace{10mm}\verb| "s{60}{50}{Name}", |\\ \hspace{10mm}\verb| "s{60}{60}{Affiliation}", |\\ \hspace{10mm}\verb| "s{60}{70}{Info}" |\\ \hspace{10mm}\verb| ],|\\ \hspace{10mm}\verb| ["Title=SlideA","Color=[1,1,0,0]"]|\\ \hspace{10mm}\verb| );| \end{cmd} \newpage %========== 3D ========= \section{\ketcindy 3D} \subsection{Screen} The screen of KETCindy3D is structured as follows. There are two areas surrounded by a white rectangle on the drawing surface of Cinderella. The area on the left side where the NE and the SW are diagonal is referred to as the main screen, and the area on the right side is referred to as the sub screen. \vspace{\baselineskip} \begin{center} \includegraphics[bb=0 0 879.05 447.02 , width=8cm]{Fig/3dstart.pdf} \end{center} As in the case of a flat surface, the main screen shows the range output to TeX and it can be changed by dragging two points of NE and SW. The viewpoint can be moved with the slider below the main screen, and the axis rotates on the main screen. You can think of the sub screen as a viewpoint placed on the xy plane. When you draw points and line segments with Cinderella's drawing tool on the main screen, points corresponding to the secondary screen are drawn. You can change the x, y coordinates by dragging the point on the main screen, and drag the point on the sub screen to change the z coordinate. \vspace{\baselineskip} \begin{center} \includegraphics[bb=0.00 0.00 863.04 378.52 , width=10cm]{Fig/3dscreen.pdf} \end{center} KeTCindy3D performs hidden line processing on lines and surfaces. Hidden line processing speeds up processing in cooperation with C language. It is necessary to develop an environment that uses C language, but now it is standardized. If you can not use C language, you will use a function to compute with R, but in that case it will take quite a while. \subsection{Setting and Defining} %------------Ketinit3d-------------------------------- \begin{cmd}{Ketinit3d}{ketinit3D} \itemket{Usage}Ketinit3d() \itemket{Description}Declare the use of KeTCindy3D \itemket{Details}Euclidean view of Cinderella becomes 3D mode. Two sliders are created to indicate the viewing angle TH($\theta$), FI($\phi$). The initial values are $\mathrm{TH}=0$ and $\mathrm{FI}=0$.\\ \textcolor{red}{Caution} This funcition and Ketinit() have to write on Initializaiton slot. \itemket{Remark}If \verb|Ketinit3d(0)| is used, the subscreen is not displayed. Ketinit () is also placed in the Initialization Slot, unlike 2D. \end{cmd} %------------ Setangle -------------------------------- \begin{cmd}{Setangle}{setangle} \itemket{Usage}Setanlge(TH,FI) \itemket{Description}Specify rotation angle \itemket{Details}Specify the TH and FI values of the slider that determines the rotation angle (position of the viewpoint).\\ For example, if you set \verb| Setangle (70,40) |, then TH and FI are in that position. Since the slider is fixed, if you want to activate the slider again, comment it and re-execute it.\\ If you want to decide only the initial state\\ \verb| if (!Ptselected (), Setangle (70, 40))|;\\ or\\ \verb| if (!Isangle (), Setangle (70, 40));|\\ The slider becomes effective. If any point on the slider is selected, the figure button is also valid. Click anywhere on the screen and return to the original if you deselect the point selection state. \end{cmd} %------------ Getangle -------------------------------- \begin{cmd}{Getangle}{getangle} \itemket{Usage}Getanlge() \itemket{Description}Acquire rotation angle \itemket{Details}Acquires the rotation angle (viewpoint position) TH and FI that can be set with the slider. This is the value displayed on the left side of the slider. The return value is the list [TH, FI], and the angle is expressed by the Degree measure. In addition, the internal variables are THETA and PHI, expressed in circular measure. \end{cmd} %------------Start3d-------------------------------- \begin{cmd}{Start3d}{start3d} \itemket{Usage}Start3d(option) \itemket{Description}3d function to initialize limited variables. \itemket{Details} This funcition should be written at the beginning of Draw slot.\\ The option is a list of geometric points which are not regarded as 3D points. \itemket{Example}\mbox{}\\ If option is given a list of exclusion points, that point is not a point of space. (The position does not change even if moving the viewpoint with the slider) \verb|Start3d([A,B,C]);|\\ \verb|Slider("A-C-B");| // A,C,B should not be 3D points.\end{cmd} %--------------Startsurf------------------------------ \begin{cmd}{Startsurf}{startsurf} \itemket{Usage}Startsurf(options) \itemket{Description}Defines values related to surface rendering. \itemket{Details}Values are number to divide, size of C, limit of error. Omitted options selects [50,50],[1500,500,200],[0.01,0.1].\\ Drawing of a curved surface with hidden line processing is performed in the following procedure.\\ (1) Startsurf();\\ (2) Making data wtih draw function.\\ (3) Draws shapes in batch in C language using function ExeccmdC();. %\itemket{Examples} \mbox{} \end{cmd} %-------------Xyzax3data------------------------------- \begin{cmd}{Xyzax3data}{xyzax3data} \itemket{Usage} Xyzax3data(name, range of x, range of y, range of z, options) \itemket{Description}Generic function to draw the coordinate axis. \itemket{Details}Name can be null string.\\ Options are the followings.\\ "an": arrowhead, n is size.\\ "Onesw": origin and its position. \itemket{Examples} \mbox{} \verb|Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]");|\\ \verb|Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]","a");| //arrowhead\\ \verb|Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]",["a2"]);| //big arrowhead\\ \verb|Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]",["O"]);|\\ \verb|Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]",["a","Oe2n2"]);| //set origin upper right \end{cmd} \newpage %================== 3D Drawing =============== \subsection{Command for Drawing} \subsubsection{Point and line} %--------------Drawpoint3d------------------------------ \begin{cmd}{Drawpoint3d}{drawpoint3d} \itemket{Usage}Drawpoint3d(list of coordinates) \itemket{Description}Generic function to draw 3D-points. \itemket{Details}These points are not geometric point. To convert the geometric point, use \hyperlink{putpoint3d}{Putpoint3d()}. To output in the \TeX file, use \hyperlink{pointdata}{Pointdata()} or \hyperlink{drwpt}{Drawpoint()}. \itemket{Examples} \mbox{} \verb| Drawpoint3d([1,1,1]); |\\ \verb| Drawpoint3d([[1,1,1],[0,1,0]]); | \itemket{Remark} \hyperlink{mkpttable}{Comparative chart of drawing of points} \end{cmd} %--------------Pointdata3d------------------------------ \begin{cmd}{Pointdata3d}{pointdata3d} \itemket{Usage}Pointdata3d(name, point list, options) \itemket{Description}Generic function to generate data of the point list. \itemket{Details}Options are "Size=","Color=". \itemket{Examples} \verb|Pointdata3d("1",[[0,1,0],[1,1,2]],["Size=2","Color=red"]);| \end{cmd} %---------------Putpoint3d----------------------------- \begin{cmd}{Putpoint3d}{putpoint3d} \itemket{Usage}Putpoint3d(list of 3D-points, option) \itemket{Description}Generic function to draw the geometric point in the space. \itemket{Details}Option is "free" or "fix"(default). \itemket{Examples} \mbox{} \verb|Putpoint3d(["A",[2,1,3]]);|\\ \verb|Putpoint3d(["A",[2,1,3]],"free");| \\ \verb|Putpoint3d(["A",[1,1,1],"C",[1,0,1]]);|\\ These points don't output in the \TeX file. To output in the \TeX file use the following \hyperlink{pointdata}{Pointdata()} or \hyperlink{drwpt}{Drawpoint()} In the 3D-drawings the coordinate of the point name A is A3d. \itemket{Remark} \hyperlink{mkpttable}{Comparative chart of drawing of points} \end{cmd} %-----------------Putaxes3d--------------------------- \begin{cmd}{Putaxes3d}{putaxes3d} \itemket{Usage}Putaxes3d([x,y,z]) \itemket{Description}Generic function to make the geometric points on the coordinate axis. \itemket{Details}For the argument [x,y,x] we get the four geometric points X(x,0,0), Y(0,y,0), Z(0,0,z) and O(0,0,0). \itemket{Examples} \mbox{} \verb|Putaxes3d([1,2,3]);|\\ \verb|Putaxes3d(a);| //this equals to \verb|Putaxes3d([a,a,a]);| \end{cmd} %--------------PutonCurve3d------------------------------ \begin{cmd}{PutonCurve3d}{putonCurve3d} \itemket{Usage} PutonCurve3d(name, PD) \itemket{Description}Generic function to make the geometric point on the 3D-curve. \itemket{Details}This point moves along the curve by mouse dragging. \itemket{Examples} \mbox{} Make reference to \hyperlink{partcrv3d}{Partcrv3d()} \end{cmd} %----------------Putonseg3d---------------------------- \begin{cmd}{Putonseg3d}{putonseg3d} \itemket{Usage}Putonseg3d(name, point1, point2) \itemket{Description}Generic function to make the geometric point on the 3D-segment. \itemket{Details}We get the middle point between the two points. This point moves along the segment by mouse dragging. \itemket{Examples} \mbox{} \verb|Putonseg3d("C",A,B);| //Put C on the center of A and B.\\ \verb|Putonseg3d("C",[A,B]);| //same as above \end{cmd} %--------------Spaceline------------------------------ \begin{cmd}{Spaceline}{spaceline} \itemket{Usage} Spaceline(name, list) \itemket{Description}Generic function to draw the space polygonal lines. \itemket{Details}Options are line type: "dr" or "da" or "do". \itemket{Examples} \mbox{} \verb|Spaceline("1",[[2,5,1],[4,2,3]]);| //draw the line between two points\\ \verb|Spaceline("2",[A,B,C,A]);| //draw the triangle ABC\\ \verb|pt=[[2,0,0],[2,0,2],[2,2,2],[0,2,2],[0,4,2],[0,4,4]]; |\\ \verb|Spaceline("1",pt); |\\ \verb|Pointdata3d("1",pt,["Size=3"]);| \begin{center} \input{Fig/oresenex01} \end{center} \end{cmd} %-------------Spacecurve------------------------------- \begin{cmd}{Spacecurve}{spacecurve} \itemket{Usage}Spacecurve(name, formula, domain, options) \itemket{Description}Generic function to draw the space curve. \itemket{Examples} \mbox{} \verb|Spacecurve("1","[2*cos(t),2*sin(t),0.2*t]","t=[0,4*pi]",["Num=100"]);|\\ option=["Num=100"]: division number of the interval "t=[0,4*pi]" \begin{center} \input{Fig/rasen} \end{center} \end{cmd} %-------------Bezier3d}------------------------------- \begin{cmd}{Bezier3d}{bezier3d} \itemket{Usage}Bezier3d(name,list1,list2) \itemket{Description}Draw a Cubic B\'ezier curve. \itemket{Details}list1 is list of anchor points, and list2 is list of handle points \itemket{Examples} \mbox{} \verb|Bezier3d("1",["A","B","C"],["D","E","F","G"]);| \begin{center} \input{Fig/bezier3d1} \end{center} \end{cmd} %---------Mkbezierptcrv3d----------------------------------- \begin{cmd}{Mkbezierptcrv3d}{mkbezierptcrv3d} \itemket{Usage}Mkbezierptcrv3d(list) \itemket{Description}Draw a cubic B\'ezier curve from nodes. \itemket{Details}Arrange the control points automatically. After that, move the nodes and the control points and correct the cubic B\'ezier curve to what you want to draw. See the function {\tt \hyperlink{bezier}{Bezier3d}}. \itemket{Examples} \mbox{} \verb|Mkbezierptcrv3d(["A","B","C","D"]);| \end{cmd} %-------------Skeletonparadata------------------------------- \begin{cmd}{Skeletonparadata}{skeletonparadata} \itemket{Usage}Skeletonparadata(name, PDlist, PDlist, option) \itemket{Description}Generic function to draw the lines by performing hidden line processing. \itemket{Details}This function draw the second argument(the list of the lines) by performing hidden line processing which are hidden by the third argument(the list of the lines). If both arguments are omitted the function draw all lines by performing hidden line processing. Options:\\ \hspace*{5mm}\verb|real number| gap of line\\ \hspace*{5mm}\verb|"No=pointlist"| not executed when any point is selected\\ \hspace*{5mm}\verb|"File=y/m/n(default:n)"| whether to make data file or not\\ \hspace*{5mm}\verb|"Check=pointlist"| data file updated if any point is changed \itemket{Examples} \mbox{} \verb| Xyzax3data("","x=[-5,5]","y=[-5,4]","z=[-5,3]");| //Data name is "ax3d".\\ \verb| Putpoint3d(["A",[0,-2,-2]]);|\\ \verb| Putpoint3d(["B",[-1,1,3]]);|\\ \verb| Spaceline([A,B]);| //Data name is "AB3d".\\ \verb| Spacecurve("1","[2*cos(t),2*sin(t),0.2*t]","t=[0,4*pi]",["Num=100"]);| //Data name is "sc3d1".\\ \verb|Skeletonparadata("1");| //(left figure)\\ \verb|Skeletonparadata("1",[2]);| //option\verb|=[2]|: gap of lines\verb|=2| (center figure)\\ \verb|Skeletonparadata("1",["AB3d","ax3d"],["sc3d1"]);| //(right figure) \begin{center} \input{Fig/skeletonparadata01} \input{Fig/skeletonparadata02} \input{Fig/skeletonparadata03} \end{center} \end{cmd} %================== 3D polyhedron =============== \subsubsection{Polyhedron} The description of polyhedron drawing will be explained by taking the case of tetrahedron as an example. The tetrahedron is composed of four sides. Letting the vertices be A, B, C, D, the four faces are \hspace{20mm}$\triangle\mathrm{ABC}$, $\triangle\mathrm{ABD}$, $\triangle\mathrm{ACD}$, $\triangle\mathrm{BCD}$ \begin{center} \input{Fig/concatobj} \end{center} If numbers are given to the vertex list [A, B, C, D] in order from A, the vertex order of each face is [1, 2, 3], [1, 2, 4], [1, 3 , 4], [2, 3, 4]. [A, B, C, D], [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2 , 3, 4]]] is called "surface data". VertexEdgeFace () draws a polyhedron using this surface data. There are two kinds of hidden line processing of polyhedron. The first method is to treat polyhedron as a line drawing, and to process only the hidden part, using Skeletonparadata (). The other is to use Phparadata () as a way to draw a part hidden in the surface with a dotted line or hide it, considering it as a surface. \vspace{\baselineskip} %------------Concatobj-------------------------------- \begin{cmd}{Concatobj}{concatobj} \itemket{Usage}Concatobj(list,options) \itemket{Description}Concatenates several objects. %\itemket{Details} \itemket{Examples} \mbox{} A tetrahedron by four vertecies A,B,C,D.\\ The tetrahedron consists of four planes $\triangle\mathrm{ABC}$, $\triangle\mathrm{ABD}$, $\triangle\mathrm{ACD}$, $\triangle\mathrm{BCD}$.\\ \verb| Putpoint3d("A",2*[0,0,sqrt(3)]); |\\ \verb| Putpoint3d("B",2*[1,-1/sqrt(3),0]);|\\ \verb| Putpoint3d("C",2*[0,sqrt(3)-1/sqrt(3),0]);|\\ \verb| Putpoint3d("D",2*[-1,-1/sqrt(3),0]);|\\ \verb| phd=Concatobj([[A,B,C],[A,B,D],[A,C,D],[B,C,D]]);|\\ \verb| VertexEdgeFace("1",phd);|\\ \verb| Skeletonparadata("1");|\\ \verb| Letter3d([A3d,"ne","A",B3d,"sw","B",C3d,"se","C",D3d,"e","D"]);|\\ \begin{center} \input{Fig/concatobj} \end{center} If you are drawing tetrahedrons without creating geometric points, you can do as follows. \verb| a=2*[-1,-1/sqrt(3),0];|\\ \verb| b=2*[1,-1/sqrt(3),0];|\\ \verb| c=2*[0,sqrt(3)-1/sqrt(3),0];|\\ \verb| d=2*[0,0,sqrt(3)];|\\ \verb| phd=Concatobj([[a,b,c],[a,b,d],[a,c,d],[b,c,d]]);|\\ In the case of a convex polygon such as a tetrahedron, we can use CindyScript 's convexhull 3 d () function as follows. You can save time and effort by simply providing a vertex list instead of a surface list. \verb| a=2*[0,0,sqrt(3)];|\\ \verb| b=2*[1,-1/sqrt(3),0];|\\ \verb| c=2*[0,sqrt(3)-1/sqrt(3),0];|\\ \verb| d=2*[-1,-1/sqrt(3),0];|\\ \verb| phd=convexhull3d([a,b,c,d]);|\\ \end{cmd} %-------------Vertexedgeface------------------------------- \begin{cmd}{Vertexedgeface}{vertexedgeface} \itemket{Usage} VertexEdgeFace(name, list, options) \itemket{Description}Generic function to draw the polyhedron. \itemket{Details}We use the faces data of the polyhedron.\\ The second argument is the list of vertexes list and the faces list.\\ For example, the faces data of the tetrahedron is [[A,B,C,D],[[1,2,3],[1,2,4],[1,3,4],[2,3,4]]].\\ The generated data is as follows. phv3d: list of vertices phe3d: list of edges phf3d: Surface list Each name is appended to the end. \itemket{Examples} \mbox{} \verb| Putpoint3d("A",2*[-1,-1/sqrt(3),0]); |\\ \verb| Putpoint3d("B",2*[1,-1/sqrt(3),0]); |\\ \verb| Putpoint3d("C",2*[0,sqrt(3)-1/sqrt(3),0]); |\\ \verb| Putpoint3d("D",2*[0,0,sqrt(3)]); |\\ \verb| phd=[[A,B,C,D],[[1,2,3],[1,2,4],[1,3,4],[2,3,4]]];|\\ \verb| VertexEdgeFace("1",phd); |\\ //Three data lists are made, phv3d1:vertex, phe3d1:edge and phf3d1:face. \begin{center} \input{Fig/vertex01} \end{center} \end{cmd} %--------------Phparadata------------------------------ \begin{cmd}{Phparadata}{phparadata} \itemket{Usage}Phparadata(name, name2, list of options) \itemket{Description}Generic function to draw the polyhedron by performing hidden line processing. \itemket{Details}Make polyhedral plot data with VertexEdgeFace (). For this plot data, hidden surfaces (sides) are hidden-line processed and displayed. The second argument name2 is the same as the name given by VertexEdgeFace (). The hidden line type is specified by the option "Hidden = line type". Hidden lines are not displayed by default setting. \itemket{Examples} \mbox{} To draw a tetrahedron, \begin{minipage}[t]{100mm} \verb| Putpoint3d("A",2*[-1,-1/sqrt(3),0]);|\\ \verb| Putpoint3d("B",2*[1,-1/sqrt(3),0]);|\\ \verb| Putpoint3d("C",2*[0,sqrt(3)-1/sqrt(3),0]);|\\ \verb| Putpoint3d("D",2*[0,0,sqrt(3)]);|\\ \verb| phd=Concatobj([[A,B,C],[A,B,D],[A,C,D],[B,C,D]]);|\\ \verb| VertexEdgeFace("1",phd);|\\ \verb| Phparadata("1","1",["Hidden=do"]);|\\ \end{minipage}\hspace{5mm}% \begin{minipage}[t]{30mm} \mbox{}\vspace{-15mm} \input{Fig/phparadata04} \end{minipage} A tetrahedron is drawn by VertexEdgeFace (), but it is hidden by Phparadata (). Since it is correctly output if it is drawn with the figure button, it is good to execute Phparadata () after confirming it by displaying it on the screen before executing Phparadata (). \vspace{\baselineskip} Draw a truncated icosahedron of s06 (soccer ball type) using polyhedron data \verb|polyhedrons_obj| by Kobayashi, Suzuki, Mitani. \verb|Setdirectory( Dirhead+"/data/polyhedrons_obj");| //Many polyhedron data exist in this directory.\\ \verb|phd=Readobj("s06.obj",["size=3"]);| //"s06" is the name of truncated icosahedron data.\\ \verb|Setdirectory(Dirwork);| //Chage work space.\\ \verb|VertexEdgeFace("s06",phd);|\\ \verb|Phparadata("1","s06");| //default usage, left figure\\ The last two lines we can write the following.\\ \verb|VertexEdgeFace("1",phd);|\\ \verb|Phparadata("1","1");| \begin{center} \includegraphics[bb=0 0 726.04 365.02 , width=10cm]{Fig/phparadata01.pdf} \end{center} \verb|Phparadata("1","s06",["dr,2","Hidden=do"]);| //right figure \begin{center} \input{Fig/phparadata02} \input{Fig/phparadata03} \end{center} \end{cmd} %--------------Nohiddenbyfaces------------------------------ \begin{cmd}{Nohiddenbyfaces}{nohiddenbyfaces} \itemket{Usage}Nohiddenbyfaces(name,PD1,PD2,option1,option2) \itemket{Description}Generic function to draw hidden lines by the surfaces. \itemket{Details}PD1 are hidden lines, PD2 are surfaces.\\ If we omit PD1 then all lines are processing objects.\\ By default, hidden lines are drawn with dotted lines.\\ Option1=line type of PD2 and option2=line type of hidden lines.\\ If we specify only option2 then option1 must be null list:[].\\ \itemket{Examples} \mbox{} \begin{verbatim} Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,4]"); Putpoint3d("A",2*[-1,-1/sqrt(3),0]); Putpoint3d("B",2*[1,-1/sqrt(3),0]); Putpoint3d("C",2*[0,sqrt(3)-1/sqrt(3),0]); Putpoint3d("D",2*[0,0,2*sqrt(6)/3]); phd=Concatobj([[A,B,C],[A,B,D],[A,C,D],[B,C,D]]); VertexEdgeFace("1",phd); Nohiddenbyfaces("1","phf3d1"); \end{verbatim} (left figure) \verb|Nohiddenbyfaces("1","phe3d1","phf3d1",["dr,2"],["da"]); | (right figure) \begin{center} \input{Fig/nohiddenbyfaces1} \input{Fig/nohiddenbyfaces2} \end{center} We draw hidden axes with broken line in the following example.\\ \verb|Nohiddenbyfaces("1","ax3d","phf3d1",[],["da"]);| \end{cmd} %================== 3D Surface =============== \subsubsection{Surface} There are wire frame models and surface models for drawing curved surfaces. The wire frame model represents a curved surface with stitches, and the surface model draws its contour as a stitch-free surface. In KeTCindy, each drawing is done using the following function. \begin{tabbing} 1234567890123456789012345678901234567890\=\kill Wire frame model without hidden wire \>Sf3data(name,form,options)\\ Surface model\>Sfbdparadata(name,form,options)\\ Hidden-line wireframe model \>Wireparadata(name,PD,form,n1,n2,options) \end{tabbing} However, in order to do hidden line processing, surface data is necessary, so after drawing with Sfbdparadata (), draw hidden lines with ireparadata (). Also, in the drawing of the surface model, it takes time to process the hidden line, so it is assumed to use the C language. Therefore, ExeccmdC () which draws using C language is used together. \begin{center} \input{Fig/surfacemodelE} \end{center} The form of the argument is an equation and a list of character strings for the domain of the variable. There are three patterns of equations as follows. \vspace{\baselineskip} (1) $z=f(x,y)$ \hspace{5mm} 【Example】formula : $z=x^2-y^2$ \hspace{15mm} range : $x=(-2,2) , y=(-2,2)$ (2) $z=f(x,y),x=g(r,t),y=h(r,t)$ \hspace{5mm} 【Example】formula : $z=4-(x^2+y^2) , x=r\cos t , y=r\sin t$ \hspace{15mm} range : $r=(0,2) , t=(0,2\pi)$ (3) $x=f(u,v),y=g(u,v),z=h(u,v),$ \hspace{5mm} 【Example】formula : $x=2\sin u \cos v , y=2\sin u \sin v , z=2\cos u $ \hspace{15mm} range : $u=(0,\pi) , v=(0,2\pi)$ \vspace{\baselineskip} Here, (2) and (3) are parametric types, each consisting of expressions of $ x, y, z $ and two domain of parametric variables. Since it is indistinguishable as it is, when giving it as an argument, "p" is added to the type of (3) as the identification character at the beginning. Regarding the domain of definition, there are cases where it is taken in the open section and in the closed section. The distinction is indicated by "ewsn" as boundary designation (both are closed segments). I think the meaning of "ewsn" as follows. \vspace{\baselineskip} For variable $u,v$ , $a \leq u \leq b,c \leq v \leq d$ \begin{center} \input{Fig/ewsn} \end{center} This boundary designation is added at the end, but it can be omitted, and if omitted, it is the initial value "ewsn" (closed interval). To make both open segments, add "". However, do not perform hidden line processing Sf3data () draws a line also on the boundary, so you can omit this specification. \vspace{\baselineskip} \verb|fd=["p","x=r*cos(t)","y=r*sin(t)","z=2*(2-r)","r=[1,2]","t=[0,2*pi]","ew"]| \vspace{\baselineskip} If this is "e", $ 1