summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/acroflex/examples/transf_grphs.tex
blob: 74dad7dbee04330e2476bb60d1450badfc6d50c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
\documentclass{article}
\usepackage{amsmath}
\usepackage[%
    web={pro,tight,usesf},
    eforms,exerquiz,dljslib={ImplMulti},
    graphicxsp={showembeds}
]{aeb_pro}
\usepackage{acroflex}

\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom
\screensize{6.8in}{5.5in}             % height, width dimensions

\DeclareDocInfo
{
    title=Exploring Graphical Transformations,
    author=D. P. Story,
    university=Northwest Florida State College,
    email=storyd@owc.edu,
    subject=Demo of the acroflex and the rmannot package,
    keywords={Adobe Acrobat, JavaScript, Adobe FLEX 3, ActionScript},
    talksite=\url{http://faculty.owc.edu/math/storyd},
    talkdate={\today},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\talkdateLabel{Published:}

\setWindowOptions{showtitle}

\requiredVersionMsg{%
    Version 9 required: This document may be viewed, but version 9
    of Acrobat/Adobe Reader is required to view the rich media
    annotations present in this document.}
\requiredVersionMsgRedirect{%
    Version 9 required: This document may be viewed, but version 9
    of Acrobat/Adobe Reader is required to view the rich media
    annotations present in this document.}
\requiresVersion[warnonly]{9}

\def\AcroTeX{Acro\!\TeX}
\def\myURL{http://www.math.uakron.edu/\string~dpstory}
%
% The following definitions are for the rmannot package.
% The \saveNamedPath associates the name AcroAd with the
% path to a Flash animation, Acro_Advertiser.swf.
% The two \makePoster definitions are for the posters of the
% rich media annotations. The first for the animation on page 1
% and the second for all the AcroFlex graphing screens.
\newcommand{\myRMFiles}{C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/rmannot/RMfiles}
\saveNamedPath{AcroAd}{\myRMFiles/Acro_Advertiser.swf}
%
% See the rmannot documentation. You can create your own
% poster graphic and declare it in the preamble.
%
\makePoster[hiresbb]{aflogo}{aflogo1}
\makePoster[hiresbb]{AcroAd_poster}{AcroAd_poster}

\parindent=0pt
\pagestyle{empty}   %\previewtrue
\def\graphAndControls{\kern0pt\noindent
    \graphScreen[poster=aflogo]{\hScreenGraph}{\vScreenGraph}\\[1ex]
    \makebox[\hScreenGraph][l]{%
        \savedelSelBtn[\textSize{7}\CA{S}]{9bp}{11bp}\kern1bp
        \functionSelect{50bp}{11bp}\hfill
        \funcInputField{\hScreenGraph-50bp-6bp-9bp}{11bp}%
    }\\[1ex]
    \makebox[\hScreenGraph][c]{\scriptsize
        \graphBtn[\textSize{7}]{}{9bp}\kern1pt
        \graphClrBtn[\textSize{7}]{}{9bp}\hfill
        \hShiftL{\raisebox{1bp}{\reflectbox{\ding{220}}}}\,%
        \vShiftU{\raisebox{1bp}{\rotatebox{90}{\ding{220}}}}\,\,%
        \amtShift[\textSize{7}]{12bp}{9bp}\,\,%
        \vShiftD{\raisebox{1bp}{\rotatebox[origin=c]{-90}{\ding{220}}}}
        \hShiftR{\raisebox{1bp}{\ding{220}}}\enspace
        \hfill\zoomInOut[\textSize{7}]{}{9bp}%
    }\\[1pt]%
    \makebox[\hScreenGraph][l]{\scriptsize
        $x = $ \strut\domMin[\textSize{7}]{36bp}{9bp}\ldots
            \domMax[\textSize{7}]{36bp}{9bp}\hfill
        $n = $\numPoints[\textSize{7}]{16bp}{9bp}
    }\\[1pt]%
    \makebox[\hScreenGraph][l]{\scriptsize
        $y = $ \rngMin[\textSize{7}]{36bp}{9bp}\ldots
            \rngMax[\textSize{7}]{36bp}{9bp}%
    }%\\[1pt]%%
%    \makebox[\hScreenGraph][l]{\scriptsize
%        $t = $ \strut\domMinP[\textSize{7}]{36bp}{9bp}\ldots
%            \domMaxP[\textSize{7}]{36bp}{9bp}%
%    }
\par
}

%
% Display an advertisement on the opening page through the
% \optionalPageMatter command.
%
\optionalPageMatter{%
\begin{center}
\begin{minipage}{.7\linewidth}
    \resizebox{\linewidth}{!}{%
        \rmAnnot[poster=AcroAd_poster,enabled=pageopen]{612bp}{265bp}{AcroAd}}%
\end{minipage}
\end{center}
}

\begin{document}

\maketitle



% Basic parameters. These are the graphing screen dimensions you wish
% for the AcroFleX graphing widget, and the \graphName is the base name used by
% all the supporting components to the graphing screen.

\dimScreenGraph{160bp}{160bp}
%\dimScreenGraph{186bp}{186bp*3/4}
\graphName{graph1}

\begin{center}\bfseries\Large\color{blue}
    Transforming Graphs
\end{center}

\medskip
This is a demo of graphical transformations, and is based on my recent work over the summer, 2008,
on creating a interactive graphing system using a Flash application, written by myself, for PDF.
Adobe Reader 9.0 or later is required to use this system.
\medskip

\begin{minipage}[t]{\hScreenGraph + 10bp}
%
% Insert the \graphScreen with all possible controls. Plot data entered by the
% user is interactive mode.
\graphAndControls
\end{minipage}\hfill
\begin{minipage}[t]{\linewidth - \hScreenGraph - 10bp}\small\par
\textbf{\textcolor{red}{Instructions:}} This graphing system can graph
a function of $x$.
\begin{questions}
    \item For a function of $x$, enter an algebraic expression to be graphed, e.g.,
        \verb!x^2!, \verb!x^3!, \verb!3x^2-1!, \verb!|x|!, \verb!sqrt(x)!
    \item Set the graph viewing window: The range of the horizontal
        axis ($x$-axis) and range of the vertical axis ($y$-axis).
        For parametric plotting, set the range of the $t$ variable.
    \item Enter the number of points, $n$, to plot.
    \item Click the \textsf{Graph It!} button.
    \item Shift the viewing window horizontally or vertical;
    or zoom in or out.
    \item Click \texttt{Clear} to clear the plot; use
         \textsf{shift-click} to deactivate the graphing screen.
\end{questions}
\end{minipage}

\medskip

\noindent\makebox[\linewidth][c]{\rule{.67\linewidth}{.4pt}}

\medskip

\parskip3pt

\defineGraphJS{graph=c2,xInterval={[d_min,d_max]},yInterval={[r_min,r_max]},
    noquotes,points=n_Pts}{newFunc}{\verticalShift}
\defineGraphJS{graph=c2,xInterval={[d_min,d_max]},yInterval={[r_min,r_max]},
    noquotes,points=n_Pts}{newFunc}{\horizontalShift}
\defineGraphJS{graph=c2,xInterval={[d_min,d_max]},yInterval={[r_min,r_max]},
    noquotes,points=n_Pts}{newFunc}{\verticalShrink}
\defineGraphJS{graph=c2,xInterval={[d_min,d_max]},yInterval={[r_min,r_max]},
    noquotes,points=n_Pts}{newFunc}{\horizontalShrink}
\def\gatherGraphingData{%
    var f = this.getField("graph1theFunction").value;\r\t
    var d_min = this.getField("graph1theDom.min").value;\r\t
    var d_max = this.getField("graph1theDom.max").value;\r\t
    var r_min = this.getField("graph1theRng.min").value;\r\t
    var r_max = this.getField("graph1theRng.max").value;\r\t
    var n_Pts = this.getField("graph1numNodes").value;\r\t
}

Explore graphical transformations by entering numbers into the fields below. Put your mouse
over the fields for additional instructions. Click on the green links to populate the
graphing screen with suggested examples, then manipulate these examples using the controls below.

\smallskip

\begin{center}
\begin{tabular}{lll}
\textbf{Description} & \textbf{Input} & \textbf{Suggested Examples}\\

Vertical Shift & \textField[\textSize{7}\TU{Enter a number (positive
or negative) to shift the graph vertically up or down.}
    \AA{\AAKeystroke{%
        if (event.willCommit) {\r\t
            \gatherGraphingData
            var _C = event.value;\r\t
            if ( isFinite(_C) ) {\r\t\t
                var newFunc  = f+"+"+(_C);\r\t\t
                \verticalShift\r\t
            }\r
        }
}}]{vShift}{20bp}{9bp}&
\sgraphLink{populate,xInterval={[-2,2]},yInterval={[-3,3]},points=40}{x}{$x$},
\sgraphLink{populate,xInterval={[-2,2]},yInterval={[-2,4]},points=40}{x^2}{$x^2$},
\sgraphLink{populate,xInterval={[-2,2]},yInterval={[-4,4]},points=40}{x^3}{$x^3$},
\sgraphLink{populate,xInterval={[-2,3]},yInterval={[-3,6]},points=40}{(x-1)^2+1}{$(x-1)^2+1$}\\
%
%
Horizontal Shift & \textField[\textSize{7}\TU{Enter a number
(positive or negative) to shift the graph horizontally right or
left.}
    \AA{\AAKeystroke{%
        if (event.willCommit) {\r\t
            \gatherGraphingData
            var _C = event.value;\r\t
            if ( isFinite(_C) ) {\r\t\t
                newFunc = f.replace(/x/g, "(x-("+_C+"))");\r\t\t
                \horizontalShift\r\t
            }\r
        }
}}]{hShift}{20bp}{9bp}&
\sgraphLink{populate,xInterval={[-2,4]},yInterval={[-2,2]},points=60}{sqrt(x)}{$\sqrt{x}$},
\sgraphLink{populate,xInterval={[-3,3]},yInterval={[-3,3]},points=60}{x^{1/3}}{$\sqrt[3]{x}$},
\sgraphLink{populate,xInterval={[-2,4]},yInterval={[-2,3]},points=60}{sqrt(x-1)+1}{$\sqrt{x-1}+1$}\\
%
%
Vertical Stretch/Shrink& \textField[\textSize{7}\TU{Enter a positive number
to stretch or shrink the graph vertically.}
    \AA{\AAKeystroke{%
        if (event.willCommit) {\r\t
            var f = this.getField("graph1theFunction").value;\r\t
            var d_min = this.getField("graph1theDom.min").value;\r\t
            var d_max = this.getField("graph1theDom.max").value;\r\t
            var r_min = this.getField("graph1theRng.min").value;\r\t
            var r_max = this.getField("graph1theRng.max").value;\r\t
            var n_Pts = this.getField("graph1numNodes").value;\r\t
            var _C = event.value;\r\t
            if ( isFinite(_C) && (Number(_C) > 0) ) {\r\t\t
                newFunc = String("(_C)*("+f+")")\r\t\t
                \verticalShrink\r\t
            }\r
        }
}}]{vShrink}{20bp}{9bp}&
\sgraphLink{populate,xInterval={[-2,2]},yInterval={[-2,4]},points=40}{|x-1|}{$|x|$},
\sgraphLink{populate,xInterval={[-2,3]},yInterval={[-2,2]},points=40}{|x-1|}{$|x-1|$}\\
%
%
Horizontal Stretch/Shrink& \textField[\textSize{7}\TU{Enter a positive number
to stretch or shrink the graph horizontally.}
    \AA{\AAKeystroke{%
        if (event.willCommit) {\r\t
            var f = this.getField("graph1theFunction").value;\r\t
            var d_min = this.getField("graph1theDom.min").value;\r\t
            var d_max = this.getField("graph1theDom.max").value;\r\t
            var r_min = this.getField("graph1theRng.min").value;\r\t
            var r_max = this.getField("graph1theRng.max").value;\r\t
            var n_Pts = this.getField("graph1numNodes").value;\r\t
            var _C = event.value;\r\t
            if ( isFinite(_C) && (Number(_C) > 0) ) {\r\t\t
                newFunc=f.replace(/x/g, "(("+_C+")*x)");\r\t\t
                \horizontalShrink\r\t
            }\r
        }
}}]{hShrink}{20bp}{9bp}&\\
%
%
Reflect w/resp $y$-axis & \pushButton[\textSize{7}\CA{y-Axis}
    \TU{Press to reflect current graph with respect to the y-axis.}
    \A{\JS{%
            var f = this.getField("graph1theFunction").value;\r\t
            var d_min = this.getField("graph1theDom.min").value;\r\t
            var d_max = this.getField("graph1theDom.max").value;\r\t
            var r_min = this.getField("graph1theRng.min").value;\r\t
            var r_max = this.getField("graph1theRng.max").value;\r\t
            var n_Pts = this.getField("graph1numNodes").value;\r\t
            newFunc=f.replace(/x/g, "((-1)*x)");\r\t\t
            \horizontalShrink\r\t
}}]{y_reflect}{}{9bp}&
Click \graphClrBtn[\textSize{7}]{}{9bp} before clicking on green links\\
%
%
Reflect w/resp $x$-axis & \pushButton[\textSize{7}\CA{x-Axis}
    \TU{Press to reflect current graph with respect to the x-axis.}
    \A{\JS{%
            var f = this.getField("graph1theFunction").value;\r\t
            var d_min = this.getField("graph1theDom.min").value;\r\t
            var d_max = this.getField("graph1theDom.max").value;\r\t
            var r_min = this.getField("graph1theRng.min").value;\r\t
            var r_max = this.getField("graph1theRng.max").value;\r\t
            var n_Pts = this.getField("graph1numNodes").value;\r\t
                newFunc = String("(-1)*("+f+")")\r\t\t
                \verticalShrink\r\t
}}]{x_reflect}{}{9bp}&
\end{tabular}
\end{center}
\end{document}