51
CAS-aided Visualization in LaTeX documents for Mathematics Educatio n ー Achievement of KETpic M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita, (Kisarazu National College of Te ch.) & S. Takato (Toho Univ.)

CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Embed Size (px)

Citation preview

Page 1: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

CAS-aided Visualizationin LaTeX documents

for Mathematics Educationー Achievement of KETpic ー

M. Kaneko, T. Abe, M. Sekiguchi,

Y. Tadokoro, S. Yamashita,

(Kisarazu National College of Tech.)

& S. Takato (Toho Univ.)

Page 2: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Contents

1. What is KETpic ?

2. Simple demonstration of drawing

pictures using KETpic

3. Other examples

4. Examples of space curves

5. Conclusion

6. Future works

Page 3: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

What isKETpic?

Page 4: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

KETpic isMacro Package for

CAS (Maple, Mathematica etc.)

Page 5: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

What can we doby using KETpic?

Page 6: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

We can draw

Fine Pictures in LaTeX documents.

(Fine = accurate & beautiful)

Page 7: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Usually many people use EPS.

\includegraphics

User’s LaTeXtext file

User’sdocument

CAS EPS

CompileMathematicaldocument

The output (EPS) of CAS is inserted into the LaTeX text file by using command “includegraphics”.The above procedure fits in case of not only CAS but also various graphic softwares or Gnuplot . Also, the command of Maple and Mathematica which generates LaTeX file follows the above procedure.

Page 8: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

BUT…

Page 9: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

EPS is not satisfactory for us.

• The size of file is large.

• Graphics can not be corrected as we like.

• Mathematical expressions (e.g. legends, accessories, hatchings,...) are poor.

• What we want to do (drawing tangential line to a curve at a specified point, curves defined by implicit functions, etc. ) are not supported.

Page 10: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Solution

So we have developed “KETpic”.

Page 11: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

• KETpic for Maple has been accomplished (v1.7). This talk is concerned with this version mainly.

• Recently we have started transplanting KETpic to Mathematica .

• How to get KETpic?

http://www.kisarazu.ac.jp/~masa/math/

(Of course FREE)

Though… Maple is NOT FREE

Page 12: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Comparison with EPS

\input

User’s LaTeXText file

User’sdocument

KETpicCAS

Tpic

CompileMathematicaldocument

By using KETpic, graphical outputs of CAS are formatted to generate graphical codes (Tpic specials) and written on text files. We insert these files into LaTeX document by the command “input”.

Page 13: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

It is a Fourier series approximation of the step function \pm 1 with period twice of pi.

Page 14: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

A simple demonstrationof drawing pictures

by using KETpic

An example from the convergencetheorem of Fourier series.

Page 15: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Merit of KETpic (1)

• By using CAS, we can draw accurate curves easily in the LaTeX documents.

• The output of KETpic is just a text file, which is much smaller than EPS, JPEG, PDF etc. Therefore, it is easy to attach the output to E-mail.

Page 16: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Merit of KETpic (2)

• You can insert mathematical expressions at your favorite position in graphics, with the same quality as those in LaTeX text.

• You can use various accessories such as hatchings, tickmarks, legends, …, so that you can give students very expressive printed matter.

Page 17: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Other ExamplesFollowing examples are effective for math. education,

and we actually use them in our classroom.

JapaneseMathematics(18C~ 19C)

cycloid

polar coordinate

stabilitytangential

circlesasteroid

9-pointed circle

contour

chi^2 function

Page 18: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Examples ofspace curves

Page 19: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is the cross eyed view of the intersection of two cylinders.

Page 20: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

These are the figures of regular icosahedron. In the right figure, hidden line elimination of KETpic is used unlike the left. Skeletons like this are drawn automatically by using KETpic.

You see the right figure is much more expressive than the left.

Page 21: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is a picture used to educate spherical polar coordinate.

Page 22: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Mathematica version(1) Loading KETpic

Get[StringJoin[“c:”,bksl[“ketpicmath.m”]]]

(2) Calculation of numerical data

setwindow[{-2*Pi,2*Pi},{-2.3,2.3}];

f=(4/Pi)*Sum[Sin[(2*k-1)*x]/(2*k-1),{k=1,N}];

N=10;

g=plotdata[{f,{x,XMIN,XMAX},PlotPoints->100}];

Page 23: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

