Debian Codegraph @

doc/jessie/jessiescript_ref_en.tex

raw
1 \documentclass[10pt]{article}
2 \usepackage{a4wide}
3 \usepackage[latin1]{inputenc}
4 \usepackage[ngerman]{babel,varioref}
5 \usepackage[T1] {fontenc}
6 \usepackage{amsmath,amssymb}
7 \usepackage{verbatim}
8 \usepackage{pst-all}
9 \usepackage{float}
10 \usepackage{multicol}
11 \usepackage{multirow}
12 \usepackage{tabularx}
13
14
15 \usepackage{geometry}
16 \geometry{a4paper,left=30mm,right=30mm, top=2cm, bottom=2cm}
17
18 \newcommand{\R}{\mathbb{R}}
19 \newcommand{\Q}{\mathbb{Q}}
20 \newcommand{\Z}{\mathbb{Z}}
21 \newcommand{\N}{\mathbb{N}}
22 \newcommand{\C}{\mathbb{C}}
23 \newcommand{\PC}{\mathcal{P}}
24 \newcommand{\ZC}{\mathcal{Z}}
25 \newcommand{\Sum}{\sum\limits}
26 \newcommand{\Prod}{\prod\limits}
27 \newcommand{\Lim}{\lim\limits}
28 \newcommand{\Int}{\int\limits}
29 \renewcommand{\Im}{\text{Im}}
30 \renewcommand{\Re}{\text{Re}}
31 \newcommand{\eps}{\varepsilon}
32 \parindent 0pt
33 \pagestyle{empty}
34
35
36 \newcommand{\luecke}[1]{\raisebox{-6pt}{\makebox[#1]{\dotfill}}}
37
38 \def\versionnumber{0.81} % Version of this reference card
39 \def\year{2010}
40 \def\month{June}
41 \def\version{\month\ \year\ v\versionnumber}
42
43 \begin{document}
44 \title{JessieScript Reference (Version \version)}
45 \begin{center} {\LARGE\textbf {JessieScript Reference (Version
46 \version)}}
47 \end{center}
48 \section{Construct}
49 Easy mathematical constructions can be created with the line
50 \begin{verbatim}
51 board.construct(...);
52 \end{verbatim} Within the brackets its possible to pass different
53 elements, separated by semicolon, as one string. Blanks are
54 irrelevant.
55 \\\\ Possible elements are: \\ \begin{tabular}{|l|l|} \hline \\[-0.75em] {\large
56 \textbf{Example}} & {\large \textbf{Description}} \\
57 \hline\hline \verb+A(1,1)+ & point at (1,1) with name \verb'A'
58 \\ \hline \verb+BB(-2|0.5)+ & point at
59 (-2,0.5) with name \verb'BB' \\
60 \hline\verb+]AB[+ & straight line through points \verb'A' and \verb'B' \\
61 \hline\verb+[AB[+ &
62 ray through points \verb'A' and \verb'B', stopping at \verb'A' \\
63 \hline\verb+]A BB]+ & ray through points \verb'A' and \verb'BB',
64 stopping at \verb'BB'
65 \\ \hline\verb+[AB]+ & segment between \verb'A' and \verb'B' \\
66 \hline \verb+g=[AB]+ & segment between \verb'A' and \verb'B' with name \verb'g' \\
67 \hline\verb+k(A,4)+ & circle with midpoint \verb'A' and radius 4 \\
68 \hline\verb+k(A,[BC])+ & circle with midpoint \verb'A', whose
69 radius is given by the (not necessarily
70 \\ & existing) segment \verb'[BC]' \\ \hline\verb+k(A,B)+ & circle with midpoint \verb'A',
71 through point \verb'B' \\
72 \hline\verb+k1=k(A,3)+ & circle with midpoint \verb'A' with radius
73 3 with name \verb'k1'
74 \\ \hline\verb+P(g)+ & glider \verb'P' on the object \verb'g' \\
75 \hline\verb+Q(k1,0,1)+ & glider \verb'Q' on the object \verb'k1'
76 at (0,1) \\ \hline \verb+g&k1+ & intersection point(s) of the
77 objects \verb'g' and \verb'k1' \\ \hline \verb+S=g&k1+ &
78 intersection point(s) of the \verb'g' and \verb'k1'. \\ &
79 Multiple intersection points
80 are named with \verb'S'$_1$ and \verb'S'$_2$, single ones with \verb'S'. \\
81 \hline\verb+||(A,g)+ & parallel line to \verb'g' through point
82 \verb'A'
83 \\ \hline\verb+|_(A,g)+ & perpendicular line to \verb'g' through point
84 \verb'A' \\ \hline\verb+<(A,B,C)+ & angle, defined by the points \verb'A', \verb'B', \verb'C' \\
85 \hline\verb+alpha=<(A,B,C)+ & angle, defined by the points
86 \verb'A', \verb'B', \verb'C', with name $\alpha$
87 \\ & Possible greek denominators are \verb'alpha',
88 \verb'beta', \verb'gamma', \verb'delta', \verb'epsilon', \\ &
89 \verb'zeta', \verb'eta', \verb'theta', \verb'iota', \verb'kappa',
90 \verb'lambda', \verb'mu', \verb'nu', \verb'xi', \verb'omicron',
91 \verb'pi', \verb'rho', \verb'sigmaf', \\ & \verb'sigma',
92 \verb'tau', \verb'upsilon', \verb'phi', \verb'chi', \verb'psi' and
93 \verb'omega'. \\ \hline\verb+1/2(A,B)+ & midpoint between \verb'A'
94 and \verb'B'
95 \\ \hline\verb+3/4(A,B)+ & point dividing the segment from \verb'A'
96 to \verb'B' at ratio 3:7 , \\ & i.e. $\frac{3}{4}$ parts of the
97 segment \verb'[AB]' are between \verb'A' and the constructed point
98 \\ & Therefore, any ratio of natural numbers is possible. \\
99 \hline\verb+P[A,B,C,D]+ & polygon through points \verb'A',
100 \verb'B', \verb'C', \verb'D' with name 'P' \\
101 \hline\verb'f:x^2+2*x' & functiongraph, $f:x\mapsto x^2+2\cdot x$ \\
102 \hline\verb'f:sin(x)' & functiongraph, $g:x\mapsto \sin(x)$ \\
103 \hline\verb'#Hello world(0,3)' & text \verb'Hello world' at (0,3)
104 \\ \hline
105 \end{tabular} \vspace*{0.5cm} \\
106 Its possible for every element (except points, graphs and
107 polygons) to provide a name directly by using
108 \begin{verbatim}
109 objname = ...
110 \end{verbatim} \\ The function returns an object with all constructed elements, so that afterwards
111 the properties can still be changed.
112
113 \section{Fast modification of properties}
114 For setting the three most important properties there is a fast
115 possibility, all others have to be set afterwards by accessing the
116 particular elements and calling the corresponding function.
117 \\ These are \\
118 \begin{tabular}{|l|l|} \hline \\[-0.75em] {\large
119 \textbf{Property}} & {\large \textbf{Description}} \\
120 \hline\hline\verb+invisible+ & the object is invisible \\
121 \hline\verb+draft+ & the object is drawn in draft mode \\
122 \hline\verb+nolabel+ & the object does not have a label
123 \\ \hline
124 \end{tabular} \vspace*{0.5cm} \\
125 These properties are set directly at declaring the objects by
126 writing the respective key word (resp. key words, a combination is
127 possible), seperated by a blank behind the construction command
128 before the semicolon, i.e.
129 \begin{verbatim}
130 P(1,1) nolabel; Q(2,3) draft nolabel; [PQ] invisible;
131 \end{verbatim}
132
133 \section{Access to the elements}
134 Access to the elements after constructing them is possible by using: \\
135 \begin{tabular}
136 {|l|l|} \hline \\[-0.75em] {\large
137 \textbf{element}} & {\large \textbf{description}} \\ \hline\hline
138 \verb+constr.points[i]+ & take the $i$-th point or glider of the
139 construction \verb+constr+, \\ & also midpoints and dividing points are within this array \\
140 \hline\verb+constr.lines[i]+ & take the $i$-th line, ray or
141 segment of the construction \verb+constr+, \\ & also parallel and
142 perpendicular lines are within this array
143 \\
144 \hline\verb+constr.circles[i]+ & take the $i$-th cicle of the
145 construction \verb+constr+
146 \\
147 \hline\verb+constr.intersections[i]+ & take the $i$-th
148 intersection point of the construction \verb+constr+
149 \\
150 \hline\verb+constr.angles[i]+ & liefert take the $i$-th angle of
151 the construction \verb+constr+
152 \\
153 \hline\verb+constr.functions[i]+ & take the $i$-th function graph
154 of the construction \verb+constr+
155 \\
156 \hline\verb+constr.texts[i]+ & take the $i$-th text element of the
157 construction \verb+constr+
158 \\
159 \hline\verb+constr.polygons[i]+ & take the $i$-th polygon of the
160 construction \verb+constr+
161 \\
162 \hline\verb+constr.A+ & take the element with name \verb'A' of the
163 construction \verb+constr+
164 \\ \hline
165 \end{tabular}
166
167 \section{Macros}
168 Additionally it is possible to define macros. The key word is
169 \verb+Macro+, the parameters are, seperated by comma, provided
170 within round brackets, the content between curly braces. Left of
171 the equal sign any name can be given to the macro. \\ So the
172 syntax is given by
173 \begin{verbatim}
174 macroName = Macro(param1, param2, param3, ...) { command1; command2; command3; ... };
175 \end{verbatim}
176 After that, the macro can be called by
177 \begin{verbatim}
178 result = macroName(x1,x2,x3,...);
179 \end{verbatim}
180
181 \section{Example}
182 An example shall demonstrate the practical implementation.
183 \begin{verbatim}
184 board = JXG.JSXGraph.initBoard("box", {originX: 50, originY: 300, unitX: 50,
185 unitY: 50, axis:true});
186
187 cons1 = board.construct("A(1,1);BC(1,3);k(A,[A BC]);X(2,4)");
188 cons2 = board.construct("J(7,4);l_2=[BC A]");
189
190 cons1.points[0].face(">");
191 cons1.BC.strokeColor("black");
192 cons2.l_2.strokeWidth(4);
193 cons1.X.size(8);
194
195 cons3 = board.construct("test = Macro(D,E,F) { g=[DE] nolabel; k1=k(D,[EF]);};
196 ttt=test(A,X,J);");
197 cons3.ttt.g.strokeColor("red");
198 \end{verbatim}
199
200 \end{document}