(3) Writing down the numerical data onto LaTeX file (“fig1.tex”)

openfile[“e:\\Hungary/fig1.tex”];

openpicture["1cm“]:

drwline[g];

closepicture[1];

closefile[];

Page 24: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is a picture of chaos drawn with KETpic for Mathematica.

Page 25: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Mathematica Codes

Putting 40000 points.

Perhaps it is the delimitation of LaTeX and DVI.

Page 26: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Conclusion

• KETpic takes full advantage of CAS so that we can insert fine graphics into LaTeX document with reasonable efforts.

• KETpic has many merits which are effective for mathematics education. Especially it is useful when the outputs are used in math classroom as printed matter.

Page 27: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Future works

• Extension to other CAS’s

– Now on developing Mathematica version

– And other CAS’s, especially for free, such as Risa-Asir, Scilab, …

• Various and richer 3d-expression

Page 28: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

We hope

KETpic is wide spread to the world.

Please use KETpic!

Page 29: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Thank you for your attention.

感謝

Page 30: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,
Page 31: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Structure of user’s documentMaple file

(1) Loading KETpic

> read `c:\\ketpicw.m`:

(2) Calculation of numerical data

> setwindow(-2*Pi..2*Pi,-2.3..2.3):

> f:=(4/Pi)*sum(sin((2*k-1)*x)/(2*k-1),k=1..N);

> N:=10:

> g:=plot(f,x=XMIN..XMAX,numpoints=100):

Page 32: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

(3) Writing down the numerical data onto LaTeX file (“fig1.tex”)

> openfile(`e:\\Hungary/fig1.tex`):

> openpicture("1cm"):

> drwline(g):

> closepicture():

> closefile():

Page 33: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

LaTeX file

(4) Generation of LaTeX file of graphic

codes

\begin{document}

\input{fig1}

\end{document}

Then the output is the following picture:

Page 34: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This picture of cycloid can be drawn by using do-loop and the commands “rotate” and “translate” of Maple.

We believe that the educational effect of this picture is not inferior to that of animation. Also this picture has the advantage that it can be used in the form of printed matter.

Page 35: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This picture of trochoid can be drawn by the same Maple program with only the coordinate of point substituted.

Page 36: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Inspiring students’ imagination

While seeing these pictures, some student

may put up a question

“How will the picture become

if ellipse rotate?” Then we can give them answer by using

KETpic as in the next picture.

Page 37: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,
Page 38: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

The roulette of the focus is called “Delauney curve”.

Page 39: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is a trace of the circle which rotates twice around the given ellipse on the outer side of it.

Page 40: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

In case of the rotation on the inner side of ellipse, the diameter of circle need to be small to a certain extent so that the rotation would not be interrupted.

Page 41: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This shows a delicate situation. Whether safe or not safe is easily judged using the two diameters of ellipse and that of circle. Deduction of this safety condition is a good exercise for high school students.

Page 42: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is a picture of 9-pointed circle. The dotted circle is drawn by automatic calculation of Maple.

Page 43: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is a picture of circles which are tangent to each other and the two lines. To draw it, do-loop of Maple is used. Also hatching is done very easily.

Page 44: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This figure shows an example of the graph of function given by polar coordinate. Here do-loop of Maple is effectively used.

Page 45: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

Closed chain circle

The sum of the inverse for radii of dotted circles are the same as that of dashed circles.

Page 46: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is the case that bold circles are put side by side. Then touching circle is turned upside down. This picture seems quite different from the previous one, but essentially the same.

Page 47: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

These curves are graphs of chi^2 functions with various values of deviation.

Page 48: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

These are graphs of functions obtained by integration of the above chi^2 functions. Without using CAS, it would be impossible to draw graphics like this.

Page 49: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This is contours of the Coulomb potential with two electric charges at (\pm 1,0). To draw this picture, “contourplot” is used.

Z=((x+1)^2+y^2)^(-1/2)+((x-1)^2+y^2)^(-1/2)

Page 50: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

The width and direction of hatchings are easily handled.

Page 51: CAS-aided Visualization in LaTeX documents for Mathematics Education ー Achievement of KETpic ー M. Kaneko, T. Abe, M. Sekiguchi, Y. Tadokoro, S. Yamashita,

This figure is used to explain the stability of dynamical systems in economics classroom. You see that various kind of lines (real line, dotted line, dashed line,…) and arrowhead are very expressive