فهرست منبع

Deployed 30cc06b with MkDocs version: 1.1.2

Gilbert Brault 5 سال پیش
والد
کامیت
cbf837fdbf
100فایلهای تغییر یافته به همراه899 افزوده شده و 11937 حذف شده
  1. 0 1
      .TODO/todo.txt
  2. 0 39
      .gitignore
  3. 238 0
      404.html
  4. 0 150
      README.do.txt
  5. 0 161
      README.md
  6. 0 2
      README.sh
  7. 281 0
      about/index.html
  8. BIN
      assets/images/favicon.png
  9. 2 0
      assets/javascripts/bundle.1688372e.min.js
  10. 1 0
      assets/javascripts/bundle.1688372e.min.js.map
  11. 1 0
      assets/javascripts/lunr/min/lunr.ar.min.js
  12. 18 0
      assets/javascripts/lunr/min/lunr.da.min.js
  13. 18 0
      assets/javascripts/lunr/min/lunr.de.min.js
  14. 18 0
      assets/javascripts/lunr/min/lunr.du.min.js
  15. 18 0
      assets/javascripts/lunr/min/lunr.es.min.js
  16. 18 0
      assets/javascripts/lunr/min/lunr.fi.min.js
  17. 18 0
      assets/javascripts/lunr/min/lunr.fr.min.js
  18. 18 0
      assets/javascripts/lunr/min/lunr.hu.min.js
  19. 18 0
      assets/javascripts/lunr/min/lunr.it.min.js
  20. 1 0
      assets/javascripts/lunr/min/lunr.ja.min.js
  21. 1 0
      assets/javascripts/lunr/min/lunr.jp.min.js
  22. 1 0
      assets/javascripts/lunr/min/lunr.multi.min.js
  23. 18 0
      assets/javascripts/lunr/min/lunr.nl.min.js
  24. 18 0
      assets/javascripts/lunr/min/lunr.no.min.js
  25. 18 0
      assets/javascripts/lunr/min/lunr.pt.min.js
  26. 18 0
      assets/javascripts/lunr/min/lunr.ro.min.js
  27. 18 0
      assets/javascripts/lunr/min/lunr.ru.min.js
  28. 1 0
      assets/javascripts/lunr/min/lunr.stemmer.support.min.js
  29. 18 0
      assets/javascripts/lunr/min/lunr.sv.min.js
  30. 18 0
      assets/javascripts/lunr/min/lunr.tr.min.js
  31. 1 0
      assets/javascripts/lunr/min/lunr.vi.min.js
  32. 1 0
      assets/javascripts/lunr/tinyseg.min.js
  33. 31 0
      assets/javascripts/vendor.877163d5.min.js
  34. 1 0
      assets/javascripts/vendor.877163d5.min.js.map
  35. 59 0
      assets/javascripts/worker/search.a68abb33.min.js
  36. 1 0
      assets/javascripts/worker/search.a68abb33.min.js.map
  37. 3 0
      assets/stylesheets/main.5be48db2.min.css
  38. 1 0
      assets/stylesheets/main.5be48db2.min.css.map
  39. 3 0
      assets/stylesheets/palette.89d31e3b.min.css
  40. 1 0
      assets/stylesheets/palette.89d31e3b.min.css.map
  41. 0 291
      doc/pub/tutorial/._pysketcher000.html
  42. 0 251
      doc/pub/tutorial/._pysketcher001.html
  43. 0 887
      doc/pub/tutorial/._pysketcher002.html
  44. 0 960
      doc/pub/tutorial/._pysketcher003.html
  45. 0 615
      doc/pub/tutorial/._pysketcher004.html
  46. 0 980
      doc/pub/tutorial/._pysketcher005.html
  47. BIN
      doc/pub/tutorial/fig-tut/Arc.pdf
  48. BIN
      doc/pub/tutorial/fig-tut/Arc.png
  49. BIN
      doc/pub/tutorial/fig-tut/Axis.pdf
  50. BIN
      doc/pub/tutorial/fig-tut/Axis.png
  51. BIN
      doc/pub/tutorial/fig-tut/Dashpot.pdf
  52. BIN
      doc/pub/tutorial/fig-tut/Dashpot.png
  53. BIN
      doc/pub/tutorial/fig-tut/Distance_wText.pdf
  54. BIN
      doc/pub/tutorial/fig-tut/Distance_wText.png
  55. BIN
      doc/pub/tutorial/fig-tut/Rectangle.pdf
  56. BIN
      doc/pub/tutorial/fig-tut/Rectangle.png
  57. BIN
      doc/pub/tutorial/fig-tut/Shape_hierarchy_complete.png
  58. BIN
      doc/pub/tutorial/fig-tut/Shape_hierarchy_larger.png
  59. BIN
      doc/pub/tutorial/fig-tut/Shape_hierarchy_small.png
  60. BIN
      doc/pub/tutorial/fig-tut/Spring.pdf
  61. BIN
      doc/pub/tutorial/fig-tut/Spring.png
  62. BIN
      doc/pub/tutorial/fig-tut/StochasticWavyCurve.pdf
  63. BIN
      doc/pub/tutorial/fig-tut/StochasticWavyCurve.png
  64. BIN
      doc/pub/tutorial/fig-tut/Triangle.pdf
  65. BIN
      doc/pub/tutorial/fig-tut/Triangle.png
  66. BIN
      doc/pub/tutorial/fig-tut/Vehicle0_hier2.pdf
  67. BIN
      doc/pub/tutorial/fig-tut/Vehicle0_hier2.png
  68. BIN
      doc/pub/tutorial/fig-tut/Wavy.pdf
  69. BIN
      doc/pub/tutorial/fig-tut/Wavy.png
  70. BIN
      doc/pub/tutorial/fig-tut/beam_mid_support_deflection.png
  71. BIN
      doc/pub/tutorial/fig-tut/beam_mid_support_math.png
  72. BIN
      doc/pub/tutorial/fig-tut/beam_mid_support_raw.png
  73. 0 794
      doc/pub/tutorial/fig-tut/mpl_code_Arc.py
  74. 0 122
      doc/pub/tutorial/fig-tut/mpl_code_Axis.py
  75. 0 195
      doc/pub/tutorial/fig-tut/mpl_code_Dashpot.py
  76. 0 149
      doc/pub/tutorial/fig-tut/mpl_code_Distance_wText.py
  77. 0 66
      doc/pub/tutorial/fig-tut/mpl_code_Rectangle.py
  78. 0 2219
      doc/pub/tutorial/fig-tut/mpl_code_Spring.py
  79. 0 30
      doc/pub/tutorial/fig-tut/mpl_code_Triangle.py
  80. 0 4025
      doc/pub/tutorial/fig-tut/mpl_code_Wavy.py
  81. BIN
      doc/pub/tutorial/fig-tut/pendulum.png
  82. BIN
      doc/pub/tutorial/fig-tut/pendulum1.pdf
  83. BIN
      doc/pub/tutorial/fig-tut/pendulum1.png
  84. BIN
      doc/pub/tutorial/fig-tut/pendulum1_wgrid.pdf
  85. BIN
      doc/pub/tutorial/fig-tut/pendulum1_wgrid.png
  86. BIN
      doc/pub/tutorial/fig-tut/pendulum5.pdf
  87. BIN
      doc/pub/tutorial/fig-tut/pendulum5.png
  88. BIN
      doc/pub/tutorial/fig-tut/pendulum5_wgrid.pdf
  89. BIN
      doc/pub/tutorial/fig-tut/pendulum5_wgrid.png
  90. BIN
      doc/pub/tutorial/fig-tut/vehicle0.pdf
  91. BIN
      doc/pub/tutorial/fig-tut/vehicle0.png
  92. BIN
      doc/pub/tutorial/fig-tut/vehicle0_dim.pdf
  93. BIN
      doc/pub/tutorial/fig-tut/vehicle0_dim.png
  94. BIN
      doc/pub/tutorial/fig-tut/vehicle0_hier1.pdf
  95. BIN
      doc/pub/tutorial/fig-tut/vehicle0_hier1.png
  96. BIN
      doc/pub/tutorial/fig-tut/vehicle0a.png
  97. BIN
      doc/pub/tutorial/fig-tut/vehicle0a_c.png
  98. BIN
      doc/pub/tutorial/fig-tut/vehicle0b.png
  99. BIN
      doc/pub/tutorial/fig-tut/vehicle0b_c.png
  100. 0 0
      doc/pub/tutorial/fig-tut/vehicle1.pdf

+ 0 - 1
.TODO/todo.txt

@@ -1 +0,0 @@
-* TikZ output: see misc/DrawTikZ.py.

+ 0 - 39
.gitignore

@@ -1,39 +0,0 @@
-syntax: glob
-# compiled files:
-*.o
-*.so
-*.a
-# temporary files:
-build
-*.bak
-*.swp
-*~
-.*~
-*.old
-tmp*
-temp*
-.#*
-\#*
-# tex files:
-*.log
-*.dvi
-*.aux
-*.blg
-*.idx
-*.nav
-*.out
-*.toc
-*.snm
-*.vrb
-# eclipse files:
-*.cproject
-*.project
-# misc:
-.DS_Store
-.idea
-__pycache__
-_minted-*
-# doconce:
-.*_html_file_collection
-.*.exerinfo
-.*.copyright

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 238 - 0
404.html


+ 0 - 150
README.do.txt

@@ -1,150 +0,0 @@
-======= Pysketcher =======
-
-Tool for creating sketches of physics problems in terms of Python code.
-
-===== Purpose =====
-
-Pysketcher can typically be used to draw figures like
-
-FIGURE: [doc/src/tut/fig-tut/wheel_on_inclined_plane, width=600 frac=0.6]
-
-Such figures can easily be *interactively* made using a lot of drawing
-programs.  A Pysketcher figure, however, is defined trough
-computer code. This gives a great advantage: geometric features can be
-parameterized in terms of variables. Geometric variations are then
-trivially generated. Also, complicated figures can be built as a
-hierarchy of simpler elements.  The figure can easily be made to move
-according to, e.g., a solution of a differential equation.
-
-Here is a very simple figure that illustrates how geometric features are
-parameterized by variables (H, R, L, etc.):
-
-FIGURE: [doc/src/tut/fig-tut/vehicle0_dim, width=600 frac=0.6]
-
-One can then quickly change parameters, below to
-`R=0.5; L=5; H=2` and `R=2; L=7; H=1`, and get new figures that would be
-tedious to draw manually in an interactive tool.
-
-FIGURE: [doc/src/tut/fig-tut/vehicle_v23, width=800]
-
-Another major feature of Pysketcher is the ability to let the
-sketch be dynamic and make an animation of the time evolution.
-Here is an example of a very simple vehicle on a bumpy road,
-where the solution of a differential equation (upper blue line) is fed
-back to the sketch to make a vertical displacement of the spring and
-other objects in the vehicle. "View animation": "http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/index.html" (the animation was created by
-"this Pysketcher script": "https://github.com/hplgit/bumpy/blob/master/doc/src/fig-bumpy/bumpy_road_fig.py").
-
-FIGURE: [http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/tmp_frame_0030.png, width=600]
-
-
-===== Tutorial =====
-
-For an introduction to Pysketcher, see the tutorial in "HTML": "http://hplgit.github.io/pysketcher/doc/pub/tutorial/pysketcher.html", "Sphinx": "http://hplgit.github.io/pysketcher/doc/pub/tutorial/html/index.html", or "PDF": "http://hplgit/github.io/pysketcher/doc/pub/tutorial/pysketcher.pdf" format (or a simplified version of
-the tutorial in Chapter 9 in "A Primer on Scientific Programming with Python": "http://www.amazon.com/Scientific-Programming-Computational-Science-Engineering/dp/3642549586/ref=sr_1_2?s=books&ie=UTF8&qid=1407225588&sr=1-2&keywords=langtangen", 4th edition, by H. P. Langtangen, Springer, 2014).
-
-===== Examples =====
-
-See the `examples` directory for some examples beyond the more basic
-ones in the tutorial.
-For example, an elastic beam can be sketched as
-
-FIGURE: [fig/beam2_3, width=600 frac=0.8]
-
-The sketch was created by the program "`examples/beam2.py`": "https://github.com/hplgit/pysketcher/tree/master/examples/beam2.py".
-
-Here is an illustration of the idea of numerical integration:
-
-FIGURE: [fig/integral_noncomic_strip, width=800 frac=1]
-
-As shown in the figure-generating program "`examples/integral_comic_strip.py`": "https://github.com/hplgit/pysketcher/tree/master/examples/integral_comic_strip.py",
-this illustration can easily be turned into an "XKCD": "http://xkcd.com" type of comic strip:
-
-FIGURE: [fig/integral_comic_strip, width=800 frac=1]
-
-===== Technology =====
-
-Pysketcher applies Matplotlib to make the drawings, but it should be quite
-straightforward to replace the backend `MatplotlibDraw.py` by similar code
-utilizing TikZ or another plotting package.
-
-The core of the Pysketcher software is a thin layer basically
-constructing a tree structure of elements in the sketch. A lot of
-classes are offered for different type of basic elements, such as
-Circle, Rectangle, Text, Text with arrow, Force, arbitrary curve, etc.
-Complicated figures can be created by sticking one figure into another
-(i.e., hierarchical building of figures by sticking one tree structure
-into another).
-
-===== Install =====
-
-Pysketcher is pure Python code and
-works with Python version 2 and 3. Just do the standard
-
-!bc sys
-Terminal> sudo python setup.py install
-!ec
-
-Pysketcher demands installation of the following packages:
-
- * Matplotlib (`sudp pip install matplotlib`)
- * Future (`sudo pip install future`)
- * NumPy (`sudo pip install numpy`)
-
-The `Spline` object in Pysketcher also requires SciPy (`sudo pip install scipy`).
-
-===== Citation =====
-
-If you use Pysketcher and want to cite it, you can either cite this
-web site or the book
-that has the original documentation of the tool.
-
-BibTeX format:
-
-!bc
-@book{Langtangen_2014,
-  title = {A Primer on Scientific Programming With {P}ython},
-  author = {H. P. Langtangen},
-  year = {2014},
-  publisher = {Springer},
-  edition = {Fourth},
-}
-
-@misc{Pysketcher,
-  title = {{P}ysketcher: {D}rawing tool for making sketches},
-  author = {H. P. Langtangen},
-  url = {https://github.com/hplgit/pysketcher},
-  key = {Pysketcher},
-  note = {\url{https://github.com/hplgit/pysketcher}},
-}
-!ec
-
-Publish format:
-
-!bc
-* books
-** A Primer on Scientific Programming With {P}ython
-   key:       Langtangen_2014
-   author:    H. P. Langtangen
-   year:      2014
-   publisher: Springer
-   status:    published
-   edition:   Fourth
-   entrytype: book
-* misc
-** {P}ysketcher: {D}rawing tool for making sketches
-   key:       Pysketcher
-   author:    H. P. Langtangen
-   url:       https://github.com/hplgit/pysketcher
-   status:    published
-   sortkey:   Pysketcher
-   note:      \url{https://github.com/hplgit/pysketcher}
-!ec
-
-===== History =====
-
-Pysketcher was first constructed as a powerful educational example on
-object-oriented programming for the book
-*A Primer on Scientific Programming With Python*, but the tool quickly
-became so useful for the author that it was further developed and
-heavily used for creating figures in other documents.

+ 0 - 161
README.md

@@ -1,161 +0,0 @@
-## Pysketcher
-
-Tool for creating sketches of physics problems in terms of Python code.
-
-### Purpose
-
-Pysketcher can typically be used to draw figures like
-
-<!-- <img src="doc/src/tut/fig-tut/wheel_on_inclined_plane.png" width=600> -->
-![](doc/src/tut/fig-tut/wheel_on_inclined_plane.png)
-
-Such figures can easily be *interactively* made using a lot of drawing
-programs.  A Pysketcher figure, however, is defined trough
-computer code. This gives a great advantage: geometric features can be
-parameterized in terms of variables. Geometric variations are then
-trivially generated. Also, complicated figures can be built as a
-hierarchy of simpler elements.  The figure can easily be made to move
-according to, e.g., a solution of a differential equation.
-
-Here is a very simple figure that illustrates how geometric features are
-parameterized by variables (H, R, L, etc.):
-
-<!-- <img src="doc/src/tut/fig-tut/vehicle0_dim.png" width=600> -->
-![](doc/src/tut/fig-tut/vehicle0_dim.png)
-
-One can then quickly change parameters, below to
-`R=0.5; L=5; H=2` and `R=2; L=7; H=1`, and get new figures that would be
-tedious to draw manually in an interactive tool.
-
-<!-- <img src="doc/src/tut/fig-tut/vehicle_v23.png" width=800> -->
-![](doc/src/tut/fig-tut/vehicle_v23.png)
-
-Another major feature of Pysketcher is the ability to let the
-sketch be dynamic and make an animation of the time evolution.
-Here is an example of a very simple vehicle on a bumpy road,
-where the solution of a differential equation (upper blue line) is fed
-back to the sketch to make a vertical displacement of the spring and
-other objects in the vehicle. [View animation](http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/index.html) (the animation was created by
-[this Pysketcher script](https://github.com/hplgit/bumpy/blob/master/doc/src/fig-bumpy/bumpy_road_fig.py)).
-
-<!-- <img src="http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/tmp_frame_0030.png" width=600> -->
-![](http://hplgit.github.io/bumpy/doc/src/mov-bumpy/m2_k1_5_b0_2/tmp_frame_0030.png)
-
-
-### Tutorial
-
-For an introduction to Pysketcher, see the tutorial in [HTML](http://hplgit.github.io/pysketcher/doc/pub/tutorial/pysketcher.html), [Sphinx](http://hplgit.github.io/pysketcher/doc/pub/tutorial/html/index.html), or [PDF](http://hplgit/github.io/pysketcher/doc/pub/tutorial/pysketcher.pdf) format (or a simplified version of
-the tutorial in Chapter 9 in [A Primer on Scientific Programming with Python](http://www.amazon.com/Scientific-Programming-Computational-Science-Engineering/dp/3642549586/ref=sr_1_2?s=books&ie=UTF8&qid=1407225588&sr=1-2&keywords=langtangen), 4th edition, by H. P. Langtangen, Springer, 2014).
-
-### Examples
-
-See the `examples` directory for some examples beyond the more basic
-ones in the tutorial.
-For example, a pendulum and its body diagram,
-
-<!-- <img src="fig/pendulum2.png" width=800> -->
-![](fig/pendulum2.png)
-
-can be created by the program [`examples/pendulum.py`](https://github.com/hplgit/pysketcher/tree/master/examples/pendulum.py).
-
-Here is an illustration of the idea of numerical integration:
-
-<!-- <img src="fig/integral_noncomic_strip.png" width=800> -->
-![](fig/integral_noncomic_strip.png)
-
-As shown in the figure-generating program [`examples/integral_comic_strip.py`](https://github.com/hplgit/pysketcher/tree/master/examples/integral_comic_strip.py),
-this illustration can easily be turned into an [XKCD](http://xkcd.com) type of comic strip:
-
-<!-- <img src="fig/integral_comic_strip.png" width=800> -->
-![](fig/integral_comic_strip.png)
-
-### Technology
-
-Pysketcher applies Matplotlib to make the drawings, but it should be quite
-straightforward to replace the backend `MatplotlibDraw.py` by similar code
-utilizing TikZ or another plotting package.
-
-The core of the Pysketcher software is a thin layer basically
-constructing a tree structure of elements in the sketch. A lot of
-classes are offered for different type of basic elements, such as
-Circle, Rectangle, Text, Text with arrow, Force, arbitrary curve, etc.
-Complicated figures can be created by sticking one figure into another
-(i.e., hierarchical building of figures by sticking one tree structure
-into another).
-
-### Install
-
-Pysketcher is pure Python code and
-works with Python version 2 and 3. Just do the standard
-
-
-```
-Terminal> sudo python setup.py install
-```
-
-Pysketcher demands installation of the following packages:
-
- * Matplotlib (`sudp pip install matplotlib`)
- * Future (`sudo pip install future`)
- * NumPy (`sudo pip install numpy`)
-
-The `Spline` object in Pysketcher also requires SciPy (`sudo pip install scipy`).
-
-### Citation
-
-If you use Pysketcher and want to cite it, you can either cite this
-web site or the book
-that has the original documentation of the tool.
-
-BibTeX format:
-
-
-```
-@book{Langtangen_2014,
-  title = {A Primer on Scientific Programming With {P}ython},
-  author = {H. P. Langtangen},
-  year = {2014},
-  publisher = {Springer},
-  edition = {Fourth},
-}
-
-@misc{Pysketcher,
-  title = {{P}ysketcher: {D}rawing tool for making sketches},
-  author = {H. P. Langtangen},
-  url = {https://github.com/hplgit/pysketcher},
-  key = {Pysketcher},
-  note = {\url{https://github.com/hplgit/pysketcher}},
-}
-```
-
-Publish format:
-
-
-```
-* books
-** A Primer on Scientific Programming With {P}ython
-   key:       Langtangen_2014
-   author:    H. P. Langtangen
-   year:      2014
-   publisher: Springer
-   status:    published
-   edition:   Fourth
-   entrytype: book
-* misc
-** {P}ysketcher: {D}rawing tool for making sketches
-   key:       Pysketcher
-   author:    H. P. Langtangen
-   url:       https://github.com/hplgit/pysketcher
-   status:    published
-   sortkey:   Pysketcher
-   note:      \url{https://github.com/hplgit/pysketcher}
-```
-
-### History
-
-Pysketcher was first constructed as a powerful educational example on
-object-oriented programming for the book
-*A Primer on Scientific Programming With Python*, but the tool quickly
-became so useful for the author that it was further developed and
-heavily used for creating figures in other documents.
-

+ 0 - 2
README.sh

@@ -1,2 +0,0 @@
-#!/bin/sh
-doconce format pandoc README --github_md

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 281 - 0
about/index.html


BIN
assets/images/favicon.png


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 0
assets/javascripts/bundle.1688372e.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/bundle.1688372e.min.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/lunr/min/lunr.ar.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.da.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.de.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.du.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.es.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.fi.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.fr.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.hu.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.it.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/lunr/min/lunr.ja.min.js


+ 1 - 0
assets/javascripts/lunr/min/lunr.jp.min.js

@@ -0,0 +1 @@
+module.exports=require("./lunr.ja");

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/lunr/min/lunr.multi.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.nl.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.no.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.pt.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.ro.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.ru.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/lunr/min/lunr.stemmer.support.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.sv.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 0
assets/javascripts/lunr/min/lunr.tr.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/lunr/min/lunr.vi.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/lunr/tinyseg.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 31 - 0
assets/javascripts/vendor.877163d5.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/vendor.877163d5.min.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 59 - 0
assets/javascripts/worker/search.a68abb33.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/javascripts/worker/search.a68abb33.min.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 0
assets/stylesheets/main.5be48db2.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/stylesheets/main.5be48db2.min.css.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 0
assets/stylesheets/palette.89d31e3b.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
assets/stylesheets/palette.89d31e3b.min.css.map


+ 0 - 291
doc/pub/tutorial/._pysketcher000.html

@@ -1,291 +0,0 @@
-<!--
-Automatically generated HTML file from DocOnce source
-(https://github.com/hplgit/doconce/)
--->
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
-<meta name="description" content="Using Pysketcher to Create Principal Sketches of Physics Problems">
-<meta name="keywords" content="tree data structure,recursive function calls">
-
-<title>Using Pysketcher to Create Principal Sketches of Physics Problems</title>
-
-<!-- Bootstrap style: bootswatch_readable -->
-<link href="http://netdna.bootstrapcdn.com/bootswatch/3.1.1/readable/bootstrap.min.css" rel="stylesheet">
-<!-- not necessary
-<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
--->
-
-<style type="text/css">
-
-/* Add scrollbar to dropdown menus in bootstrap navigation bar */
-.dropdown-menu {
-   height: auto;
-   max-height: 400px;
-   overflow-x: hidden;
-}
-</style>
-
-
-</head>
-
-<!-- tocinfo
-{'highest level': 1,
- 'sections': [('A first glimpse of Pysketcher', 1, None, '___sec0'),
-              ('Basic construction of sketches', 2, None, '___sec1'),
-              ('Basic drawing', 3, None, '___sec2'),
-              ('Groups of objects', 3, None, '___sec3'),
-              ('Changing line styles and colors', 3, None, '___sec4'),
-              ('The figure composition as an object hierarchy',
-               3,
-               None,
-               '___sec5'),
-              ('Animation: translating the vehicle', 3, None, '___sec6'),
-              ('Animation: rolling the wheels',
-               3,
-               'sketcher:vehicle1:anim',
-               'sketcher:vehicle1:anim'),
-              ('A simple pendulum',
-               1,
-               'sketcher:ex:pendulum',
-               'sketcher:ex:pendulum'),
-              ('The basic physics sketch',
-               2,
-               'sketcher:ex:pendulum:basic',
-               'sketcher:ex:pendulum:basic'),
-              ('The body diagram', 2, None, '___sec10'),
-              ('Animated body diagram',
-               2,
-               'sketcher:ex:pendulum:anim',
-               'sketcher:ex:pendulum:anim'),
-              ('Function for drawing the body diagram', 3, None, '___sec12'),
-              ('Equations for the motion and forces', 3, None, '___sec13'),
-              ('Numerical solution', 3, None, '___sec14'),
-              ('Animation', 3, None, '___sec15'),
-              ('Basic shapes', 1, None, '___sec16'),
-              ('Axis', 2, None, '___sec17'),
-              ('Distance with text', 2, None, '___sec18'),
-              ('Rectangle', 2, None, '___sec19'),
-              ('Triangle', 2, None, '___sec20'),
-              ('Arc', 2, None, '___sec21'),
-              ('Spring', 2, None, '___sec22'),
-              ('Dashpot', 2, None, '___sec23'),
-              ('Wavy', 2, None, '___sec24'),
-              ('Stochastic curves', 2, None, '___sec25'),
-              ('Inner workings of the Pysketcher tool', 1, None, '___sec26'),
-              ('Example of classes for geometric objects',
-               2,
-               None,
-               '___sec27'),
-              ('Simple geometric objects', 3, None, '___sec28'),
-              ('Class curve', 3, None, '___sec29'),
-              ('Compound geometric objects', 3, None, '___sec30'),
-              ('Adding functionality via recursion', 2, None, '___sec31'),
-              ('Basic principles of recursion', 3, None, '___sec32'),
-              ('Explaining recursion', 3, None, '___sec33'),
-              ('Scaling, translating, and rotating a figure',
-               2,
-               'sketcher:scaling',
-               'sketcher:scaling'),
-              ('Scaling', 3, None, '___sec35'),
-              ('Translation', 3, None, '___sec36'),
-              ('Rotation', 3, None, '___sec37')]}
-end of tocinfo -->
-
-<body>
-
-
-
-<script type="text/x-mathjax-config">
-MathJax.Hub.Config({
-  TeX: {
-     equationNumbers: {  autoNumber: "none"  },
-     extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"]
-  }
-});
-</script>
-<script type="text/javascript"
- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
-</script>
-
-<!-- newcommands.tex -->
-$$
-\newcommand{\half}{\frac{1}{2}}
-\newcommand{\tp}{\thinspace .}
-\newcommand{\rpos}{\boldsymbol{r}}
-\newcommand{\ii}{\boldsymbol{i}}
-\newcommand{\jj}{\boldsymbol{j}}
-\newcommand{\ir}{\boldsymbol{i}_r}
-\newcommand{\ith}{\boldsymbol{i}_{\theta}}
-$$
-
-
-
-
-    
-<!-- Bootstrap navigation bar -->
-<div class="navbar navbar-default navbar-fixed-top">
-  <div class="navbar-header">
-    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-    </button>
-    <a class="navbar-brand" href="pysketcher.html">Using Pysketcher to Create Principal Sketches of Physics Problems</a>
-  </div>
-
-  <div class="navbar-collapse collapse navbar-responsive-collapse">
-    <ul class="nav navbar-nav navbar-right">
-      <li class="dropdown">
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
-        <ul class="dropdown-menu">
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec0" style="font-size: 80%;"><b>A first glimpse of Pysketcher</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec1" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Basic construction of sketches</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec2" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic drawing</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec3" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Groups of objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec4" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changing line styles and colors</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec5" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The figure composition as an object hierarchy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec6" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: translating the vehicle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#sketcher:vehicle1:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: rolling the wheels</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum" style="font-size: 80%;"><b>A simple pendulum</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:basic" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The basic physics sketch</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec10" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Animated body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec12" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function for drawing the body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec13" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Equations for the motion and forces</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec14" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numerical solution</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec15" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec16" style="font-size: 80%;"><b>Basic shapes</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec17" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Axis</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec18" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Distance with text</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec19" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Rectangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec20" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Triangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec21" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Arc</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec22" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Spring</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec23" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Dashpot</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec24" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Wavy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec25" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Stochastic curves</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec26" style="font-size: 80%;"><b>Inner workings of the Pysketcher tool</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec27" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Example of classes for geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec28" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec29" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class curve</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec30" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compound geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec31" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Adding functionality via recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec32" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic principles of recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec33" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Explaining recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#sketcher:scaling" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Scaling, translating, and rotating a figure</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec35" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scaling</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec36" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec37" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotation</a></li>
-
-        </ul>
-      </li>
-    </ul>
-  </div>
-</div>
-</div> <!-- end of navigation bar -->
-
-<div class="container">
-
-<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
-
-<a name="part0000"></a>
-<!-- ------------------- main content ---------------------- -->
-
-
-
-<div class="jumbotron">
-<center><h1>Using Pysketcher to Create Principal Sketches of Physics Problems</h1></center>  <!-- document title -->
-
-<p>
-<!-- author(s): Hans Petter Langtangen -->
-
-<center>
-<b>Hans Petter Langtangen</b> [1, 2]
-</center>
-
-<p>
-<!-- institution(s) -->
-
-<center>[1] <b>Center for Biomedical Computing, Simula Research Laboratory</b></center>
-<center>[2] <b>Department of Informatics, University of Oslo</b></center>
-<br>
-<p>
-<center><h4>Jan 22, 2016</h4></center> <!-- date -->
-<br>
-<p>
-
-<!-- begin box -->
-<div style="width: 95%; padding: 10px; border: 1px solid #000; border-radius: 4px;">
-This document is derived from Chapter 9 in the book
-<a href="http://www.amazon.com/Scientific-Programming-Computational-Science-Engineering/dp/3642549586/ref=sr_1_2?s=books&ie=UTF8&qid=1407225588&sr=1-2&keywords=langtangen" target="_self">A Primer on Scientific Programming with Python</a>, by H. P. Langtangen,
-4th edition, Springer, 2014.
-</div>
-<!-- end box -->
-
-
-<p>
-<b>Abstract.</b> Pysketcher is a Python package which allows principal sketches of
-physics and mechanics problems to be realized through short programs
-instead of interactive (and potentially tedious and inaccurate)
-drawing.  Elements of the sketch, such as lines, circles, angles,
-forces, coordinate systems, etc., are realized as objects and
-collected in hierarchical structures. Parts of the hierarchical
-structures can easily change line styles and colors, or be copied,
-scaled, translated, and rotated. These features make it
-straightforward to move parts of the sketch to create animation,
-usually in accordance with the physics of the underlying problem.
-Exact dimensioning of the elements in the sketch is trivial to obtain
-since distances are specified in computer code.
-
-<p>
-Pysketcher is easy to learn from a number of examples. Beyond
-essential Python programming and a knowledge about mechanics problems,
-no further background is required.
-
-<p>
-<!-- Task (can be questions): make sketches of physical problems, see fig -->
-<!-- through user-friendly composition of basic shapes -->
-<!-- Desired knowledge: plotting curves, basic OO (ch. X.Y, ...) -->
-<!-- Required knowledge? -->
-<!-- Learning Goals: these targets the inner workings of pysketcher, -->
-<!-- which is just a part of this document... -->
-
-<p>
-
-
-<p><a href="._pysketcher001.html" class="btn btn-primary btn-lg">Read &raquo;</a></p>
-
-
-</div> <!-- end jumbotron -->
-
-<p>
-<!-- navigation buttons at the bottom of the page -->
-<ul class="pagination">
-  <li class="active"><a href="._pysketcher000.html">1</a></li>
-  <li><a href="._pysketcher001.html">2</a></li>
-  <li><a href="._pysketcher002.html">3</a></li>
-  <li><a href="._pysketcher003.html">4</a></li>
-  <li><a href="._pysketcher004.html">5</a></li>
-  <li><a href="._pysketcher005.html">6</a></li>
-  <li><a href="._pysketcher001.html">&raquo;</a></li>
-</ul>
-<!-- ------------------- end of main content --------------- -->
-
-</div>  <!-- end container -->
-<!-- include javascript, jQuery *first* -->
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
-
-<!-- Bootstrap footer
-<footer>
-<a href="http://..."><img width="250" align=right src="http://..."></a>
-</footer>
--->
-
-
-</body>
-</html>
-    
-

+ 0 - 251
doc/pub/tutorial/._pysketcher001.html

@@ -1,251 +0,0 @@
-<!--
-Automatically generated HTML file from DocOnce source
-(https://github.com/hplgit/doconce/)
--->
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
-<meta name="description" content="Using Pysketcher to Create Principal Sketches of Physics Problems">
-<meta name="keywords" content="tree data structure,recursive function calls">
-
-<title>Using Pysketcher to Create Principal Sketches of Physics Problems</title>
-
-<!-- Bootstrap style: bootswatch_readable -->
-<link href="http://netdna.bootstrapcdn.com/bootswatch/3.1.1/readable/bootstrap.min.css" rel="stylesheet">
-<!-- not necessary
-<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
--->
-
-<style type="text/css">
-
-/* Add scrollbar to dropdown menus in bootstrap navigation bar */
-.dropdown-menu {
-   height: auto;
-   max-height: 400px;
-   overflow-x: hidden;
-}
-</style>
-
-
-</head>
-
-<!-- tocinfo
-{'highest level': 1,
- 'sections': [('A first glimpse of Pysketcher', 1, None, '___sec0'),
-              ('Basic construction of sketches', 2, None, '___sec1'),
-              ('Basic drawing', 3, None, '___sec2'),
-              ('Groups of objects', 3, None, '___sec3'),
-              ('Changing line styles and colors', 3, None, '___sec4'),
-              ('The figure composition as an object hierarchy',
-               3,
-               None,
-               '___sec5'),
-              ('Animation: translating the vehicle', 3, None, '___sec6'),
-              ('Animation: rolling the wheels',
-               3,
-               'sketcher:vehicle1:anim',
-               'sketcher:vehicle1:anim'),
-              ('A simple pendulum',
-               1,
-               'sketcher:ex:pendulum',
-               'sketcher:ex:pendulum'),
-              ('The basic physics sketch',
-               2,
-               'sketcher:ex:pendulum:basic',
-               'sketcher:ex:pendulum:basic'),
-              ('The body diagram', 2, None, '___sec10'),
-              ('Animated body diagram',
-               2,
-               'sketcher:ex:pendulum:anim',
-               'sketcher:ex:pendulum:anim'),
-              ('Function for drawing the body diagram', 3, None, '___sec12'),
-              ('Equations for the motion and forces', 3, None, '___sec13'),
-              ('Numerical solution', 3, None, '___sec14'),
-              ('Animation', 3, None, '___sec15'),
-              ('Basic shapes', 1, None, '___sec16'),
-              ('Axis', 2, None, '___sec17'),
-              ('Distance with text', 2, None, '___sec18'),
-              ('Rectangle', 2, None, '___sec19'),
-              ('Triangle', 2, None, '___sec20'),
-              ('Arc', 2, None, '___sec21'),
-              ('Spring', 2, None, '___sec22'),
-              ('Dashpot', 2, None, '___sec23'),
-              ('Wavy', 2, None, '___sec24'),
-              ('Stochastic curves', 2, None, '___sec25'),
-              ('Inner workings of the Pysketcher tool', 1, None, '___sec26'),
-              ('Example of classes for geometric objects',
-               2,
-               None,
-               '___sec27'),
-              ('Simple geometric objects', 3, None, '___sec28'),
-              ('Class curve', 3, None, '___sec29'),
-              ('Compound geometric objects', 3, None, '___sec30'),
-              ('Adding functionality via recursion', 2, None, '___sec31'),
-              ('Basic principles of recursion', 3, None, '___sec32'),
-              ('Explaining recursion', 3, None, '___sec33'),
-              ('Scaling, translating, and rotating a figure',
-               2,
-               'sketcher:scaling',
-               'sketcher:scaling'),
-              ('Scaling', 3, None, '___sec35'),
-              ('Translation', 3, None, '___sec36'),
-              ('Rotation', 3, None, '___sec37')]}
-end of tocinfo -->
-
-<body>
-
-
-
-<script type="text/x-mathjax-config">
-MathJax.Hub.Config({
-  TeX: {
-     equationNumbers: {  autoNumber: "none"  },
-     extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"]
-  }
-});
-</script>
-<script type="text/javascript"
- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
-</script>
-
-<!-- newcommands.tex -->
-$$
-\newcommand{\half}{\frac{1}{2}}
-\newcommand{\tp}{\thinspace .}
-\newcommand{\rpos}{\boldsymbol{r}}
-\newcommand{\ii}{\boldsymbol{i}}
-\newcommand{\jj}{\boldsymbol{j}}
-\newcommand{\ir}{\boldsymbol{i}_r}
-\newcommand{\ith}{\boldsymbol{i}_{\theta}}
-$$
-
-
-
-
-    
-<!-- Bootstrap navigation bar -->
-<div class="navbar navbar-default navbar-fixed-top">
-  <div class="navbar-header">
-    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-    </button>
-    <a class="navbar-brand" href="pysketcher.html">Using Pysketcher to Create Principal Sketches of Physics Problems</a>
-  </div>
-
-  <div class="navbar-collapse collapse navbar-responsive-collapse">
-    <ul class="nav navbar-nav navbar-right">
-      <li class="dropdown">
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
-        <ul class="dropdown-menu">
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec0" style="font-size: 80%;"><b>A first glimpse of Pysketcher</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec1" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Basic construction of sketches</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec2" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic drawing</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec3" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Groups of objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec4" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changing line styles and colors</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec5" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The figure composition as an object hierarchy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec6" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: translating the vehicle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#sketcher:vehicle1:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: rolling the wheels</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum" style="font-size: 80%;"><b>A simple pendulum</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:basic" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The basic physics sketch</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec10" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Animated body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec12" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function for drawing the body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec13" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Equations for the motion and forces</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec14" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numerical solution</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec15" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec16" style="font-size: 80%;"><b>Basic shapes</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec17" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Axis</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec18" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Distance with text</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec19" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Rectangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec20" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Triangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec21" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Arc</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec22" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Spring</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec23" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Dashpot</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec24" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Wavy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec25" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Stochastic curves</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec26" style="font-size: 80%;"><b>Inner workings of the Pysketcher tool</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec27" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Example of classes for geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec28" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec29" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class curve</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec30" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compound geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec31" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Adding functionality via recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec32" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic principles of recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec33" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Explaining recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#sketcher:scaling" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Scaling, translating, and rotating a figure</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec35" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scaling</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec36" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec37" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotation</a></li>
-
-        </ul>
-      </li>
-    </ul>
-  </div>
-</div>
-</div> <!-- end of navigation bar -->
-
-<div class="container">
-
-<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
-
-<a name="part0001"></a>
-<!-- !split -->
-
-<h2>
-Table of contents</h2>
-
-<p>
-<a href="._pysketcher002.html#___sec0"> A first glimpse of Pysketcher </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher002.html#___sec1"> Basic construction of sketches </a><br>
-<a href="._pysketcher003.html#sketcher:ex:pendulum"> A simple pendulum </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher003.html#sketcher:ex:pendulum:basic"> The basic physics sketch </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher003.html#___sec10"> The body diagram </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher003.html#sketcher:ex:pendulum:anim"> Animated body diagram </a><br>
-<a href="._pysketcher004.html#___sec16"> Basic shapes </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec17"> Axis </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec18"> Distance with text </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec19"> Rectangle </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec20"> Triangle </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec21"> Arc </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec22"> Spring </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec23"> Dashpot </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec24"> Wavy </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher004.html#___sec25"> Stochastic curves </a><br>
-<a href="._pysketcher005.html#___sec26"> Inner workings of the Pysketcher tool </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher005.html#___sec27"> Example of classes for geometric objects </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher005.html#___sec31"> Adding functionality via recursion </a><br>
-&nbsp; &nbsp; &nbsp; <a href="._pysketcher005.html#sketcher:scaling"> Scaling, translating, and rotating a figure </a><br>
-</p>
-<p>
-<p>
-<!-- navigation buttons at the bottom of the page -->
-<ul class="pagination">
-<li><a href="._pysketcher000.html">&laquo;</a></li>
-  <li><a href="._pysketcher000.html">1</a></li>
-  <li class="active"><a href="._pysketcher001.html">2</a></li>
-  <li><a href="._pysketcher002.html">3</a></li>
-  <li><a href="._pysketcher003.html">4</a></li>
-  <li><a href="._pysketcher004.html">5</a></li>
-  <li><a href="._pysketcher005.html">6</a></li>
-  <li><a href="._pysketcher002.html">&raquo;</a></li>
-</ul>
-<!-- ------------------- end of main content --------------- -->
-
-</div>  <!-- end container -->
-<!-- include javascript, jQuery *first* -->
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
-
-<!-- Bootstrap footer
-<footer>
-<a href="http://..."><img width="250" align=right src="http://..."></a>
-</footer>
--->
-
-
-</body>
-</html>
-    
-

+ 0 - 887
doc/pub/tutorial/._pysketcher002.html

@@ -1,887 +0,0 @@
-<!--
-Automatically generated HTML file from DocOnce source
-(https://github.com/hplgit/doconce/)
--->
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
-<meta name="description" content="Using Pysketcher to Create Principal Sketches of Physics Problems">
-<meta name="keywords" content="tree data structure,recursive function calls">
-
-<title>Using Pysketcher to Create Principal Sketches of Physics Problems</title>
-
-<!-- Bootstrap style: bootswatch_readable -->
-<link href="http://netdna.bootstrapcdn.com/bootswatch/3.1.1/readable/bootstrap.min.css" rel="stylesheet">
-<!-- not necessary
-<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
--->
-
-<style type="text/css">
-
-/* Add scrollbar to dropdown menus in bootstrap navigation bar */
-.dropdown-menu {
-   height: auto;
-   max-height: 400px;
-   overflow-x: hidden;
-}
-</style>
-
-
-</head>
-
-<!-- tocinfo
-{'highest level': 1,
- 'sections': [('A first glimpse of Pysketcher', 1, None, '___sec0'),
-              ('Basic construction of sketches', 2, None, '___sec1'),
-              ('Basic drawing', 3, None, '___sec2'),
-              ('Groups of objects', 3, None, '___sec3'),
-              ('Changing line styles and colors', 3, None, '___sec4'),
-              ('The figure composition as an object hierarchy',
-               3,
-               None,
-               '___sec5'),
-              ('Animation: translating the vehicle', 3, None, '___sec6'),
-              ('Animation: rolling the wheels',
-               3,
-               'sketcher:vehicle1:anim',
-               'sketcher:vehicle1:anim'),
-              ('A simple pendulum',
-               1,
-               'sketcher:ex:pendulum',
-               'sketcher:ex:pendulum'),
-              ('The basic physics sketch',
-               2,
-               'sketcher:ex:pendulum:basic',
-               'sketcher:ex:pendulum:basic'),
-              ('The body diagram', 2, None, '___sec10'),
-              ('Animated body diagram',
-               2,
-               'sketcher:ex:pendulum:anim',
-               'sketcher:ex:pendulum:anim'),
-              ('Function for drawing the body diagram', 3, None, '___sec12'),
-              ('Equations for the motion and forces', 3, None, '___sec13'),
-              ('Numerical solution', 3, None, '___sec14'),
-              ('Animation', 3, None, '___sec15'),
-              ('Basic shapes', 1, None, '___sec16'),
-              ('Axis', 2, None, '___sec17'),
-              ('Distance with text', 2, None, '___sec18'),
-              ('Rectangle', 2, None, '___sec19'),
-              ('Triangle', 2, None, '___sec20'),
-              ('Arc', 2, None, '___sec21'),
-              ('Spring', 2, None, '___sec22'),
-              ('Dashpot', 2, None, '___sec23'),
-              ('Wavy', 2, None, '___sec24'),
-              ('Stochastic curves', 2, None, '___sec25'),
-              ('Inner workings of the Pysketcher tool', 1, None, '___sec26'),
-              ('Example of classes for geometric objects',
-               2,
-               None,
-               '___sec27'),
-              ('Simple geometric objects', 3, None, '___sec28'),
-              ('Class curve', 3, None, '___sec29'),
-              ('Compound geometric objects', 3, None, '___sec30'),
-              ('Adding functionality via recursion', 2, None, '___sec31'),
-              ('Basic principles of recursion', 3, None, '___sec32'),
-              ('Explaining recursion', 3, None, '___sec33'),
-              ('Scaling, translating, and rotating a figure',
-               2,
-               'sketcher:scaling',
-               'sketcher:scaling'),
-              ('Scaling', 3, None, '___sec35'),
-              ('Translation', 3, None, '___sec36'),
-              ('Rotation', 3, None, '___sec37')]}
-end of tocinfo -->
-
-<body>
-
-
-
-<script type="text/x-mathjax-config">
-MathJax.Hub.Config({
-  TeX: {
-     equationNumbers: {  autoNumber: "none"  },
-     extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"]
-  }
-});
-</script>
-<script type="text/javascript"
- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
-</script>
-
-<!-- newcommands.tex -->
-$$
-\newcommand{\half}{\frac{1}{2}}
-\newcommand{\tp}{\thinspace .}
-\newcommand{\rpos}{\boldsymbol{r}}
-\newcommand{\ii}{\boldsymbol{i}}
-\newcommand{\jj}{\boldsymbol{j}}
-\newcommand{\ir}{\boldsymbol{i}_r}
-\newcommand{\ith}{\boldsymbol{i}_{\theta}}
-$$
-
-
-
-
-    
-<!-- Bootstrap navigation bar -->
-<div class="navbar navbar-default navbar-fixed-top">
-  <div class="navbar-header">
-    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-    </button>
-    <a class="navbar-brand" href="pysketcher.html">Using Pysketcher to Create Principal Sketches of Physics Problems</a>
-  </div>
-
-  <div class="navbar-collapse collapse navbar-responsive-collapse">
-    <ul class="nav navbar-nav navbar-right">
-      <li class="dropdown">
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
-        <ul class="dropdown-menu">
-     <!-- navigation toc: --> <li><a href="#___sec0" style="font-size: 80%;"><b>A first glimpse of Pysketcher</b></a></li>
-     <!-- navigation toc: --> <li><a href="#___sec1" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Basic construction of sketches</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec2" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic drawing</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec3" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Groups of objects</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec4" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changing line styles and colors</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec5" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The figure composition as an object hierarchy</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec6" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: translating the vehicle</a></li>
-     <!-- navigation toc: --> <li><a href="#sketcher:vehicle1:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: rolling the wheels</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum" style="font-size: 80%;"><b>A simple pendulum</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:basic" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The basic physics sketch</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec10" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Animated body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec12" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function for drawing the body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec13" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Equations for the motion and forces</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec14" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numerical solution</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec15" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec16" style="font-size: 80%;"><b>Basic shapes</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec17" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Axis</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec18" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Distance with text</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec19" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Rectangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec20" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Triangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec21" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Arc</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec22" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Spring</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec23" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Dashpot</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec24" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Wavy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec25" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Stochastic curves</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec26" style="font-size: 80%;"><b>Inner workings of the Pysketcher tool</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec27" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Example of classes for geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec28" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec29" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class curve</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec30" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compound geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec31" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Adding functionality via recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec32" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic principles of recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec33" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Explaining recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#sketcher:scaling" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Scaling, translating, and rotating a figure</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec35" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scaling</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec36" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec37" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotation</a></li>
-
-        </ul>
-      </li>
-    </ul>
-  </div>
-</div>
-</div> <!-- end of navigation bar -->
-
-<div class="container">
-
-<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
-
-<a name="part0002"></a>
-<!-- !split -->
-
-<h1 id="___sec0">A first glimpse of Pysketcher </h1>
-
-<p>
-Formulation of physical problems makes heavy use of <em>principal sketches</em>
-such as the one in Figure <a href="#sketcher:fig:inclinedplane">1</a>.
-This particular sketch illustrates the classical mechanics problem
-of a rolling wheel on an inclined plane.
-The figure
-is made up many individual elements: a rectangle
-filled with a pattern (the inclined plane), a hollow circle with color
-(the wheel), arrows with labels (the \( N \) and \( Mg \) forces, and the \( x \)
-axis), an angle with symbol \( \theta \), and a dashed line indicating the
-starting location of the wheel.
-
-<p>
-Drawing software and plotting programs can produce such figures quite
-easily in principle, but the amount of details the user needs to
-control with the mouse can be substantial. Software more tailored to
-producing sketches of this type would work with more convenient
-abstractions, such as circle, wall, angle, force arrow, axis, and so
-forth. And as soon we start <em>programming</em> to construct the figure we
-get a range of other powerful tools at disposal. For example, we can
-easily translate and rotate parts of the figure and make an animation
-that illustrates the physics of the problem.
-Programming as a superior alternative to interactive drawing is
-the mantra of this section.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 1:  Sketch of a physics problem. <div id="sketcher:fig:inclinedplane"></div> </p></center>
-<p><img src="fig-tut/wheel_on_inclined_plane.png" align="bottom" width=400></p>
-</center>
-
-<h2 id="___sec1">Basic construction of sketches </h2>
-
-<p>
-Before attacking real-life sketches as in Figure <a href="#sketcher:fig:inclinedplane">1</a>
-we focus on the significantly simpler drawing shown
-in Figure <a href="#sketcher:fig:vehicle0">2</a>.  This toy sketch consists of
-several elements: two circles, two rectangles, and a &quot;ground&quot; element.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 2:  Sketch of a simple figure. <div id="sketcher:fig:vehicle0"></div> </p></center>
-<p><img src="fig-tut/vehicle0_dim.png" align="bottom" width=600></p>
-</center>
-
-<p>
-When the sketch is defined in terms of computer code, it is natural to
-parameterize geometric features, such as the radius of the wheel (\( R \)),
-the center point of the left wheel (\( w_1 \)), as well as the height (\( H \)) and
-length (\( L \)) of the main part. The simple vehicle in
-Figure <a href="#sketcher:fig:vehicle0">2</a> is quickly drawn in almost any interactive
-tool. However, if we want to change the radius of the wheels, you need a
-sophisticated drawing tool to avoid redrawing the whole figure, while
-in computer code this is a matter of changing the \( R \) parameter and
-rerunning the program.
-For example, Figure <a href="#sketcher:fig:vehicle0b">3</a> shows
-a variation of the drawing in
-Figure <a href="#sketcher:fig:vehicle0">2</a> obtained by just setting
-\( R=0.5 \), \( L=5 \), \( H=2 \), and \( R=2 \). Being able
-to quickly change geometric sizes is key to many problem settings in
-physics and engineering, but then a program must define the geometry.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 3:  Redrawing a figure with other geometric parameters. <div id="sketcher:fig:vehicle0b"></div> </p></center>
-<p><img src="fig-tut/vehicle_v2.png" align="bottom" width=500></p>
-</center>
-
-<h3 id="___sec2">Basic drawing </h3>
-
-<p>
-A typical program creating these five elements is shown next.
-After importing the <code>pysketcher</code> package, the first task is always to
-define a coordinate system:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">pysketcher</span> <span style="color: #008000; font-weight: bold">import</span> <span style="color: #666666">*</span>
-
-drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-    xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=10</span>, ymin<span style="color: #666666">=-1</span>, ymax<span style="color: #666666">=8</span>)
-</pre></div>
-<p>
-Instead of working with lengths expressed by specific numbers it is
-highly recommended to use variables to parameterize lengths as
-this makes it easier to change dimensions later.
-Here we introduce some key lengths for the radius of the wheels,
-distance between the wheels, etc.:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">R <span style="color: #666666">=</span> <span style="color: #666666">1</span>    <span style="color: #408080; font-style: italic"># radius of wheel</span>
-L <span style="color: #666666">=</span> <span style="color: #666666">4</span>    <span style="color: #408080; font-style: italic"># distance between wheels</span>
-H <span style="color: #666666">=</span> <span style="color: #666666">2</span>    <span style="color: #408080; font-style: italic"># height of vehicle body</span>
-w_1 <span style="color: #666666">=</span> <span style="color: #666666">5</span>  <span style="color: #408080; font-style: italic"># position of front wheel</span>
-drawing_tool<span style="color: #666666">.</span>set_coordinate_system(xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=</span>w_1 <span style="color: #666666">+</span> <span style="color: #666666">2*</span>L <span style="color: #666666">+</span> <span style="color: #666666">3*</span>R,
-                                   ymin<span style="color: #666666">=-1</span>, ymax<span style="color: #666666">=2*</span>R <span style="color: #666666">+</span> <span style="color: #666666">3*</span>H)
-</pre></div>
-<p>
-With the drawing area in place we can make the first <code>Circle</code> object
-in an intuitive fashion:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">wheel1 <span style="color: #666666">=</span> Circle(center<span style="color: #666666">=</span>(w_1, R), radius<span style="color: #666666">=</span>R)
-</pre></div>
-<p>
-to change dimensions later.
-
-<p>
-To translate the geometric information about the <code>wheel1</code> object to
-instructions for the plotting engine (in this case Matplotlib), one calls the
-<code>wheel1.draw()</code>. To display all drawn objects, one issues
-<code>drawing_tool.display()</code>. The typical steps are hence:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">wheel1 <span style="color: #666666">=</span> Circle(center<span style="color: #666666">=</span>(w_1, R), radius<span style="color: #666666">=</span>R)
-wheel1<span style="color: #666666">.</span>draw()
-
-<span style="color: #408080; font-style: italic"># Define other objects and call their draw() methods</span>
-drawing_tool<span style="color: #666666">.</span>display()
-drawing_tool<span style="color: #666666">.</span>savefig(<span style="color: #BA2121">&#39;tmp.png&#39;</span>)  <span style="color: #408080; font-style: italic"># store picture</span>
-</pre></div>
-<p>
-The next wheel can be made by taking a copy of <code>wheel1</code> and
-translating the object to the right according to a
-displacement vector \( (L,0) \):
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">wheel2 <span style="color: #666666">=</span> wheel1<span style="color: #666666">.</span>copy()
-wheel2<span style="color: #666666">.</span>translate((L,<span style="color: #666666">0</span>))
-</pre></div>
-<p>
-The two rectangles are also made in an intuitive way:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">under <span style="color: #666666">=</span> Rectangle(lower_left_corner<span style="color: #666666">=</span>(w_1<span style="color: #666666">-2*</span>R, <span style="color: #666666">2*</span>R),
-                  width<span style="color: #666666">=2*</span>R <span style="color: #666666">+</span> L <span style="color: #666666">+</span> <span style="color: #666666">2*</span>R, height<span style="color: #666666">=</span>H)
-over  <span style="color: #666666">=</span> Rectangle(lower_left_corner<span style="color: #666666">=</span>(w_1, <span style="color: #666666">2*</span>R <span style="color: #666666">+</span> H),
-                  width<span style="color: #666666">=2.5*</span>R, height<span style="color: #666666">=1.25*</span>H)
-</pre></div>
-
-<h3 id="___sec3">Groups of objects </h3>
-
-<p>
-Instead of calling the <code>draw</code> method of every object, we can
-group objects and call <code>draw</code>, or perform other operations, for
-the whole group. For example, we may collect the two wheels
-in a <code>wheels</code> group and the <code>over</code> and <code>under</code> rectangles
-in a <code>body</code> group. The whole vehicle is a composition
-of its <code>wheels</code> and <code>body</code> groups. The code goes like
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">wheels  <span style="color: #666666">=</span> Composition({<span style="color: #BA2121">&#39;wheel1&#39;</span>: wheel1, <span style="color: #BA2121">&#39;wheel2&#39;</span>: wheel2})
-body    <span style="color: #666666">=</span> Composition({<span style="color: #BA2121">&#39;under&#39;</span>: under, <span style="color: #BA2121">&#39;over&#39;</span>: over})
-
-vehicle <span style="color: #666666">=</span> Composition({<span style="color: #BA2121">&#39;wheels&#39;</span>: wheels, <span style="color: #BA2121">&#39;body&#39;</span>: body})
-</pre></div>
-<p>
-The ground is illustrated by an object of type <code>Wall</code>,
-mostly used to indicate walls in sketches of mechanical systems.
-A <code>Wall</code> takes the <code>x</code> and <code>y</code> coordinates of some curve,
-and a <code>thickness</code> parameter, and creates a thick curve filled
-with a simple pattern. In this case the curve is just a flat
-line so the construction is made of two points on the
-ground line (\( (w_1-L,0) \) and \( (w_1+3L,0) \)):
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">ground <span style="color: #666666">=</span> Wall(x<span style="color: #666666">=</span>[w_1 <span style="color: #666666">-</span> L, w_1 <span style="color: #666666">+</span> <span style="color: #666666">3*</span>L], y<span style="color: #666666">=</span>[<span style="color: #666666">0</span>, <span style="color: #666666">0</span>], thickness<span style="color: #666666">=-0.3*</span>R)
-</pre></div>
-<p>
-The negative thickness makes the pattern-filled rectangle appear below
-the defined line, otherwise it appears above.
-
-<p>
-We may now collect all the objects in a &quot;top&quot; object that contains
-the whole figure:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">fig <span style="color: #666666">=</span> Composition({<span style="color: #BA2121">&#39;vehicle&#39;</span>: vehicle, <span style="color: #BA2121">&#39;ground&#39;</span>: ground})
-fig<span style="color: #666666">.</span>draw()  <span style="color: #408080; font-style: italic"># send all figures to plotting backend</span>
-drawing_tool<span style="color: #666666">.</span>display()
-drawing_tool<span style="color: #666666">.</span>savefig(<span style="color: #BA2121">&#39;tmp.png&#39;</span>)
-</pre></div>
-<p>
-The <code>fig.draw()</code> call will visit
-all subgroups, their subgroups,
-and so forth in the hierarchical tree structure of
-figure elements,
-and call <code>draw</code> for every object.
-
-<h3 id="___sec4">Changing line styles and colors </h3>
-
-<p>
-Controlling the line style, line color, and line width is
-fundamental when designing figures. The <code>pysketcher</code>
-package allows the user to control such properties in
-single objects, but also set global properties that are
-used if the object has no particular specification of
-the properties. Setting the global properties are done like
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">drawing_tool<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dashed&#39;</span>)
-drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;black&#39;</span>)
-drawing_tool<span style="color: #666666">.</span>set_linewidth(<span style="color: #666666">4</span>)
-</pre></div>
-<p>
-At the object level the properties are specified in a similar
-way:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">wheels<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;solid&#39;</span>)
-wheels<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;red&#39;</span>)
-</pre></div>
-<p>
-and so on.
-
-<p>
-Geometric figures can be specified as <em>filled</em>, either with a color or with a
-special visual pattern:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #408080; font-style: italic"># Set filling of all curves</span>
-drawing_tool<span style="color: #666666">.</span>set_filled_curves(color<span style="color: #666666">=</span><span style="color: #BA2121">&#39;blue&#39;</span>, pattern<span style="color: #666666">=</span><span style="color: #BA2121">&#39;/&#39;</span>)
-
-<span style="color: #408080; font-style: italic"># Turn off filling of all curves</span>
-drawing_tool<span style="color: #666666">.</span>set_filled_curves(<span style="color: #008000">False</span>)
-
-<span style="color: #408080; font-style: italic"># Fill the wheel with red color</span>
-wheel1<span style="color: #666666">.</span>set_filled_curves(<span style="color: #BA2121">&#39;red&#39;</span>)
-</pre></div>
-<p>
-<!-- <a href="http://packages.python.org/ete2/" target="_self"><tt>http://packages.python.org/ete2/</tt></a> for visualizing tree structures! -->
-
-<h3 id="___sec5">The figure composition as an object hierarchy </h3>
-
-<p>
-The composition of objects making up the figure
-is hierarchical, similar to a family, where
-each object has a parent and a number of children. Do a
-<code>print fig</code> to display the relations:
-<p>
-
-<!-- code=text (!bc dat) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">ground
-    wall
-vehicle
-    body
-        over
-            rectangle
-        under
-            rectangle
-    wheels
-        wheel1
-            arc
-        wheel2
-            arc
-</pre></div>
-<p>
-The indentation reflects how deep down in the hierarchy (family)
-we are.
-This output is to be interpreted as follows:
-
-<ul>
-  <li> <code>fig</code> contains two objects, <code>ground</code> and <code>vehicle</code></li>
-  <li> <code>ground</code> contains an object <code>wall</code></li>
-  <li> <code>vehicle</code> contains two objects, <code>body</code> and <code>wheels</code></li>
-  <li> <code>body</code> contains two objects, <code>over</code> and <code>under</code></li>
-  <li> <code>wheels</code> contains two objects, <code>wheel1</code> and <code>wheel2</code></li>
-</ul>
-
-In this listing there are also objects not defined by the
-programmer: <code>rectangle</code> and <code>arc</code>. These are of type <code>Curve</code>
-and automatically generated by the classes <code>Rectangle</code> and <code>Circle</code>.
-
-<p>
-More detailed information can be printed by
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">print</span> fig<span style="color: #666666">.</span>show_hierarchy(<span style="color: #BA2121">&#39;std&#39;</span>)
-</pre></div>
-<p>
-yielding the output
-<p>
-
-<!-- code=text (!bc dat) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">ground (Wall):
-    wall (Curve): 4 coords fillcolor=&#39;white&#39; fillpattern=&#39;/&#39;
-vehicle (Composition):
-    body (Composition):
-        over (Rectangle):
-            rectangle (Curve): 5 coords
-        under (Rectangle):
-            rectangle (Curve): 5 coords
-    wheels (Composition):
-        wheel1 (Circle):
-            arc (Curve): 181 coords
-        wheel2 (Circle):
-            arc (Curve): 181 coords
-</pre></div>
-<p>
-Here we can see the class type for each figure object, how many
-coordinates that are involved in basic figures (<code>Curve</code> objects), and
-special settings of the basic figure (fillcolor, line types, etc.).
-For example, <code>wheel2</code> is a <code>Circle</code> object consisting of an <code>arc</code>,
-which is a <code>Curve</code> object consisting of 181 coordinates (the
-points needed to draw a smooth circle). The <code>Curve</code> objects are the
-only objects that really holds specific coordinates to be drawn.
-The other object types are just compositions used to group
-parts of the complete figure.
-
-<p>
-One can also get a graphical overview of the hierarchy of figure objects
-that build up a particular figure <code>fig</code>.
-Just call <code>fig.graphviz_dot('fig')</code> to produce a file <code>fig.dot</code> in
-the <em>dot format</em>. This file contains relations between parent and
-child objects in the figure and can be turned into an image,
-as in Figure <a href="#sketcher:fig:vehicle0:hier1">4</a>, by
-running the <code>dot</code> program:
-<p>
-
-<!-- code=text (!bc sys) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">Terminal&gt; dot -Tpng -o fig.png fig.dot
-</pre></div>
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 4:  Hierarchical relation between figure objects. <div id="sketcher:fig:vehicle0:hier1"></div> </p></center>
-<p><img src="fig-tut/vehicle0_hier1.png" align="bottom" width=500></p>
-</center>
-
-<p>
-The call <code>fig.graphviz_dot('fig', classname=True)</code> makes a <code>fig.dot</code> file
-where the class type of each object is also visible, see
-Figure <a href="#sketcher:fig:vehicle0:hier2">5</a>. The ability to write out the
-object hierarchy or view it graphically can be of great help when
-working with complex figures that involve layers of subfigures.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 5:  Hierarchical relation between figure objects, including their class names. <div id="sketcher:fig:vehicle0:hier2"></div> </p></center>
-<p><img src="fig-tut/Vehicle0_hier2.png" align="bottom" width=500></p>
-</center>
-
-<p>
-Any of the objects can in the program be reached through their names, e.g.,
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>]
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>]
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>]
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>][<span style="color: #BA2121">&#39;arc&#39;</span>]
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>][<span style="color: #BA2121">&#39;arc&#39;</span>]<span style="color: #666666">.</span>x  <span style="color: #408080; font-style: italic"># x coords</span>
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>][<span style="color: #BA2121">&#39;arc&#39;</span>]<span style="color: #666666">.</span>y  <span style="color: #408080; font-style: italic"># y coords</span>
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>][<span style="color: #BA2121">&#39;arc&#39;</span>]<span style="color: #666666">.</span>linestyle
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>][<span style="color: #BA2121">&#39;arc&#39;</span>]<span style="color: #666666">.</span>linetype
-</pre></div>
-<p>
-Grabbing a part of the figure this way is handy for
-changing properties of that part, for example, colors, line styles
-(see Figure <a href="#sketcher:fig:vehicle0:v2">6</a>):
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>]<span style="color: #666666">.</span>set_filled_curves(<span style="color: #BA2121">&#39;blue&#39;</span>)
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>]<span style="color: #666666">.</span>set_linewidth(<span style="color: #666666">6</span>)
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>]<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;black&#39;</span>)
-
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;body&#39;</span>][<span style="color: #BA2121">&#39;under&#39;</span>]<span style="color: #666666">.</span>set_filled_curves(<span style="color: #BA2121">&#39;red&#39;</span>)
-
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;body&#39;</span>][<span style="color: #BA2121">&#39;over&#39;</span>]<span style="color: #666666">.</span>set_filled_curves(pattern<span style="color: #666666">=</span><span style="color: #BA2121">&#39;/&#39;</span>)
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;body&#39;</span>][<span style="color: #BA2121">&#39;over&#39;</span>]<span style="color: #666666">.</span>set_linewidth(<span style="color: #666666">14</span>)
-fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;body&#39;</span>][<span style="color: #BA2121">&#39;over&#39;</span>][<span style="color: #BA2121">&#39;rectangle&#39;</span>]<span style="color: #666666">.</span>linewidth <span style="color: #666666">=</span> <span style="color: #666666">4</span>
-</pre></div>
-<p>
-The last line accesses the <code>Curve</code> object directly, while the line above,
-accesses the <code>Rectangle</code> object, which will then set the linewidth of
-its <code>Curve</code> object, and other objects if it had any.
-The result of the actions above is shown in Figure <a href="#sketcher:fig:vehicle0:v2">6</a>.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 6:  Left: Basic line-based drawing. Right: Thicker lines and filled parts. <div id="sketcher:fig:vehicle0:v2"></div> </p></center>
-<p><img src="fig-tut/vehicle0.png" align="bottom" width=700></p>
-</center>
-
-<p>
-We can also change position of parts of the figure and thereby make
-animations, as shown next.
-
-<h3 id="___sec6">Animation: translating the vehicle </h3>
-
-<p>
-Can we make our little vehicle roll? A first attempt will be to
-fake rolling by just displacing all parts of the vehicle.
-The relevant parts constitute the <code>fig['vehicle']</code> object.
-This part of the figure can be translated, rotated, and scaled.
-A translation along the ground means a translation in \( x \) direction,
-say a length \( L \) to the right:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>]<span style="color: #666666">.</span>translate((L,<span style="color: #666666">0</span>))
-</pre></div>
-<p>
-You need to erase, draw, and display to see the movement:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">drawing_tool<span style="color: #666666">.</span>erase()
-fig<span style="color: #666666">.</span>draw()
-drawing_tool<span style="color: #666666">.</span>display()
-</pre></div>
-<p>
-Without erasing, the old drawing of the vehicle will remain in
-the figure so you get two vehicles. Without <code>fig.draw()</code> the
-new coordinates of the vehicle will not be communicated to
-the drawing tool, and without calling display the updated
-drawing will not be visible.
-
-<p>
-A figure that moves in time is conveniently realized by the
-function <code>animate</code>:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">animate(fig, tp, action)
-</pre></div>
-<p>
-Here, <code>fig</code> is the entire figure, <code>tp</code> is an array of
-time points, and <code>action</code> is a user-specified function that changes
-<code>fig</code> at a specific time point. Typically, <code>action</code> will move
-parts of <code>fig</code>.
-
-<p>
-In the present case we can define the movement through a velocity
-function <code>v(t)</code> and displace the figure <code>v(t)*dt</code> for small time
-intervals <code>dt</code>. A possible velocity function is
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">v</span>(t):
-    <span style="color: #008000; font-weight: bold">return</span> <span style="color: #666666">-8*</span>R<span style="color: #666666">*</span>t<span style="color: #666666">*</span>(<span style="color: #666666">1</span> <span style="color: #666666">-</span> t<span style="color: #666666">/</span>(<span style="color: #666666">2*</span>R))
-</pre></div>
-<p>
-Our action function for horizontal displacements <code>v(t)*dt</code> becomes
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">move</span>(t, fig):
-    x_displacement <span style="color: #666666">=</span> dt<span style="color: #666666">*</span>v(t)
-    fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>]<span style="color: #666666">.</span>translate((x_displacement, <span style="color: #666666">0</span>))
-</pre></div>
-<p>
-Since our velocity is negative for \( t\in [0,2R] \) the displacement is
-to the left.
-
-<p>
-The <code>animate</code> function will for each time point <code>t</code> in <code>tp</code> erase
-the drawing, call <code>action(t, fig)</code>, and show the new figure by
-<code>fig.draw()</code> and <code>drawing_tool.display()</code>.
-Here we choose a resolution of the animation corresponding to
-25 time points in the time interval \( [0,2R] \):
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span>
-tp <span style="color: #666666">=</span> numpy<span style="color: #666666">.</span>linspace(<span style="color: #666666">0</span>, <span style="color: #666666">2*</span>R, <span style="color: #666666">25</span>)
-dt <span style="color: #666666">=</span> tp[<span style="color: #666666">1</span>] <span style="color: #666666">-</span> tp[<span style="color: #666666">0</span>]  <span style="color: #408080; font-style: italic"># time step</span>
-
-animate(fig, tp, move, pause_per_frame<span style="color: #666666">=0.2</span>)
-</pre></div>
-<p>
-The <code>pause_per_frame</code> adds a pause, here 0.2 seconds, between
-each frame in the animation.
-
-<p>
-We can also ask <code>animate</code> to store each frame in a file:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">files <span style="color: #666666">=</span> animate(fig, tp, move_vehicle, moviefiles<span style="color: #666666">=</span><span style="color: #008000">True</span>,
-                pause_per_frame<span style="color: #666666">=0.2</span>)
-</pre></div>
-<p>
-The <code>files</code> variable, here <code>'tmp_frame_%04d.png'</code>,
-is the printf-specification used to generate the individual
-plot files. We can use this specification to make a video
-file via <code>ffmpeg</code> (or <code>avconv</code> on Debian-based Linux systems such
-as Ubuntu). Videos in the Flash and WebM formats can be created
-by
-
-<p>
-
-<!-- code=text (!bc sys) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">Terminal&gt; ffmpeg -r 12 -i tmp_frame_%04d.png -vcodec flv mov.flv
-Terminal&gt; ffmpeg -r 12 -i tmp_frame_%04d.png -vcodec libvpx mov.webm
-</pre></div>
-<p>
-An animated GIF movie can also be made using the <code>convert</code> program
-from the ImageMagick software suite:
-
-<p>
-
-<!-- code=text (!bc sys) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">Terminal&gt; convert -delay 20 tmp_frame*.png mov.gif
-Terminal&gt; animate mov.gif  # play movie
-</pre></div>
-<p>
-The delay between frames, in units of 1/100 s,
-governs the speed of the movie.
-To play the animated GIF file in a web page, simply insert
-<code>&lt;img src=&quot;mov.gif&quot;&gt;</code> in the HTML code.
-
-<p>
-The individual PNG frames can be directly played in a web
-browser by running
-
-<p>
-
-<!-- code=text (!bc sys) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">Terminal&gt; scitools movie output_file=mov.html fps=5 tmp_frame*
-</pre></div>
-<p>
-or calling
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">scitools.std</span> <span style="color: #008000; font-weight: bold">import</span> movie
-movie(files, encoder<span style="color: #666666">=</span><span style="color: #BA2121">&#39;html&#39;</span>, output_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;mov.html&#39;</span>)
-</pre></div>
-<p>
-in Python. Load the resulting file <code>mov.html</code> into a web browser
-to play the movie.
-
-<p>
-Try to run <a href="http://tinyurl.com/ot733jn/vehicle0.py" target="_self"><tt>vehicle0.py</tt></a> and
-then load <code>mov.html</code> into a browser, or play one of the <code>mov.*</code>
-video files.  Alternatively, you can view a ready-made <a href="http://tinyurl.com/oou9lp7/mov-tut/vehicle0.html" target="_self">movie</a>.
-
-<h3 id="sketcher:vehicle1:anim">Animation: rolling the wheels</h3>
-
-<p>
-It is time to show rolling wheels. To this end, we add spokes to the
-wheels, formed by two crossing lines, see Figure <a href="#sketcher:fig:vehicle1">7</a>.
-The construction of the wheels will now involve a circle and two lines:
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">wheel1 <span style="color: #666666">=</span> Composition({
-    <span style="color: #BA2121">&#39;wheel&#39;</span>: Circle(center<span style="color: #666666">=</span>(w_1, R), radius<span style="color: #666666">=</span>R),
-    <span style="color: #BA2121">&#39;cross&#39;</span>: Composition({<span style="color: #BA2121">&#39;cross1&#39;</span>: Line((w_1,<span style="color: #666666">0</span>),   (w_1,<span style="color: #666666">2*</span>R)),
-                          <span style="color: #BA2121">&#39;cross2&#39;</span>: Line((w_1<span style="color: #666666">-</span>R,R), (w_1<span style="color: #666666">+</span>R,R))})})
-wheel2 <span style="color: #666666">=</span> wheel1<span style="color: #666666">.</span>copy()
-wheel2<span style="color: #666666">.</span>translate((L,<span style="color: #666666">0</span>))
-</pre></div>
-<p>
-Observe that <code>wheel1.copy()</code> copies all the objects that make
-up the first wheel, and <code>wheel2.translate</code> translates all
-the copied objects.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 7:  Wheels with spokes to illustrate rolling. <div id="sketcher:fig:vehicle1"></div> </p></center>
-<p><img src="fig-tut/vehicle1.png" align="bottom" width=400></p>
-</center>
-
-<p>
-The <code>move</code> function now needs to displace all the objects in the
-entire vehicle and also rotate the <code>cross1</code> and <code>cross2</code>
-objects in both wheels.
-The rotation angle follows from the fact that the arc length
-of a rolling wheel equals the displacement of the center of
-the wheel, leading to a rotation angle
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">angle <span style="color: #666666">=</span> <span style="color: #666666">-</span> x_displacement<span style="color: #666666">/</span>R
-</pre></div>
-<p>
-With <code>w_1</code> tracking the \( x \) coordinate of the center
-of the front wheel, we can rotate that wheel by
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">w1 <span style="color: #666666">=</span> fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel1&#39;</span>]
-<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">math</span> <span style="color: #008000; font-weight: bold">import</span> degrees
-w1<span style="color: #666666">.</span>rotate(degrees(angle), center<span style="color: #666666">=</span>(w_1, R))
-</pre></div>
-<p>
-The <code>rotate</code> function takes two parameters: the rotation angle
-(in degrees) and the center point of the rotation, which is the
-center of the wheel in this case. The other wheel is rotated by
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">w2 <span style="color: #666666">=</span> fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>]
-w2<span style="color: #666666">.</span>rotate(degrees(angle), center<span style="color: #666666">=</span>(w_1 <span style="color: #666666">+</span> L, R))
-</pre></div>
-<p>
-That is, the angle is the same, but the rotation point is different.
-The update of the center point is done by <code>w_1 += x_displacement</code>.
-The complete <code>move</code> function with translation of the entire
-vehicle and rotation of the wheels then becomes
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">w_1 <span style="color: #666666">=</span> w_1 <span style="color: #666666">+</span> L   <span style="color: #408080; font-style: italic"># start position</span>
-
-<span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">move</span>(t, fig):
-    x_displacement <span style="color: #666666">=</span> dt<span style="color: #666666">*</span>v(t)
-    fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>]<span style="color: #666666">.</span>translate((x_displacement, <span style="color: #666666">0</span>))
-
-    <span style="color: #408080; font-style: italic"># Rotate wheels</span>
-    <span style="color: #008000; font-weight: bold">global</span> w_1
-    w_1 <span style="color: #666666">+=</span> x_displacement
-    <span style="color: #408080; font-style: italic"># R*angle = -x_displacement</span>
-    angle <span style="color: #666666">=</span> <span style="color: #666666">-</span> x_displacement<span style="color: #666666">/</span>R
-    w1 <span style="color: #666666">=</span> fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel1&#39;</span>]
-    w1<span style="color: #666666">.</span>rotate(degrees(angle), center<span style="color: #666666">=</span>(w_1, R))
-    w2 <span style="color: #666666">=</span> fig[<span style="color: #BA2121">&#39;vehicle&#39;</span>][<span style="color: #BA2121">&#39;wheels&#39;</span>][<span style="color: #BA2121">&#39;wheel2&#39;</span>]
-    w2<span style="color: #666666">.</span>rotate(degrees(angle), center<span style="color: #666666">=</span>(w_1 <span style="color: #666666">+</span> L, R))
-</pre></div>
-<p>
-The complete example is found in the file
-<a href="http://tinyurl.com/ot733jn/vehicle1.py" target="_self"><tt>vehicle1.py</tt></a>. You may run this file or watch a <a href="http://tinyurl.com/oou9lp7/mov-tut/vehicle1.html" target="_self">ready-made movie</a>.
-
-<p>
-The advantages with making figures this way, through programming
-rather than using interactive drawing programs, are numerous.  For
-example, the objects are parameterized by variables so that various
-dimensions can easily be changed.  Subparts of the figure, possible
-involving a lot of figure objects, can change color, linetype, filling
-or other properties through a <em>single</em> function call.  Subparts of the
-figure can be rotated, translated, or scaled.  Subparts of the figure
-can also be copied and moved to other parts of the drawing
-area. However, the single most important feature is probably the
-ability to make animations governed by mathematical formulas or data
-coming from physics simulations of the problem, as shown in the example above.
-
-<p>
-<p>
-<!-- navigation buttons at the bottom of the page -->
-<ul class="pagination">
-<li><a href="._pysketcher001.html">&laquo;</a></li>
-  <li><a href="._pysketcher000.html">1</a></li>
-  <li><a href="._pysketcher001.html">2</a></li>
-  <li class="active"><a href="._pysketcher002.html">3</a></li>
-  <li><a href="._pysketcher003.html">4</a></li>
-  <li><a href="._pysketcher004.html">5</a></li>
-  <li><a href="._pysketcher005.html">6</a></li>
-  <li><a href="._pysketcher003.html">&raquo;</a></li>
-</ul>
-<!-- ------------------- end of main content --------------- -->
-
-</div>  <!-- end container -->
-<!-- include javascript, jQuery *first* -->
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
-
-<!-- Bootstrap footer
-<footer>
-<a href="http://..."><img width="250" align=right src="http://..."></a>
-</footer>
--->
-
-
-</body>
-</html>
-    
-

+ 0 - 960
doc/pub/tutorial/._pysketcher003.html

@@ -1,960 +0,0 @@
-<!--
-Automatically generated HTML file from DocOnce source
-(https://github.com/hplgit/doconce/)
--->
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
-<meta name="description" content="Using Pysketcher to Create Principal Sketches of Physics Problems">
-<meta name="keywords" content="tree data structure,recursive function calls">
-
-<title>Using Pysketcher to Create Principal Sketches of Physics Problems</title>
-
-<!-- Bootstrap style: bootswatch_readable -->
-<link href="http://netdna.bootstrapcdn.com/bootswatch/3.1.1/readable/bootstrap.min.css" rel="stylesheet">
-<!-- not necessary
-<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
--->
-
-<style type="text/css">
-
-/* Add scrollbar to dropdown menus in bootstrap navigation bar */
-.dropdown-menu {
-   height: auto;
-   max-height: 400px;
-   overflow-x: hidden;
-}
-</style>
-
-
-</head>
-
-<!-- tocinfo
-{'highest level': 1,
- 'sections': [('A first glimpse of Pysketcher', 1, None, '___sec0'),
-              ('Basic construction of sketches', 2, None, '___sec1'),
-              ('Basic drawing', 3, None, '___sec2'),
-              ('Groups of objects', 3, None, '___sec3'),
-              ('Changing line styles and colors', 3, None, '___sec4'),
-              ('The figure composition as an object hierarchy',
-               3,
-               None,
-               '___sec5'),
-              ('Animation: translating the vehicle', 3, None, '___sec6'),
-              ('Animation: rolling the wheels',
-               3,
-               'sketcher:vehicle1:anim',
-               'sketcher:vehicle1:anim'),
-              ('A simple pendulum',
-               1,
-               'sketcher:ex:pendulum',
-               'sketcher:ex:pendulum'),
-              ('The basic physics sketch',
-               2,
-               'sketcher:ex:pendulum:basic',
-               'sketcher:ex:pendulum:basic'),
-              ('The body diagram', 2, None, '___sec10'),
-              ('Animated body diagram',
-               2,
-               'sketcher:ex:pendulum:anim',
-               'sketcher:ex:pendulum:anim'),
-              ('Function for drawing the body diagram', 3, None, '___sec12'),
-              ('Equations for the motion and forces', 3, None, '___sec13'),
-              ('Numerical solution', 3, None, '___sec14'),
-              ('Animation', 3, None, '___sec15'),
-              ('Basic shapes', 1, None, '___sec16'),
-              ('Axis', 2, None, '___sec17'),
-              ('Distance with text', 2, None, '___sec18'),
-              ('Rectangle', 2, None, '___sec19'),
-              ('Triangle', 2, None, '___sec20'),
-              ('Arc', 2, None, '___sec21'),
-              ('Spring', 2, None, '___sec22'),
-              ('Dashpot', 2, None, '___sec23'),
-              ('Wavy', 2, None, '___sec24'),
-              ('Stochastic curves', 2, None, '___sec25'),
-              ('Inner workings of the Pysketcher tool', 1, None, '___sec26'),
-              ('Example of classes for geometric objects',
-               2,
-               None,
-               '___sec27'),
-              ('Simple geometric objects', 3, None, '___sec28'),
-              ('Class curve', 3, None, '___sec29'),
-              ('Compound geometric objects', 3, None, '___sec30'),
-              ('Adding functionality via recursion', 2, None, '___sec31'),
-              ('Basic principles of recursion', 3, None, '___sec32'),
-              ('Explaining recursion', 3, None, '___sec33'),
-              ('Scaling, translating, and rotating a figure',
-               2,
-               'sketcher:scaling',
-               'sketcher:scaling'),
-              ('Scaling', 3, None, '___sec35'),
-              ('Translation', 3, None, '___sec36'),
-              ('Rotation', 3, None, '___sec37')]}
-end of tocinfo -->
-
-<body>
-
-
-
-<script type="text/x-mathjax-config">
-MathJax.Hub.Config({
-  TeX: {
-     equationNumbers: {  autoNumber: "none"  },
-     extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"]
-  }
-});
-</script>
-<script type="text/javascript"
- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
-</script>
-
-<!-- newcommands.tex -->
-$$
-\newcommand{\half}{\frac{1}{2}}
-\newcommand{\tp}{\thinspace .}
-\newcommand{\rpos}{\boldsymbol{r}}
-\newcommand{\ii}{\boldsymbol{i}}
-\newcommand{\jj}{\boldsymbol{j}}
-\newcommand{\ir}{\boldsymbol{i}_r}
-\newcommand{\ith}{\boldsymbol{i}_{\theta}}
-$$
-
-
-
-
-    
-<!-- Bootstrap navigation bar -->
-<div class="navbar navbar-default navbar-fixed-top">
-  <div class="navbar-header">
-    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-    </button>
-    <a class="navbar-brand" href="pysketcher.html">Using Pysketcher to Create Principal Sketches of Physics Problems</a>
-  </div>
-
-  <div class="navbar-collapse collapse navbar-responsive-collapse">
-    <ul class="nav navbar-nav navbar-right">
-      <li class="dropdown">
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
-        <ul class="dropdown-menu">
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec0" style="font-size: 80%;"><b>A first glimpse of Pysketcher</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec1" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Basic construction of sketches</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec2" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic drawing</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec3" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Groups of objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec4" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changing line styles and colors</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec5" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The figure composition as an object hierarchy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec6" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: translating the vehicle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#sketcher:vehicle1:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: rolling the wheels</a></li>
-     <!-- navigation toc: --> <li><a href="#sketcher:ex:pendulum" style="font-size: 80%;"><b>A simple pendulum</b></a></li>
-     <!-- navigation toc: --> <li><a href="#sketcher:ex:pendulum:basic" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The basic physics sketch</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec10" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="#sketcher:ex:pendulum:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Animated body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec12" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function for drawing the body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec13" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Equations for the motion and forces</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec14" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numerical solution</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec15" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec16" style="font-size: 80%;"><b>Basic shapes</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec17" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Axis</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec18" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Distance with text</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec19" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Rectangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec20" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Triangle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec21" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Arc</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec22" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Spring</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec23" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Dashpot</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec24" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Wavy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher004.html#___sec25" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Stochastic curves</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec26" style="font-size: 80%;"><b>Inner workings of the Pysketcher tool</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec27" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Example of classes for geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec28" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec29" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class curve</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec30" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compound geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec31" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Adding functionality via recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec32" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic principles of recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec33" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Explaining recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#sketcher:scaling" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Scaling, translating, and rotating a figure</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec35" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scaling</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec36" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec37" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotation</a></li>
-
-        </ul>
-      </li>
-    </ul>
-  </div>
-</div>
-</div> <!-- end of navigation bar -->
-
-<div class="container">
-
-<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
-
-<a name="part0003"></a>
-<!-- !split -->
-
-<h1 id="sketcher:ex:pendulum">A simple pendulum</h1>
-
-<h2 id="sketcher:ex:pendulum:basic">The basic physics sketch</h2>
-
-<p>
-We now want to make a sketch of simple pendulum from physics, as shown
-in Figure <a href="#sketcher:ex:pendulum:fig1">8</a>. A body with mass \( m \) is attached
-to a massless, stiff rod, which can rotate about a point, causing the
-pendulum to oscillate.
-
-<p>
-A suggested work flow is to
-first sketch the figure on a piece of paper and introduce a coordinate
-system. A simple coordinate system is indicated in Figure
-<a href="#sketcher:ex:pendulum:fig1wgrid">9</a>. In a code we introduce variables
-<code>W</code> and <code>H</code> for the width and height of the figure (i.e., extent of
-the coordinate system) and open the program like this:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">pysketcher</span> <span style="color: #008000; font-weight: bold">import</span> <span style="color: #666666">*</span>
-
-H <span style="color: #666666">=</span> <span style="color: #666666">7.</span>
-W <span style="color: #666666">=</span> <span style="color: #666666">6.</span>
-
-drawing_tool<span style="color: #666666">.</span>set_coordinate_system(xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=</span>W,
-                                   ymin<span style="color: #666666">=0</span>, ymax<span style="color: #666666">=</span>H,
-                                   axis<span style="color: #666666">=</span><span style="color: #008000">True</span>)
-drawing_tool<span style="color: #666666">.</span>set_grid(<span style="color: #008000">True</span>)
-drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-</pre></div>
-<p>
-Note that when the sketch is ready for &quot;production&quot;, we will (normally)
-set <code>axis=False</code> to remove the coordinate system and also remove the
-grid, i.e., delete or
-comment out the line <code>drawing_tool.set_grid(True)</code>.
-Also note that we in this example let all lines be blue by default.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 8:  Sketch of a simple pendulum. <div id="sketcher:ex:pendulum:fig1"></div> </p></center>
-<p><img src="fig-tut/pendulum1.png" align="bottom" width=300></p>
-</center>
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 9:  Sketch with assisting coordinate system. <div id="sketcher:ex:pendulum:fig1wgrid"></div> </p></center>
-<p><img src="fig-tut/pendulum1_wgrid.png" align="bottom" width=400></p>
-</center>
-
-<p>
-The next step is to introduce variables for key quantities in the sketch.
-Let <code>L</code> be the length of the pendulum, <code>P</code> the rotation point, and let
-<code>a</code> be the angle the pendulum makes with the vertical (measured in degrees).
-We may set
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">L <span style="color: #666666">=</span> <span style="color: #666666">5*</span>H<span style="color: #666666">/7</span>          <span style="color: #408080; font-style: italic"># length</span>
-P <span style="color: #666666">=</span> (W<span style="color: #666666">/6</span>, <span style="color: #666666">0.85*</span>H)  <span style="color: #408080; font-style: italic"># rotation point</span>
-a <span style="color: #666666">=</span> <span style="color: #666666">40</span>             <span style="color: #408080; font-style: italic"># angle</span>
-</pre></div>
-<p>
-Be careful with integer division if you use Python 2! Fortunately, we
-started out with <code>float</code> objects for <code>W</code> and <code>H</code> so the expressions above
-are safe.
-
-<p>
-What kind of objects do we need in this sketch? Looking at
-Figure <a href="#sketcher:ex:pendulum:fig1">8</a> we see that we need
-
-<ol>
-<li> a vertical, dashed line</li>
-<li> an arc with no text but dashed line to indicate the <em>path</em> of the
-   mass</li>
-<li> an arc with name \( \theta \) to indicate the <em>angle</em></li>
-<li> a line, here called <em>rod</em>, from the rotation point to the mass</li>
-<li> a blue, filled circle representing the <em>mass</em></li>
-<li> a text \( m \) associated with the mass</li>
-<li> an indicator of the pendulum's <em>length</em> \( L \), visualized as
-   a line with two arrows tips and the text \( L \)</li>
-<li> a gravity vector with the text \( g \)</li>
-</ol>
-
-Pysketcher has objects for each of these elements in our sketch.
-We start with the simplest element: the vertical line, going from
-<code>P</code> to <code>P</code> minus the length \( L \) in \( y \) direction:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">vertical <span style="color: #666666">=</span> Line(P, P<span style="color: #666666">-</span>point(<span style="color: #666666">0</span>,L))
-</pre></div>
-<p>
-The class <code>point</code> is very convenient: it turns its two coordinates into
-a vector with which we can compute, and is therefore one of the most
-widely used Pysketcher objects.
-
-<p>
-The path of the mass is an arc that can be made by
-Pysketcher's <code>Arc</code> object:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">path <span style="color: #666666">=</span> Arc(P, L, <span style="color: #666666">-90</span>, a)
-</pre></div>
-<p>
-The first argument <code>P</code> is the center point, the second is the
-radius (<code>L</code> here), the next argument is the start angle, here
-it starts at -90 degrees, while the next argument is the angle of
-the arc, here <code>a</code>.
-For the path of the mass, we also need an arc object, but this
-time with an associated text. Pysketcher has a specialized object
-for this purpose, <code>Arc_wText</code>, since placing the text manually can
-be somewhat cumbersome.
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">angle <span style="color: #666666">=</span> Arc_wText(<span style="color: #BA2121">r&#39;$\theta$&#39;</span>, P, L<span style="color: #666666">/4</span>, <span style="color: #666666">-90</span>, a, text_spacing<span style="color: #666666">=1/30.</span>)
-</pre></div>
-<p>
-The arguments are as for <code>Arc</code> above, but the first one is the desired
-text. Remember to use a raw string since we want a LaTeX greek letter
-that contains a backslash.
-The <code>text_spacing</code> argument must often be tweaked. It is recommended
-to create only a few objects before rendering the sketch and then
-adjust spacings as one goes along.
-
-<p>
-The rod is simply a line from <code>P</code> to the mass. We can easily
-compute the position of the mass from basic geometry considerations,
-but it is easier and safer to look up this point in other objects
-if it is already computed. In the present case,
-the <code>path</code> object stored its start and
-end points, so <code>path.geometric_features()['end']</code> is the end point
-of the path, which is the position of the mass. We can therefore
-create the rod simply as a line from <code>P</code> to this already computed end point:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">mass_pt <span style="color: #666666">=</span> path<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;end&#39;</span>]
-rod <span style="color: #666666">=</span> Line(P, mass_pt)
-</pre></div>
-<p>
-The mass is a circle filled with color:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">mass <span style="color: #666666">=</span> Circle(center<span style="color: #666666">=</span>mass_pt, radius<span style="color: #666666">=</span>L<span style="color: #666666">/20.</span>)
-mass<span style="color: #666666">.</span>set_filled_curves(color<span style="color: #666666">=</span><span style="color: #BA2121">&#39;blue&#39;</span>)
-</pre></div>
-<p>
-To place the \( m \) correctly, we go a small distance in the direction of
-the rod, from the center of the circle. To this end, we need to
-compute the direction. This is easiest done by computing a vector
-from <code>P</code> to the center of the circle and calling <code>unit_vec</code> to make
-a unit vector in this direction:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">rod_vec <span style="color: #666666">=</span> rod<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;end&#39;</span>] <span style="color: #666666">-</span> \ 
-          rod<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;start&#39;</span>]
-unit_rod_vec <span style="color: #666666">=</span> unit_vec(rod_vec)
-mass_symbol <span style="color: #666666">=</span> Text(<span style="color: #BA2121">&#39;$m$&#39;</span>, mass_pt <span style="color: #666666">+</span> L<span style="color: #666666">/10*</span>unit_rod_vec)
-</pre></div>
-<p>
-Again, the distance <code>L/10</code> is something one has to experiment with.
-
-<p>
-The next object is the length measure with the text \( L \). Such length
-measures are represented by Pysketcher's <code>Distance_wText</code> object.
-An easy construction is to first place this length measure along the
-rod and then translate it a little distance (<code>L/15</code>) in the
-normal direction of the rod:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">length <span style="color: #666666">=</span> Distance_wText(P, mass_pt, <span style="color: #BA2121">&#39;$L$&#39;</span>)
-length<span style="color: #666666">.</span>translate(L<span style="color: #666666">/15*</span>point(cos(radians(a)), sin(radians(a))))
-</pre></div>
-<p>
-For this translation we need a unit vector in the normal direction
-of the rod, which is from geometric considerations given by
-\( (\cos a, \sin a) \), when \( a \) is the angle of the pendulum.
-Alternatively, we could have found the normal vector as a vector that
-is normal to <code>unit_rod_vec</code>: <code>point(-unit_rod_vec[1],unit_rod_vec[0])</code>.
-
-<p>
-The final object is the gravity force vector, which is so common
-in physics sketches that Pysketcher has a ready-made object: <code>Gravity</code>,
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">gravity <span style="color: #666666">=</span> Gravity(start<span style="color: #666666">=</span>P<span style="color: #666666">+</span>point(<span style="color: #666666">0.8*</span>L,<span style="color: #666666">0</span>), length<span style="color: #666666">=</span>L<span style="color: #666666">/3</span>)
-</pre></div>
-<p>
-Since blue is the default color for
-lines, we want the dashed lines (for <code>vertical</code> and <code>path</code>) to be black
-and with linewidth 1. These properties can be set one by one for each
-object, but we can also make a little helper function:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">set_dashed_thin_blackline</span>(<span style="color: #666666">*</span>objects):
-    <span style="color: #BA2121; font-style: italic">&quot;&quot;&quot;Set linestyle of objects to dashed, black, width=1.&quot;&quot;&quot;</span>
-    <span style="color: #008000; font-weight: bold">for</span> obj <span style="color: #AA22FF; font-weight: bold">in</span> objects:
-        obj<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dashed&#39;</span>)
-        obj<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;black&#39;</span>)
-        obj<span style="color: #666666">.</span>set_linewidth(<span style="color: #666666">1</span>)
-
-set_dashed_thin_blackline(vertical, path)
-</pre></div>
-<p>
-Now, all objects are in place, so it remains to compose the final
-figure and draw the composition:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">fig <span style="color: #666666">=</span> Composition(
-    {<span style="color: #BA2121">&#39;body&#39;</span>: mass, <span style="color: #BA2121">&#39;rod&#39;</span>: rod,
-     <span style="color: #BA2121">&#39;vertical&#39;</span>: vertical, <span style="color: #BA2121">&#39;theta&#39;</span>: angle, <span style="color: #BA2121">&#39;path&#39;</span>: path,
-     <span style="color: #BA2121">&#39;g&#39;</span>: gravity, <span style="color: #BA2121">&#39;L&#39;</span>: length, <span style="color: #BA2121">&#39;m&#39;</span>: mass_symbol})
-
-fig<span style="color: #666666">.</span>draw()
-drawing_tool<span style="color: #666666">.</span>display()
-drawing_tool<span style="color: #666666">.</span>savefig(<span style="color: #BA2121">&#39;pendulum1&#39;</span>)
-</pre></div>
-
-<h2 id="___sec10">The body diagram </h2>
-
-<p>
-Now we want to isolate the mass and draw all the forces that act on it.
-Figure <a href="#sketcher:ex:pendulum:fig2wgrid">10</a> shows the desired result, but
-embedded in the coordinate system.
-We consider three types of forces: the gravity force, the force from the
-rod, and air resistance. The body diagram is key for deriving the
-equation of motion, so it is illustrative to add useful mathematical
-quantities needed in the derivation, such as the unit vectors in polar
-coordinates.
-
-<p>
-<center> <!-- figure -->
-<hr class="figure">
-<center><p class="caption">Figure 10:  Body diagram of a simple pendulum. <div id="sketcher:ex:pendulum:fig2wgrid"></div> </p></center>
-<p><img src="fig-tut/pendulum5_wgrid.png" align="bottom" width=300></p>
-</center>
-
-<p>
-We start by listing the objects in the sketch:
-
-<ol>
-<li> a text \( (x_0,y_0) \) representing the rotation  point <code>P</code></li>
-<li> unit vector \( \boldsymbol{i}_r \) with text</li>
-<li> unit vector \( \boldsymbol{i}_\theta \) with text</li>
-<li> a dashed vertical line</li>
-<li> a dashed line along the rod</li>
-<li> an arc with text \( \theta \)</li>
-<li> the gravity force with text \( mg \)</li>
-<li> the force in the rod with text \( S \)</li>
-<li> the air resistance force with text \( \sim |v|v \)</li>
-</ol>
-
-The first object, \( (x_0,y_0) \), is simply a plain text where we have
-to experiment with its position. The unit vectors in polar coordinates
-may be drawn using the Pysketcher's <code>Force</code> object since it has an
-arrow with a text. The first three objects can then be made as follows:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">x0y0 <span style="color: #666666">=</span> Text(<span style="color: #BA2121">&#39;$(x_0,y_0)$&#39;</span>, P <span style="color: #666666">+</span> point(<span style="color: #666666">-0.4</span>,<span style="color: #666666">-0.1</span>))
-ir <span style="color: #666666">=</span> Force(P, P <span style="color: #666666">+</span> L<span style="color: #666666">/10*</span>unit_vec(rod_vec),
-           <span style="color: #BA2121">r&#39;$\boldsymbol{i}_r$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-           text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.015</span>,<span style="color: #666666">0</span>))
-ith <span style="color: #666666">=</span> Force(P, P <span style="color: #666666">+</span> L<span style="color: #666666">/10*</span>unit_vec((<span style="color: #666666">-</span>rod_vec[<span style="color: #666666">1</span>], rod_vec[<span style="color: #666666">0</span>])),
-           <span style="color: #BA2121">r&#39;$\boldsymbol{i}_{\theta}$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-            text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.02</span>,<span style="color: #666666">0.005</span>))
-</pre></div>
-<p>
-Note that tweaking of the position of <code>x0y0</code> use absolute coordinates, so
-if <code>W</code> or <code>H</code> is changed in the beginning of the figure, the tweaked position
-will most likely not look good. A better solution would be to express
-the tweaked displacement <code>point(-0.4,-0.1)</code> in terms of <code>W</code> and <code>H</code>.
-The <code>text_spacing</code> values in the <code>Force</code> objects also use absolute
-coordinates. Very often, this is much more convenient when adjusting
-the objects, and global size parameters like <code>W</code> and <code>H</code> are in practice
-seldom changed, so the solution above is quite typical.
-
-<p>
-The vertical, dashed line, the dashed rod, and the arc for \( \theta \)
-are made by
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">rod_start <span style="color: #666666">=</span> rod<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;start&#39;</span>]  <span style="color: #408080; font-style: italic"># Point P</span>
-vertical2 <span style="color: #666666">=</span> Line(rod_start, rod_start <span style="color: #666666">+</span> point(<span style="color: #666666">0</span>,<span style="color: #666666">-</span>L<span style="color: #666666">/3</span>))
-set_dashed_thin_blackline(vertical2)
-set_dashed_thin_blackline(rod)
-angle2 <span style="color: #666666">=</span> Arc_wText(<span style="color: #BA2121">r&#39;$\theta$&#39;</span>, rod_start, L<span style="color: #666666">/6</span>, <span style="color: #666666">-90</span>, a,
-                   text_spacing<span style="color: #666666">=1/30.</span>)
-</pre></div>
-<p>
-Note how we reuse the earlier defined object <code>rod</code>.
-
-<p>
-The forces are constructed as shown below.
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">mg_force  <span style="color: #666666">=</span> Force(mass_pt, mass_pt <span style="color: #666666">+</span> L<span style="color: #666666">/5*</span>point(<span style="color: #666666">0</span>,<span style="color: #666666">-1</span>),
-                  <span style="color: #BA2121">&#39;$mg$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>)
-rod_force <span style="color: #666666">=</span> Force(mass_pt, mass_pt <span style="color: #666666">-</span> L<span style="color: #666666">/3*</span>unit_vec(rod_vec),
-                  <span style="color: #BA2121">&#39;$S$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-                  text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.03</span>, <span style="color: #666666">0.01</span>))
-air_force <span style="color: #666666">=</span> Force(mass_pt, mass_pt <span style="color: #666666">-</span>
-                  L<span style="color: #666666">/6*</span>unit_vec((rod_vec[<span style="color: #666666">1</span>], <span style="color: #666666">-</span>rod_vec[<span style="color: #666666">0</span>])),
-                  <span style="color: #BA2121">&#39;$\sim|v|v$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-                  text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.04</span>,<span style="color: #666666">0.005</span>))
-</pre></div>
-<p>
-Note that the drag force from the air is directed perpendicular to
-the rod, so we construct a unit vector in this direction directly from
-the <code>rod_vec</code> vector.
-
-<p>
-All objects are in place, and we can compose a figure to be drawn:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">body_diagram <span style="color: #666666">=</span> Composition(
-    {<span style="color: #BA2121">&#39;mg&#39;</span>: mg_force, <span style="color: #BA2121">&#39;S&#39;</span>: rod_force, <span style="color: #BA2121">&#39;rod&#39;</span>: rod,
-     <span style="color: #BA2121">&#39;vertical&#39;</span>: vertical2, <span style="color: #BA2121">&#39;theta&#39;</span>: angle2,
-     <span style="color: #BA2121">&#39;body&#39;</span>: mass, <span style="color: #BA2121">&#39;m&#39;</span>: mass_symbol})
-
-body_diagram[<span style="color: #BA2121">&#39;air&#39;</span>] <span style="color: #666666">=</span> air_force
-body_diagram[<span style="color: #BA2121">&#39;ir&#39;</span>] <span style="color: #666666">=</span> ir
-body_diagram[<span style="color: #BA2121">&#39;ith&#39;</span>] <span style="color: #666666">=</span> ith
-body_diagram[<span style="color: #BA2121">&#39;origin&#39;</span>] <span style="color: #666666">=</span> x0y0
-</pre></div>
-<p>
-Here, we exemplify that we can start out with a composition as a
-dictionary, but (as in ordinary Python dictionaries) add new
-elements later when desired.
-
-<p>
-<!-- FIGURE: [fig-tut/pendulum1.png, width=300 frac=0.5] Sketch of a simple pendulum. <div id="sketcher:ex:pendulum:fig2"></div> -->
-
-<h2 id="sketcher:ex:pendulum:anim">Animated body diagram</h2>
-
-<p>
-We want to make an animated body diagram so that we can see how forces
-develop in time according to the motion. This means that we must
-couple the sketch at each time level to a numerical solution for
-the motion of the pendulum.
-
-<h3 id="___sec12">Function for drawing the body diagram </h3>
-
-<p>
-The previous flat program for making sketches of the pendulum is not
-suitable when we want to make a sketch at a lot of different points
-in time, i.e., for a lot of different angles that the pendulum makes
-with the vertical. We therefore need to draw the body diagram in
-a function where the angle is a parameter. We also supply arrays
-containing the (numerically computed) values of the angle \( \theta \) and
-the forces at various time levels, plus the desired time point and level
-for this particular sketch:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">pysketcher</span> <span style="color: #008000; font-weight: bold">import</span> <span style="color: #666666">*</span>
-
-H <span style="color: #666666">=</span> <span style="color: #666666">15.</span>
-W <span style="color: #666666">=</span> <span style="color: #666666">17.</span>
-
-drawing_tool<span style="color: #666666">.</span>set_coordinate_system(xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=</span>W,
-                                   ymin<span style="color: #666666">=0</span>, ymax<span style="color: #666666">=</span>H,
-                                   axis<span style="color: #666666">=</span><span style="color: #008000">False</span>)
-
-<span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">pendulum</span>(theta, S, mg, drag, t, time_level):
-
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-    <span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">math</span>
-    a <span style="color: #666666">=</span> math<span style="color: #666666">.</span>degrees(theta[time_level])
-    L <span style="color: #666666">=</span> <span style="color: #666666">0.4*</span>H         <span style="color: #408080; font-style: italic"># length</span>
-    P <span style="color: #666666">=</span> (W<span style="color: #666666">/2</span>, <span style="color: #666666">0.8*</span>H)  <span style="color: #408080; font-style: italic"># rotation point</span>
-
-    vertical <span style="color: #666666">=</span> Line(P, P<span style="color: #666666">-</span>point(<span style="color: #666666">0</span>,L))
-    path <span style="color: #666666">=</span> Arc(P, L, <span style="color: #666666">-90</span>, a)
-    angle <span style="color: #666666">=</span> Arc_wText(<span style="color: #BA2121">r&#39;$\theta$&#39;</span>, P, L<span style="color: #666666">/4</span>, <span style="color: #666666">-90</span>, a, text_spacing<span style="color: #666666">=1/30.</span>)
-
-    mass_pt <span style="color: #666666">=</span> path<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;end&#39;</span>]
-    rod <span style="color: #666666">=</span> Line(P, mass_pt)
-
-    mass <span style="color: #666666">=</span> Circle(center<span style="color: #666666">=</span>mass_pt, radius<span style="color: #666666">=</span>L<span style="color: #666666">/20.</span>)
-    mass<span style="color: #666666">.</span>set_filled_curves(color<span style="color: #666666">=</span><span style="color: #BA2121">&#39;blue&#39;</span>)
-    rod_vec <span style="color: #666666">=</span> rod<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;end&#39;</span>] <span style="color: #666666">-</span> \ 
-              rod<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;start&#39;</span>]
-    unit_rod_vec <span style="color: #666666">=</span> unit_vec(rod_vec)
-    mass_symbol <span style="color: #666666">=</span> Text(<span style="color: #BA2121">&#39;$m$&#39;</span>, mass_pt <span style="color: #666666">+</span> L<span style="color: #666666">/10*</span>unit_rod_vec)
-
-    length <span style="color: #666666">=</span> Distance_wText(P, mass_pt, <span style="color: #BA2121">&#39;$L$&#39;</span>)
-    <span style="color: #408080; font-style: italic"># Displace length indication</span>
-    length<span style="color: #666666">.</span>translate(L<span style="color: #666666">/15*</span>point(cos(radians(a)), sin(radians(a))))
-    gravity <span style="color: #666666">=</span> Gravity(start<span style="color: #666666">=</span>P<span style="color: #666666">+</span>point(<span style="color: #666666">0.8*</span>L,<span style="color: #666666">0</span>), length<span style="color: #666666">=</span>L<span style="color: #666666">/3</span>)
-
-    <span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">set_dashed_thin_blackline</span>(<span style="color: #666666">*</span>objects):
-        <span style="color: #BA2121; font-style: italic">&quot;&quot;&quot;Set linestyle of objects to dashed, black, width=1.&quot;&quot;&quot;</span>
-        <span style="color: #008000; font-weight: bold">for</span> obj <span style="color: #AA22FF; font-weight: bold">in</span> objects:
-            obj<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dashed&#39;</span>)
-            obj<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;black&#39;</span>)
-            obj<span style="color: #666666">.</span>set_linewidth(<span style="color: #666666">1</span>)
-
-    set_dashed_thin_blackline(vertical, path)
-
-    fig <span style="color: #666666">=</span> Composition(
-        {<span style="color: #BA2121">&#39;body&#39;</span>: mass, <span style="color: #BA2121">&#39;rod&#39;</span>: rod,
-         <span style="color: #BA2121">&#39;vertical&#39;</span>: vertical, <span style="color: #BA2121">&#39;theta&#39;</span>: angle, <span style="color: #BA2121">&#39;path&#39;</span>: path,
-         <span style="color: #BA2121">&#39;g&#39;</span>: gravity, <span style="color: #BA2121">&#39;L&#39;</span>: length})
-
-    <span style="color: #408080; font-style: italic">#fig.draw()</span>
-    <span style="color: #408080; font-style: italic">#drawing_tool.display()</span>
-    <span style="color: #408080; font-style: italic">#drawing_tool.savefig(&#39;tmp_pendulum1&#39;)</span>
-
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;black&#39;</span>)
-
-    rod_start <span style="color: #666666">=</span> rod<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;start&#39;</span>]  <span style="color: #408080; font-style: italic"># Point P</span>
-    vertical2 <span style="color: #666666">=</span> Line(rod_start, rod_start <span style="color: #666666">+</span> point(<span style="color: #666666">0</span>,<span style="color: #666666">-</span>L<span style="color: #666666">/3</span>))
-    set_dashed_thin_blackline(vertical2)
-    set_dashed_thin_blackline(rod)
-    angle2 <span style="color: #666666">=</span> Arc_wText(<span style="color: #BA2121">r&#39;$\theta$&#39;</span>, rod_start, L<span style="color: #666666">/6</span>, <span style="color: #666666">-90</span>, a,
-                       text_spacing<span style="color: #666666">=1/30.</span>)
-
-    magnitude <span style="color: #666666">=</span> <span style="color: #666666">1.2*</span>L<span style="color: #666666">/2</span>   <span style="color: #408080; font-style: italic"># length of a unit force in figure</span>
-    force <span style="color: #666666">=</span> mg[time_level]  <span style="color: #408080; font-style: italic"># constant (scaled eq: about 1)</span>
-    force <span style="color: #666666">*=</span> magnitude
-    mg_force  <span style="color: #666666">=</span> Force(mass_pt, mass_pt <span style="color: #666666">+</span> force<span style="color: #666666">*</span>point(<span style="color: #666666">0</span>,<span style="color: #666666">-1</span>),
-                      <span style="color: #BA2121">&#39;&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>)
-    force <span style="color: #666666">=</span> S[time_level]
-    force <span style="color: #666666">*=</span> magnitude
-    rod_force <span style="color: #666666">=</span> Force(mass_pt, mass_pt <span style="color: #666666">-</span> force<span style="color: #666666">*</span>unit_vec(rod_vec),
-                      <span style="color: #BA2121">&#39;&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-                      text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.03</span>, <span style="color: #666666">0.01</span>))
-    force <span style="color: #666666">=</span> drag[time_level]
-    force <span style="color: #666666">*=</span> magnitude
-    <span style="color: #408080; font-style: italic">#print(&#39;drag(%g)=%g&#39; % (t, drag[time_level]))</span>
-    air_force <span style="color: #666666">=</span> Force(mass_pt, mass_pt <span style="color: #666666">-</span>
-                      force<span style="color: #666666">*</span>unit_vec((rod_vec[<span style="color: #666666">1</span>], <span style="color: #666666">-</span>rod_vec[<span style="color: #666666">0</span>])),
-                      <span style="color: #BA2121">&#39;&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-                      text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.04</span>,<span style="color: #666666">0.005</span>))
-
-    body_diagram <span style="color: #666666">=</span> Composition(
-        {<span style="color: #BA2121">&#39;mg&#39;</span>: mg_force, <span style="color: #BA2121">&#39;S&#39;</span>: rod_force, <span style="color: #BA2121">&#39;air&#39;</span>: air_force,
-         <span style="color: #BA2121">&#39;rod&#39;</span>: rod,
-         <span style="color: #BA2121">&#39;vertical&#39;</span>: vertical2, <span style="color: #BA2121">&#39;theta&#39;</span>: angle2,
-         <span style="color: #BA2121">&#39;body&#39;</span>: mass})
-
-    x0y0 <span style="color: #666666">=</span> Text(<span style="color: #BA2121">&#39;$(x_0,y_0)$&#39;</span>, P <span style="color: #666666">+</span> point(<span style="color: #666666">-0.4</span>,<span style="color: #666666">-0.1</span>))
-    ir <span style="color: #666666">=</span> Force(P, P <span style="color: #666666">+</span> L<span style="color: #666666">/10*</span>unit_vec(rod_vec),
-               <span style="color: #BA2121">r&#39;$\boldsymbol{i}_r$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-               text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.015</span>,<span style="color: #666666">0</span>))
-    ith <span style="color: #666666">=</span> Force(P, P <span style="color: #666666">+</span> L<span style="color: #666666">/10*</span>unit_vec((<span style="color: #666666">-</span>rod_vec[<span style="color: #666666">1</span>], rod_vec[<span style="color: #666666">0</span>])),
-               <span style="color: #BA2121">r&#39;$\boldsymbol{i}_{\theta}$&#39;</span>, text_pos<span style="color: #666666">=</span><span style="color: #BA2121">&#39;end&#39;</span>,
-                text_spacing<span style="color: #666666">=</span>(<span style="color: #666666">0.02</span>,<span style="color: #666666">0.005</span>))
-
-    <span style="color: #408080; font-style: italic">#body_diagram[&#39;ir&#39;] = ir</span>
-    <span style="color: #408080; font-style: italic">#body_diagram[&#39;ith&#39;] = ith</span>
-    <span style="color: #408080; font-style: italic">#body_diagram[&#39;origin&#39;] = x0y0</span>
-
-    drawing_tool<span style="color: #666666">.</span>erase()
-    body_diagram<span style="color: #666666">.</span>draw(verbose<span style="color: #666666">=0</span>)
-    <span style="color: #408080; font-style: italic">#drawing_tool.display(&#39;Body diagram&#39;)</span>
-    drawing_tool<span style="color: #666666">.</span>savefig(<span style="color: #BA2121">&#39;tmp_</span><span style="color: #BB6688; font-weight: bold">%04d</span><span style="color: #BA2121">.png&#39;</span> <span style="color: #666666">%</span> time_level, crop<span style="color: #666666">=</span><span style="color: #008000">False</span>)
-    <span style="color: #408080; font-style: italic"># No cropping: otherwise movies will be very strange</span>
-</pre></div>
-
-<h3 id="___sec13">Equations for the motion and forces </h3>
-
-<p>
-The modeling of the motion of a pendulum is most conveniently done in
-polar coordinates since then the unknown force in the rod is separated
-from the equation determining the motion \( \theta(t) \).
-The position vector for the mass is
-
-$$ \rpos = x_0\ii + y_0\jj + L\ir\tp$$
-
-The corresponding acceleration becomes
-
-$$ \ddot{\rpos} = L\ddot{\theta}{\ith} - L\dot{\theta^2}{\ir}\tp$$
-
-<!-- Note: the extra braces help to render the equation correctly in sphinx! -->
-
-<p>
-There are three forces on the mass: the gravity force
-\( mg\jj = mg(-\cos\theta\,\ir + \sin\theta\,\ith) \), the force in the rod
-\( -S\ir \), and the drag force because of air resistance:
-
-$$ -\half C_D \varrho \pi R^2 |v|v\,\ith,$$
-
-where \( C_D\approx 0.4 \) is the drag coefficient for a sphere, \( \varrho \)
-is the density of air, \( R \) is the radius of the mass, and \( v \) is the
-velocity (\( v=L\dot\theta \)). The drag force acts in \( -\ith \) direction
-when \( v>0 \).
-
-<p>
-Newton's second law of motion for the pendulum now becomes
-
-$$ mL\ddot\theta\ith - mL\dot\theta^2\ir = -mg(-\cos\theta\,\ir +
-\sin\theta\,\ith)
--S\ir - \half C_D \varrho \pi R^2 L^2|\dot\theta|\dot\theta\ith,$$
-
-which gives two component equations
-
-$$
-\begin{align}
-mL\ddot\theta + \half C_D \varrho \pi R^2 L^2|\dot\theta|\dot\theta +
-mg\sin\theta &= 0,
-\tag{1}\\ 
-S &= mL\dot\theta^2 + mg\cos\theta
-\tag{2}\tp
-\end{align}
-$$
-
-<p>
-It is almost always convenient to scale such equations. Introducing
-the dimensionless time
-
-$$ \bar t = \frac{t}{t_c},\quad t_c = \sqrt{\frac{L}{g}},$$
-
-leads to
-
-$$
-\begin{align}
-\frac{d^2\theta}{d\bar t^2} +
-\alpha\left\vert\frac{d\theta}{d\bar t}\right\vert\frac{d\theta}{d\bar t} +
-\sin\theta &= 0,
-\tag{3}\\ 
-\bar S &= \left(\frac{d\theta}{d\bar t}\right)^2
-+ \cos\theta,
-\tag{4}
-\end{align}
-$$
-
-where \( \alpha \) is a dimensionless drag coefficient
-
-$$ \alpha = \frac{C_D\varrho\pi R^2L}{2m},$$
-
-and \( \bar S \) is the scaled force
-
-$$ \bar S = \frac{S}{mg}\tp$$
-
-We see that \( \bar S = 1 \) for the equilibrium position \( \theta=0 \), so this
-scaling of \( S \) seems appropriate.
-
-<p>
-The parameter \( \alpha \) is about
-the ratio of the drag force and the gravity force:
-
-$$ \frac{|\half C_D\varrho \pi R^2 |v|v|}{|mg|}\sim
-\frac{C_D\varrho \pi R^2 L^2 t_c^{-2}}{mg}
-\left|\frac{d\bar\theta}{d\bar t}\right|\frac{d\bar\theta}{d\bar t}
-\sim \frac{C_D\varrho \pi R^2 L}{2m}\theta_0^2 = \alpha \theta_0^2\tp$$
-
-(We have that \( \theta(t)/d\theta_0 \) is in \( [-1,1] \), so we expect
-since \( \theta_0^{-1}d\bar\theta/d\bar t \) to be around unity. Here,
-\( \theta_0=\theta(0) \).)
-
-<p>
-The next step is to write a numerical solver for
-<a href="#mjx-eqn-3">(3)</a>-<a href="#mjx-eqn-4">(4)</a>. To
-this end, we use the <a href="https://github.com/hplgit/odespy" target="_self">Odespy</a>
-package. The system of second-order ODEs must be expressed as a system
-of first-order ODEs. We realize that the unknown \( \bar S \) is decoupled
-from \( \theta \) in the sense that we can first use
-<a href="#mjx-eqn-3">(3)</a> to solve for \( \theta \) and
-then compute \( \bar S \) from <a href="#mjx-eqn-4">(4)</a>.
-The first-order ODEs become
-
-$$
-\begin{align}
-\frac{d\omega}{d\bar t} &= -\alpha\left\vert\omega\right\vert\omega
-- \sin\theta,
-\tag{5}\\ 
-\frac{d\theta}{d\bar t} &= \omega\tp
-\tag{6}
-\end{align}
-$$
-
-Then we compute
-
-$$
-\begin{equation}
-\bar S = \omega^2 + \cos\theta\tp
-\tag{7}
-\end{equation}
-$$
-
-The dimensionless air resistance force can also be computed:
-
-$$
-\begin{equation}
--\alpha|\omega|\omega\tp
-\tag{8}
-\end{equation}
-$$
-
-Since we scaled the force \( S \) by \( mg \), \( mg \) is the natural force scale,
-and the \( mg \) force itself is then unity.
-
-<p>
-By updating \( \omega \) in the first equation, we can use an Euler-Cromer
-scheme on Odespy (all other schemes are independent of whether the
-\( \theta \) or \( \omega \) equation comes first).
-
-<h3 id="___sec14">Numerical solution </h3>
-
-<p>
-An appropriate solver is
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">simulate_pendulum</span>(alpha, theta0, dt, T):
-    <span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">odespy</span>
-
-    <span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">f</span>(u, t, alpha):
-        omega, theta <span style="color: #666666">=</span> u
-        <span style="color: #008000; font-weight: bold">return</span> [<span style="color: #666666">-</span>alpha<span style="color: #666666">*</span>omega<span style="color: #666666">*</span><span style="color: #008000">abs</span>(omega) <span style="color: #666666">-</span> sin(theta),
-                omega]
-
-    <span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
-    Nt <span style="color: #666666">=</span> <span style="color: #008000">int</span>(<span style="color: #008000">round</span>(T<span style="color: #666666">/</span><span style="color: #008000">float</span>(dt)))
-    t <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(<span style="color: #666666">0</span>, Nt<span style="color: #666666">*</span>dt, Nt<span style="color: #666666">+1</span>)
-    solver <span style="color: #666666">=</span> odespy<span style="color: #666666">.</span>RK4(f, f_args<span style="color: #666666">=</span>[alpha])
-    solver<span style="color: #666666">.</span>set_initial_condition([<span style="color: #666666">0</span>, theta0])
-    u, t <span style="color: #666666">=</span> solver<span style="color: #666666">.</span>solve(t,
-                        terminate<span style="color: #666666">=</span><span style="color: #008000; font-weight: bold">lambda</span> u, t, n: <span style="color: #008000">abs</span>(u[n,<span style="color: #666666">1</span>]) <span style="color: #666666">&lt;</span> <span style="color: #666666">1E-3</span>)
-    omega <span style="color: #666666">=</span> u[:,<span style="color: #666666">0</span>]
-    theta <span style="color: #666666">=</span> u[:,<span style="color: #666666">1</span>]
-    S <span style="color: #666666">=</span> omega<span style="color: #666666">**2</span> <span style="color: #666666">+</span> np<span style="color: #666666">.</span>cos(theta)
-    drag <span style="color: #666666">=</span> <span style="color: #666666">-</span>alpha<span style="color: #666666">*</span>np<span style="color: #666666">.</span>abs(omega)<span style="color: #666666">*</span>omega
-    <span style="color: #008000; font-weight: bold">return</span> t, theta, omega, S, drag
-</pre></div>
-
-<h3 id="___sec15">Animation </h3>
-
-<p>
-We can finally traverse the time array and draw a body diagram
-at each time level. The resulting sketches are saved to files
-<code>tmp_%04d.png</code>, and these files can be combined to videos:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">animate</span>():
-    <span style="color: #408080; font-style: italic"># Clean up old plot files</span>
-    <span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">os</span><span style="color: #666666">,</span> <span style="color: #0000FF; font-weight: bold">glob</span>
-    <span style="color: #008000; font-weight: bold">for</span> filename <span style="color: #AA22FF; font-weight: bold">in</span> glob<span style="color: #666666">.</span>glob(<span style="color: #BA2121">&#39;tmp_*.png&#39;</span>) <span style="color: #666666">+</span> glob<span style="color: #666666">.</span>glob(<span style="color: #BA2121">&#39;movie.*&#39;</span>):
-        os<span style="color: #666666">.</span>remove(filename)
-    <span style="color: #408080; font-style: italic"># Solve problem</span>
-    <span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">math</span> <span style="color: #008000; font-weight: bold">import</span> pi, radians, degrees
-    <span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
-    alpha <span style="color: #666666">=</span> <span style="color: #666666">0.4</span>
-    period <span style="color: #666666">=</span> <span style="color: #666666">2*</span>pi
-    T <span style="color: #666666">=</span> <span style="color: #666666">12*</span>period
-    dt <span style="color: #666666">=</span> period<span style="color: #666666">/40</span>
-    a <span style="color: #666666">=</span> <span style="color: #666666">70</span>
-    theta0 <span style="color: #666666">=</span> radians(a)
-    t, theta, omega, S, drag <span style="color: #666666">=</span> simulate_pendulum(alpha, theta0, dt, T)
-    mg <span style="color: #666666">=</span> np<span style="color: #666666">.</span>ones(S<span style="color: #666666">.</span>size)
-    <span style="color: #408080; font-style: italic"># Visualize drag force 5 times as large</span>
-    drag <span style="color: #666666">*=</span> <span style="color: #666666">5</span>
-    <span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">&#39;NOTE: drag force magnified 5 times!!&#39;</span>)
-
-    <span style="color: #408080; font-style: italic"># Draw animation</span>
-    <span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">time</span>
-    <span style="color: #008000; font-weight: bold">for</span> time_level, t_ <span style="color: #AA22FF; font-weight: bold">in</span> <span style="color: #008000">enumerate</span>(t):
-        pendulum(theta, S, mg, drag, t_, time_level)
-        time<span style="color: #666666">.</span>sleep(<span style="color: #666666">0.2</span>)
-
-    <span style="color: #408080; font-style: italic"># Make videos</span>
-    prog <span style="color: #666666">=</span> <span style="color: #BA2121">&#39;ffmpeg&#39;</span>
-    filename <span style="color: #666666">=</span> <span style="color: #BA2121">&#39;tmp_</span><span style="color: #BB6688; font-weight: bold">%04d</span><span style="color: #BA2121">.png&#39;</span>
-    fps <span style="color: #666666">=</span> <span style="color: #666666">6</span>
-    codecs <span style="color: #666666">=</span> {<span style="color: #BA2121">&#39;flv&#39;</span>: <span style="color: #BA2121">&#39;flv&#39;</span>, <span style="color: #BA2121">&#39;mp4&#39;</span>: <span style="color: #BA2121">&#39;libx264&#39;</span>,
-              <span style="color: #BA2121">&#39;webm&#39;</span>: <span style="color: #BA2121">&#39;libvpx&#39;</span>, <span style="color: #BA2121">&#39;ogg&#39;</span>: <span style="color: #BA2121">&#39;libtheora&#39;</span>}
-    <span style="color: #008000; font-weight: bold">for</span> ext <span style="color: #AA22FF; font-weight: bold">in</span> codecs:
-        lib <span style="color: #666666">=</span> codecs[ext]
-        cmd <span style="color: #666666">=</span> <span style="color: #BA2121">&#39;</span><span style="color: #BB6688; font-weight: bold">%(prog)s</span><span style="color: #BA2121"> -i </span><span style="color: #BB6688; font-weight: bold">%(filename)s</span><span style="color: #BA2121"> -r </span><span style="color: #BB6688; font-weight: bold">%(fps)s</span><span style="color: #BA2121"> &#39;</span> <span style="color: #666666">%</span> <span style="color: #008000">vars</span>()
-        cmd <span style="color: #666666">+=</span> <span style="color: #BA2121">&#39;-vcodec </span><span style="color: #BB6688; font-weight: bold">%(lib)s</span><span style="color: #BA2121"> movie.</span><span style="color: #BB6688; font-weight: bold">%(ext)s</span><span style="color: #BA2121">&#39;</span> <span style="color: #666666">%</span> <span style="color: #008000">vars</span>()
-        <span style="color: #008000; font-weight: bold">print</span>(cmd)
-        os<span style="color: #666666">.</span>system(cmd)
-</pre></div>
-<p>
-This time we did not use the <code>animate</code> function from Pysketcher, but
-stored each sketch in a file with <code>drawing_tool.savefig</code>. Note that
-the argument <code>crop=False</code> is key: otherwise each figure is cropped and
-it makes to sense to combine the images to a video. By default,
-Pysketcher crops (removes all exterior whitespace) from figures saved
-to file.
-
-<p>
-
-<div>
-<video  loop controls width='640' height='365' preload='none'>
-    <source src='https://github.com/hplgit/pysketcher/raw/master/doc/pub/tutorial/mov-tut/pendulum/movie.mp4'  type='video/mp4;  codecs="avc1.42E01E, mp4a.40.2"'>
-    <source src='https://github.com/hplgit/pysketcher/raw/master/doc/pub/tutorial/mov-tut/pendulum/movie.webm' type='video/webm; codecs="vp8, vorbis"'>
-    <source src='https://github.com/hplgit/pysketcher/raw/master/doc/pub/tutorial/mov-tut/pendulum/movie.ogg'  type='video/ogg;  codecs="theora, vorbis"'>
-</video>
-</div>
-<p><em>The drag force is magnified 5 times (compared to \( mg \) and \( S \)!</em></p>
-
-<!-- Issue warning if in a Safari browser -->
-<script language="javascript">
-if (!!(window.safari)) {
-  document.write("<div style=\"width: 95%%; padding: 10px; border: 1px solid #100; border-radius: 4px;\"><p><font color=\"red\">The above movie will not play in Safari - use Chrome, Firefox, or Opera.</font></p></div>")}
-</script>
-
-<p>
-<p>
-<!-- navigation buttons at the bottom of the page -->
-<ul class="pagination">
-<li><a href="._pysketcher002.html">&laquo;</a></li>
-  <li><a href="._pysketcher000.html">1</a></li>
-  <li><a href="._pysketcher001.html">2</a></li>
-  <li><a href="._pysketcher002.html">3</a></li>
-  <li class="active"><a href="._pysketcher003.html">4</a></li>
-  <li><a href="._pysketcher004.html">5</a></li>
-  <li><a href="._pysketcher005.html">6</a></li>
-  <li><a href="._pysketcher004.html">&raquo;</a></li>
-</ul>
-<!-- ------------------- end of main content --------------- -->
-
-</div>  <!-- end container -->
-<!-- include javascript, jQuery *first* -->
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
-
-<!-- Bootstrap footer
-<footer>
-<a href="http://..."><img width="250" align=right src="http://..."></a>
-</footer>
--->
-
-
-</body>
-</html>
-    
-

+ 0 - 615
doc/pub/tutorial/._pysketcher004.html

@@ -1,615 +0,0 @@
-<!--
-Automatically generated HTML file from DocOnce source
-(https://github.com/hplgit/doconce/)
--->
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
-<meta name="description" content="Using Pysketcher to Create Principal Sketches of Physics Problems">
-<meta name="keywords" content="tree data structure,recursive function calls">
-
-<title>Using Pysketcher to Create Principal Sketches of Physics Problems</title>
-
-<!-- Bootstrap style: bootswatch_readable -->
-<link href="http://netdna.bootstrapcdn.com/bootswatch/3.1.1/readable/bootstrap.min.css" rel="stylesheet">
-<!-- not necessary
-<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
--->
-
-<style type="text/css">
-
-/* Add scrollbar to dropdown menus in bootstrap navigation bar */
-.dropdown-menu {
-   height: auto;
-   max-height: 400px;
-   overflow-x: hidden;
-}
-</style>
-
-
-</head>
-
-<!-- tocinfo
-{'highest level': 1,
- 'sections': [('A first glimpse of Pysketcher', 1, None, '___sec0'),
-              ('Basic construction of sketches', 2, None, '___sec1'),
-              ('Basic drawing', 3, None, '___sec2'),
-              ('Groups of objects', 3, None, '___sec3'),
-              ('Changing line styles and colors', 3, None, '___sec4'),
-              ('The figure composition as an object hierarchy',
-               3,
-               None,
-               '___sec5'),
-              ('Animation: translating the vehicle', 3, None, '___sec6'),
-              ('Animation: rolling the wheels',
-               3,
-               'sketcher:vehicle1:anim',
-               'sketcher:vehicle1:anim'),
-              ('A simple pendulum',
-               1,
-               'sketcher:ex:pendulum',
-               'sketcher:ex:pendulum'),
-              ('The basic physics sketch',
-               2,
-               'sketcher:ex:pendulum:basic',
-               'sketcher:ex:pendulum:basic'),
-              ('The body diagram', 2, None, '___sec10'),
-              ('Animated body diagram',
-               2,
-               'sketcher:ex:pendulum:anim',
-               'sketcher:ex:pendulum:anim'),
-              ('Function for drawing the body diagram', 3, None, '___sec12'),
-              ('Equations for the motion and forces', 3, None, '___sec13'),
-              ('Numerical solution', 3, None, '___sec14'),
-              ('Animation', 3, None, '___sec15'),
-              ('Basic shapes', 1, None, '___sec16'),
-              ('Axis', 2, None, '___sec17'),
-              ('Distance with text', 2, None, '___sec18'),
-              ('Rectangle', 2, None, '___sec19'),
-              ('Triangle', 2, None, '___sec20'),
-              ('Arc', 2, None, '___sec21'),
-              ('Spring', 2, None, '___sec22'),
-              ('Dashpot', 2, None, '___sec23'),
-              ('Wavy', 2, None, '___sec24'),
-              ('Stochastic curves', 2, None, '___sec25'),
-              ('Inner workings of the Pysketcher tool', 1, None, '___sec26'),
-              ('Example of classes for geometric objects',
-               2,
-               None,
-               '___sec27'),
-              ('Simple geometric objects', 3, None, '___sec28'),
-              ('Class curve', 3, None, '___sec29'),
-              ('Compound geometric objects', 3, None, '___sec30'),
-              ('Adding functionality via recursion', 2, None, '___sec31'),
-              ('Basic principles of recursion', 3, None, '___sec32'),
-              ('Explaining recursion', 3, None, '___sec33'),
-              ('Scaling, translating, and rotating a figure',
-               2,
-               'sketcher:scaling',
-               'sketcher:scaling'),
-              ('Scaling', 3, None, '___sec35'),
-              ('Translation', 3, None, '___sec36'),
-              ('Rotation', 3, None, '___sec37')]}
-end of tocinfo -->
-
-<body>
-
-
-
-<script type="text/x-mathjax-config">
-MathJax.Hub.Config({
-  TeX: {
-     equationNumbers: {  autoNumber: "none"  },
-     extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"]
-  }
-});
-</script>
-<script type="text/javascript"
- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
-</script>
-
-<!-- newcommands.tex -->
-$$
-\newcommand{\half}{\frac{1}{2}}
-\newcommand{\tp}{\thinspace .}
-\newcommand{\rpos}{\boldsymbol{r}}
-\newcommand{\ii}{\boldsymbol{i}}
-\newcommand{\jj}{\boldsymbol{j}}
-\newcommand{\ir}{\boldsymbol{i}_r}
-\newcommand{\ith}{\boldsymbol{i}_{\theta}}
-$$
-
-
-
-
-    
-<!-- Bootstrap navigation bar -->
-<div class="navbar navbar-default navbar-fixed-top">
-  <div class="navbar-header">
-    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-      <span class="icon-bar"></span>
-    </button>
-    <a class="navbar-brand" href="pysketcher.html">Using Pysketcher to Create Principal Sketches of Physics Problems</a>
-  </div>
-
-  <div class="navbar-collapse collapse navbar-responsive-collapse">
-    <ul class="nav navbar-nav navbar-right">
-      <li class="dropdown">
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
-        <ul class="dropdown-menu">
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec0" style="font-size: 80%;"><b>A first glimpse of Pysketcher</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec1" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Basic construction of sketches</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec2" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic drawing</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec3" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Groups of objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec4" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changing line styles and colors</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec5" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The figure composition as an object hierarchy</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#___sec6" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: translating the vehicle</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher002.html#sketcher:vehicle1:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation: rolling the wheels</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum" style="font-size: 80%;"><b>A simple pendulum</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:basic" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The basic physics sketch</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec10" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;The body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#sketcher:ex:pendulum:anim" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Animated body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec12" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function for drawing the body diagram</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec13" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Equations for the motion and forces</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec14" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numerical solution</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher003.html#___sec15" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Animation</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec16" style="font-size: 80%;"><b>Basic shapes</b></a></li>
-     <!-- navigation toc: --> <li><a href="#___sec17" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Axis</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec18" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Distance with text</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec19" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Rectangle</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec20" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Triangle</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec21" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Arc</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec22" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Spring</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec23" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Dashpot</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec24" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Wavy</a></li>
-     <!-- navigation toc: --> <li><a href="#___sec25" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Stochastic curves</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec26" style="font-size: 80%;"><b>Inner workings of the Pysketcher tool</b></a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec27" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Example of classes for geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec28" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec29" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class curve</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec30" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compound geometric objects</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec31" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Adding functionality via recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec32" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basic principles of recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec33" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Explaining recursion</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#sketcher:scaling" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Scaling, translating, and rotating a figure</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec35" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scaling</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec36" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translation</a></li>
-     <!-- navigation toc: --> <li><a href="._pysketcher005.html#___sec37" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotation</a></li>
-
-        </ul>
-      </li>
-    </ul>
-  </div>
-</div>
-</div> <!-- end of navigation bar -->
-
-<div class="container">
-
-<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
-
-<a name="part0004"></a>
-<!-- !split -->
-
-<h1 id="___sec16">Basic shapes </h1>
-
-<p>
-This section presents many of the basic shapes in Pysketcher:
-<code>Axis</code>, <code>Distance_wText</code>, <code>Rectangle</code>, 	<code>Triangle</code>, <code>Arc</code>,
-<code>Spring</code>, <code>Dashpot</code>, and <code>Wavy</code>.
-Each shape is demonstrated with a figure and a
-unit test that shows how the figure is constructed in Python code.
-These demos rely heavily on the method <code>draw_dimensions</code> in
-the shape classes, which annotates the basic drawing of the shape
-with the various geometric parameters that govern the shape.
-
-<h2 id="___sec17">Axis </h2>
-
-<p>
-The <code>Axis</code> object gives the possibility draw a single axis to
-notify a coordinate system. Here is an example where we
-draw \( x \) and \( y \) axis of three coordinate systems of different
-rotation:
-
-<p>
-<br />
-<br />
-
-<p>
-<center><p><img src="fig-tut/Axis.png" align="bottom" width=500></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-The corresponding code looks like this:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Axis</span>():
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=15</span>, ymin<span style="color: #666666">=-7</span>, ymax<span style="color: #666666">=8</span>, axis<span style="color: #666666">=</span><span style="color: #008000">True</span>,
-        instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Axis.py&#39;</span>)
-    <span style="color: #408080; font-style: italic"># Draw normal x and y axis with origin at (7.5, 2)</span>
-    <span style="color: #408080; font-style: italic"># in the coordinate system of the sketch: [0,15]x[-7,8]</span>
-    x_axis <span style="color: #666666">=</span> Axis((<span style="color: #666666">7.5</span>,<span style="color: #666666">2</span>), <span style="color: #666666">5</span>, <span style="color: #BA2121">&#39;x&#39;</span>, rotation_angle<span style="color: #666666">=0</span>)
-    y_axis <span style="color: #666666">=</span> Axis((<span style="color: #666666">7.5</span>,<span style="color: #666666">2</span>), <span style="color: #666666">5</span>, <span style="color: #BA2121">&#39;y&#39;</span>, rotation_angle<span style="color: #666666">=90</span>)
-    system <span style="color: #666666">=</span> Composition({<span style="color: #BA2121">&#39;x axis&#39;</span>: x_axis, <span style="color: #BA2121">&#39;y axis&#39;</span>: y_axis})
-    system<span style="color: #666666">.</span>draw()
-    drawing_tool<span style="color: #666666">.</span>display()
-
-    <span style="color: #408080; font-style: italic"># Rotate this system 40 degrees counter clockwise</span>
-    <span style="color: #408080; font-style: italic"># and draw it with dashed lines</span>
-    system<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dashed&#39;</span>)
-    system<span style="color: #666666">.</span>rotate(<span style="color: #666666">40</span>, (<span style="color: #666666">7.5</span>,<span style="color: #666666">2</span>))
-    system<span style="color: #666666">.</span>draw()
-    drawing_tool<span style="color: #666666">.</span>display()
-
-    <span style="color: #408080; font-style: italic"># Rotate this system another 220 degrees and show</span>
-    <span style="color: #408080; font-style: italic"># with dotted lines</span>
-    system<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dotted&#39;</span>)
-    system<span style="color: #666666">.</span>rotate(<span style="color: #666666">220</span>, (<span style="color: #666666">7.5</span>,<span style="color: #666666">2</span>))
-    system<span style="color: #666666">.</span>draw()
-    drawing_tool<span style="color: #666666">.</span>display()
-
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Axis&#39;</span>)
-</pre></div>
-
-<h2 id="___sec18">Distance with text </h2>
-
-<p>
-The object <code>Distance_wText</code> is used to display an arrow, to indicate
-a distance in a sketch, with an additional text in the middle of the arrow.
-
-<p>
-The figure
-
-<p>
-<br />
-<br />
-
-<p>
-<center><p><img src="fig-tut/Distance_wText.png" align="bottom" width=500></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-was produced by this code:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Distance_wText</span>():
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=10</span>, ymin<span style="color: #666666">=0</span>, ymax<span style="color: #666666">=6</span>,
-        axis<span style="color: #666666">=</span><span style="color: #008000">True</span>, instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Distance_wText.py&#39;</span>)
-
-    fontsize<span style="color: #666666">=14</span>
-    t <span style="color: #666666">=</span> <span style="color: #BA2121">r&#39;$ 2\pi R^2 $&#39;</span>  <span style="color: #408080; font-style: italic"># sample text</span>
-    examples <span style="color: #666666">=</span> Composition({
-        <span style="color: #BA2121">&#39;a0&#39;</span>: Distance_wText((<span style="color: #666666">4</span>,<span style="color: #666666">5</span>), (<span style="color: #666666">8</span>, <span style="color: #666666">5</span>), t, fontsize),
-        <span style="color: #BA2121">&#39;a6&#39;</span>: Distance_wText((<span style="color: #666666">4</span>,<span style="color: #666666">5</span>), (<span style="color: #666666">4</span>, <span style="color: #666666">4</span>), t, fontsize),
-        <span style="color: #BA2121">&#39;a1&#39;</span>: Distance_wText((<span style="color: #666666">0</span>,<span style="color: #666666">2</span>), (<span style="color: #666666">2</span>, <span style="color: #666666">4.5</span>), t, fontsize),
-        <span style="color: #BA2121">&#39;a2&#39;</span>: Distance_wText((<span style="color: #666666">0</span>,<span style="color: #666666">2</span>), (<span style="color: #666666">2</span>, <span style="color: #666666">0</span>), t, fontsize),
-        <span style="color: #BA2121">&#39;a3&#39;</span>: Distance_wText((<span style="color: #666666">2</span>,<span style="color: #666666">4.5</span>), (<span style="color: #666666">0</span>, <span style="color: #666666">5.5</span>), t, fontsize),
-        <span style="color: #BA2121">&#39;a4&#39;</span>: Distance_wText((<span style="color: #666666">8</span>,<span style="color: #666666">4</span>), (<span style="color: #666666">10</span>, <span style="color: #666666">3</span>), t, fontsize,
-                             text_spacing<span style="color: #666666">=-1./60</span>),
-        <span style="color: #BA2121">&#39;a5&#39;</span>: Distance_wText((<span style="color: #666666">8</span>,<span style="color: #666666">2</span>), (<span style="color: #666666">10</span>, <span style="color: #666666">1</span>), t, fontsize,
-                             text_spacing<span style="color: #666666">=-1./40</span>, alignment<span style="color: #666666">=</span><span style="color: #BA2121">&#39;right&#39;</span>),
-        <span style="color: #BA2121">&#39;c1&#39;</span>: Text_wArrow(<span style="color: #BA2121">&#39;text_spacing=-1./60&#39;</span>,
-                          (<span style="color: #666666">4</span>, <span style="color: #666666">3.5</span>), (<span style="color: #666666">9</span>, <span style="color: #666666">3.2</span>),
-                          fontsize<span style="color: #666666">=10</span>, alignment<span style="color: #666666">=</span><span style="color: #BA2121">&#39;left&#39;</span>),
-        <span style="color: #BA2121">&#39;c2&#39;</span>: Text_wArrow(<span style="color: #BA2121">&#39;text_spacing=-1./40, alignment=&quot;right&quot;&#39;</span>,
-                          (<span style="color: #666666">4</span>, <span style="color: #666666">0.5</span>), (<span style="color: #666666">9</span>, <span style="color: #666666">1.2</span>),
-                          fontsize<span style="color: #666666">=10</span>, alignment<span style="color: #666666">=</span><span style="color: #BA2121">&#39;left&#39;</span>),
-        })
-    examples<span style="color: #666666">.</span>draw()
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Distance_wText and text positioning&#39;</span>)
-</pre></div>
-<p>
-Note the use of <code>Text_wArrow</code> to write an explaining text with an
-associated arrow, here used to explain how
-the <code>text_spacing</code> and <code>alignment</code> arguments can be used to adjust
-the appearance of the text that goes with the distance arrow.
-
-<h2 id="___sec19">Rectangle </h2>
-
-<p>
-<center><p><img src="fig-tut/Rectangle.png" align="bottom" width=500></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-The above figure can be produced by the following code.
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Rectangle</span>():
-    L <span style="color: #666666">=</span> <span style="color: #666666">3.0</span>
-    W <span style="color: #666666">=</span> <span style="color: #666666">4.0</span>
-
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=2*</span>W, ymin<span style="color: #666666">=-</span>L<span style="color: #666666">/2</span>, ymax<span style="color: #666666">=2*</span>L,
-        axis<span style="color: #666666">=</span><span style="color: #008000">True</span>, instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Rectangle.py&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_grid(<span style="color: #008000">True</span>)
-
-    xpos <span style="color: #666666">=</span> W<span style="color: #666666">/2</span>
-    r <span style="color: #666666">=</span> Rectangle(lower_left_corner<span style="color: #666666">=</span>(xpos,<span style="color: #666666">0</span>), width<span style="color: #666666">=</span>W, height<span style="color: #666666">=</span>L)
-    r<span style="color: #666666">.</span>draw()
-    r<span style="color: #666666">.</span>draw_dimensions()
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Rectangle&#39;</span>)
-</pre></div>
-<p>
-Note that the <code>draw_dimension</code> method adds explanation of dimensions and various
-important argument in the construction of a shape. It adapts the annotations
-to the geometry of the current shape.
-
-<h2 id="___sec20">Triangle </h2>
-
-<p>
-<center><p><img src="fig-tut/Triangle.png" align="bottom" width=500></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-The code below produces the figure.
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Triangle</span>():
-    L <span style="color: #666666">=</span> <span style="color: #666666">3.0</span>
-    W <span style="color: #666666">=</span> <span style="color: #666666">4.0</span>
-
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=2*</span>W, ymin<span style="color: #666666">=-</span>L<span style="color: #666666">/2</span>, ymax<span style="color: #666666">=1.2*</span>L,
-        axis<span style="color: #666666">=</span><span style="color: #008000">True</span>, instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Triangle.py&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_grid(<span style="color: #008000">True</span>)
-
-    xpos <span style="color: #666666">=</span> <span style="color: #666666">1</span>
-    t <span style="color: #666666">=</span> Triangle(p1<span style="color: #666666">=</span>(W<span style="color: #666666">/2</span>,<span style="color: #666666">0</span>), p2<span style="color: #666666">=</span>(<span style="color: #666666">3*</span>W<span style="color: #666666">/2</span>,W<span style="color: #666666">/2</span>), p3<span style="color: #666666">=</span>(<span style="color: #666666">4*</span>W<span style="color: #666666">/5.</span>,L))
-    t<span style="color: #666666">.</span>draw()
-    t<span style="color: #666666">.</span>draw_dimensions()
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Triangle&#39;</span>)
-</pre></div>
-<p>
-Here, the <code>draw_dimension</code> method writes the name of the corners at the
-position of the corners, which does not always look nice (the present figure
-is an example). For a high-quality sketch one would add some spacing
-to the location of the p1, p2, and even p3 texts.
-
-<h2 id="___sec21">Arc </h2>
-
-<p>
-<center><p><img src="fig-tut/Arc.png" align="bottom" width=400></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-An arc like the one above is produced by
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Arc</span>():
-    L <span style="color: #666666">=</span> <span style="color: #666666">4.0</span>
-    W <span style="color: #666666">=</span> <span style="color: #666666">4.0</span>
-
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=-</span>W<span style="color: #666666">/2</span>, xmax<span style="color: #666666">=</span>W, ymin<span style="color: #666666">=-</span>L<span style="color: #666666">/2</span>, ymax<span style="color: #666666">=1.5*</span>L,
-        axis<span style="color: #666666">=</span><span style="color: #008000">True</span>, instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Arc.py&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_grid(<span style="color: #008000">True</span>)
-
-    center <span style="color: #666666">=</span> point(<span style="color: #666666">0</span>,<span style="color: #666666">0</span>)
-    radius <span style="color: #666666">=</span> L<span style="color: #666666">/2</span>
-    start_angle <span style="color: #666666">=</span> <span style="color: #666666">60</span>
-    arc_angle <span style="color: #666666">=</span> <span style="color: #666666">45</span>
-    a <span style="color: #666666">=</span> Arc(center, radius, start_angle, arc_angle)
-    a<span style="color: #666666">.</span>draw()
-
-    R1 <span style="color: #666666">=</span> <span style="color: #666666">1.25*</span>radius
-    R2 <span style="color: #666666">=</span> <span style="color: #666666">1.5*</span>radius
-    R <span style="color: #666666">=</span> <span style="color: #666666">2*</span>radius
-    a<span style="color: #666666">.</span>dimensions <span style="color: #666666">=</span> {
-        <span style="color: #BA2121">&#39;start_angle&#39;</span>:
-        Arc_wText(
-            <span style="color: #BA2121">&#39;start_angle&#39;</span>, center, R1, start_angle<span style="color: #666666">=0</span>,
-            arc_angle<span style="color: #666666">=</span>start_angle, text_spacing<span style="color: #666666">=1/10.</span>),
-        <span style="color: #BA2121">&#39;arc_angle&#39;</span>:
-        Arc_wText(
-            <span style="color: #BA2121">&#39;arc_angle&#39;</span>, center, R2, start_angle<span style="color: #666666">=</span>start_angle,
-            arc_angle<span style="color: #666666">=</span>arc_angle, text_spacing<span style="color: #666666">=1/20.</span>),
-        <span style="color: #BA2121">&#39;r=0&#39;</span>:
-        Line(center, center <span style="color: #666666">+</span>
-             point(R<span style="color: #666666">*</span>cos(radians(start_angle)),
-                   R<span style="color: #666666">*</span>sin(radians(start_angle)))),
-        <span style="color: #BA2121">&#39;r=start_angle&#39;</span>:
-        Line(center, center <span style="color: #666666">+</span>
-             point(R<span style="color: #666666">*</span>cos(radians(start_angle<span style="color: #666666">+</span>arc_angle)),
-                   R<span style="color: #666666">*</span>sin(radians(start_angle<span style="color: #666666">+</span>arc_angle)))),
-        <span style="color: #BA2121">&#39;r=start+arc_angle&#39;</span>:
-        Line(center, center <span style="color: #666666">+</span>
-             point(R, <span style="color: #666666">0</span>))<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dashed&#39;</span>),
-        <span style="color: #BA2121">&#39;radius&#39;</span>: Distance_wText(center, a(<span style="color: #666666">0</span>), <span style="color: #BA2121">&#39;radius&#39;</span>, text_spacing<span style="color: #666666">=1/40.</span>),
-        <span style="color: #BA2121">&#39;center&#39;</span>: Text(<span style="color: #BA2121">&#39;center&#39;</span>, center<span style="color: #666666">-</span>point(radius<span style="color: #666666">/10.</span>, radius<span style="color: #666666">/10.</span>)),
-        }
-    <span style="color: #008000; font-weight: bold">for</span> dimension <span style="color: #AA22FF; font-weight: bold">in</span> a<span style="color: #666666">.</span>dimensions:
-        <span style="color: #008000; font-weight: bold">if</span> dimension<span style="color: #666666">.</span>startswith(<span style="color: #BA2121">&#39;r=&#39;</span>):
-            dim <span style="color: #666666">=</span> a<span style="color: #666666">.</span>dimensions[dimension]
-            dim<span style="color: #666666">.</span>set_linestyle(<span style="color: #BA2121">&#39;dashed&#39;</span>)
-            dim<span style="color: #666666">.</span>set_linewidth(<span style="color: #666666">1</span>)
-            dim<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;black&#39;</span>)
-
-    a<span style="color: #666666">.</span>draw_dimensions()
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Arc&#39;</span>)
-</pre></div>
-
-<h2 id="___sec22">Spring </h2>
-
-<p>
-<center><p><img src="fig-tut/Spring.png" align="bottom" width=800></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-The code for making these two springs goes like this:
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Spring</span>():
-    L <span style="color: #666666">=</span> <span style="color: #666666">5.0</span>
-    W <span style="color: #666666">=</span> <span style="color: #666666">2.0</span>
-
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=0</span>, xmax<span style="color: #666666">=7*</span>W, ymin<span style="color: #666666">=-</span>L<span style="color: #666666">/2</span>, ymax<span style="color: #666666">=1.5*</span>L,
-        axis<span style="color: #666666">=</span><span style="color: #008000">True</span>, instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Spring.py&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_grid(<span style="color: #008000">True</span>)
-
-    xpos <span style="color: #666666">=</span> W
-    s1 <span style="color: #666666">=</span> Spring((W,<span style="color: #666666">0</span>), L, teeth<span style="color: #666666">=</span><span style="color: #008000">True</span>)
-    s1_title <span style="color: #666666">=</span> Text(<span style="color: #BA2121">&#39;Default Spring&#39;</span>,
-                    s1<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;end&#39;</span>] <span style="color: #666666">+</span> point(<span style="color: #666666">0</span>,L<span style="color: #666666">/10</span>))
-    s1<span style="color: #666666">.</span>draw()
-    s1_title<span style="color: #666666">.</span>draw()
-    <span style="color: #408080; font-style: italic">#s1.draw_dimensions()</span>
-    xpos <span style="color: #666666">+=</span> <span style="color: #666666">3*</span>W
-    s2 <span style="color: #666666">=</span> Spring(start<span style="color: #666666">=</span>(xpos,<span style="color: #666666">0</span>), length<span style="color: #666666">=</span>L, width<span style="color: #666666">=</span>W<span style="color: #666666">/2.</span>,
-                bar_length<span style="color: #666666">=</span>L<span style="color: #666666">/6.</span>, teeth<span style="color: #666666">=</span><span style="color: #008000">False</span>)
-    s2<span style="color: #666666">.</span>draw()
-    s2<span style="color: #666666">.</span>draw_dimensions()
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Spring&#39;</span>)
-</pre></div>
-
-<h2 id="___sec23">Dashpot </h2>
-
-<p>
-<center><p><img src="fig-tut/Dashpot.png" align="bottom" width=600></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-This dashpot is produced by
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">test_Dashpot</span>():
-    L <span style="color: #666666">=</span> <span style="color: #666666">5.0</span>
-    W <span style="color: #666666">=</span> <span style="color: #666666">2.0</span>
-    xpos <span style="color: #666666">=</span> <span style="color: #666666">0</span>
-
-    drawing_tool<span style="color: #666666">.</span>set_coordinate_system(
-        xmin<span style="color: #666666">=</span>xpos, xmax<span style="color: #666666">=</span>xpos<span style="color: #666666">+5.5*</span>W, ymin<span style="color: #666666">=-</span>L<span style="color: #666666">/2</span>, ymax<span style="color: #666666">=1.5*</span>L,
-        axis<span style="color: #666666">=</span><span style="color: #008000">True</span>, instruction_file<span style="color: #666666">=</span><span style="color: #BA2121">&#39;tmp_Dashpot.py&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_linecolor(<span style="color: #BA2121">&#39;blue&#39;</span>)
-    drawing_tool<span style="color: #666666">.</span>set_grid(<span style="color: #008000">True</span>)
-
-    <span style="color: #408080; font-style: italic"># Default (simple) dashpot</span>
-    xpos <span style="color: #666666">=</span> <span style="color: #666666">1.5</span>
-    d1 <span style="color: #666666">=</span> Dashpot(start<span style="color: #666666">=</span>(xpos,<span style="color: #666666">0</span>), total_length<span style="color: #666666">=</span>L)
-    d1_title <span style="color: #666666">=</span> Text(<span style="color: #BA2121">&#39;Dashpot (default)&#39;</span>,
-                    d1<span style="color: #666666">.</span>geometric_features()[<span style="color: #BA2121">&#39;end&#39;</span>] <span style="color: #666666">+</span> point(<span style="color: #666666">0</span>,L<span style="color: #666666">/10</span>))
-    d1<span style="color: #666666">.</span>draw()
-    d1_title<span style="color: #666666">.</span>draw()
-
-    <span style="color: #408080; font-style: italic"># Dashpot for animation with fixed bar_length, dashpot_length and</span>
-    <span style="color: #408080; font-style: italic"># prescribed piston_pos</span>
-    xpos <span style="color: #666666">+=</span> <span style="color: #666666">2.5*</span>W
-    d2 <span style="color: #666666">=</span> Dashpot(start<span style="color: #666666">=</span>(xpos,<span style="color: #666666">0</span>), total_length<span style="color: #666666">=1.2*</span>L, width<span style="color: #666666">=</span>W<span style="color: #666666">/2</span>,
-                 bar_length<span style="color: #666666">=</span>W, dashpot_length<span style="color: #666666">=</span>L<span style="color: #666666">/2</span>, piston_pos<span style="color: #666666">=2*</span>W)
-    d2<span style="color: #666666">.</span>draw()
-    d2<span style="color: #666666">.</span>draw_dimensions()
-
-    drawing_tool<span style="color: #666666">.</span>display(<span style="color: #BA2121">&#39;Dashpot&#39;</span>)
-</pre></div>
-
-<h2 id="___sec24">Wavy </h2>
-
-<p>
-Looks strange. Fix x axis.
-
-<h2 id="___sec25">Stochastic curves </h2>
-
-<p>
-The <code>StochasticWavyCurve</code> object offers three precomputed
-graphics that have a random variation:
-
-<p>
-<br />
-<br />
-
-<p>
-<center><p><img src="fig-tut/StochasticWavyCurve.png" align="bottom" width=600></p></center>
-
-<p>
-<br />
-<br />
-
-<p>
-The usage is simple. The construction
-
-<p>
-
-<!-- code=python (!bc pycod) typeset with pygments style "default" -->
-<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%">curve <span style="color: #666666">=</span> StochasticWavyCurve(curve_no<span style="color: #666666">=1</span>, percentage<span style="color: #666666">=40</span>)
-</pre></div>
-<p>
-picks the second curve (the three are numbered 0, 1, and 2),
-and the first 40% of that curve. In case one desires another extent
-of the axis, one can just scale the coordinates directly as these
-are stored in the arrays <code>curve.x[curve_no]</code> and
-<code>curve.y[curve_no]</code>.
-
-<p>
-<p>
-<!-- navigation buttons at the bottom of the page -->
-<ul class="pagination">
-<li><a href="._pysketcher003.html">&laquo;</a></li>
-  <li><a href="._pysketcher000.html">1</a></li>
-  <li><a href="._pysketcher001.html">2</a></li>
-  <li><a href="._pysketcher002.html">3</a></li>
-  <li><a href="._pysketcher003.html">4</a></li>
-  <li class="active"><a href="._pysketcher004.html">5</a></li>
-  <li><a href="._pysketcher005.html">6</a></li>
-  <li><a href="._pysketcher005.html">&raquo;</a></li>
-</ul>
-<!-- ------------------- end of main content --------------- -->
-
-</div>  <!-- end container -->
-<!-- include javascript, jQuery *first* -->
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
-
-<!-- Bootstrap footer
-<footer>
-<a href="http://..."><img width="250" align=right src="http://..."></a>
-</footer>
--->
-
-
-</body>
-</html>
-    
-

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 980
doc/pub/tutorial/._pysketcher005.html


BIN
doc/pub/tutorial/fig-tut/Arc.pdf


BIN
doc/pub/tutorial/fig-tut/Arc.png


BIN
doc/pub/tutorial/fig-tut/Axis.pdf


BIN
doc/pub/tutorial/fig-tut/Axis.png


BIN
doc/pub/tutorial/fig-tut/Dashpot.pdf


BIN
doc/pub/tutorial/fig-tut/Dashpot.png


BIN
doc/pub/tutorial/fig-tut/Distance_wText.pdf


BIN
doc/pub/tutorial/fig-tut/Distance_wText.png


BIN
doc/pub/tutorial/fig-tut/Rectangle.pdf


BIN
doc/pub/tutorial/fig-tut/Rectangle.png


BIN
doc/pub/tutorial/fig-tut/Shape_hierarchy_complete.png


BIN
doc/pub/tutorial/fig-tut/Shape_hierarchy_larger.png


BIN
doc/pub/tutorial/fig-tut/Shape_hierarchy_small.png


BIN
doc/pub/tutorial/fig-tut/Spring.pdf


BIN
doc/pub/tutorial/fig-tut/Spring.png


BIN
doc/pub/tutorial/fig-tut/StochasticWavyCurve.pdf


BIN
doc/pub/tutorial/fig-tut/StochasticWavyCurve.png


BIN
doc/pub/tutorial/fig-tut/Triangle.pdf


BIN
doc/pub/tutorial/fig-tut/Triangle.png


BIN
doc/pub/tutorial/fig-tut/Vehicle0_hier2.pdf


BIN
doc/pub/tutorial/fig-tut/Vehicle0_hier2.png


BIN
doc/pub/tutorial/fig-tut/Wavy.pdf


BIN
doc/pub/tutorial/fig-tut/Wavy.png


BIN
doc/pub/tutorial/fig-tut/beam_mid_support_deflection.png


BIN
doc/pub/tutorial/fig-tut/beam_mid_support_math.png


BIN
doc/pub/tutorial/fig-tut/beam_mid_support_raw.png


+ 0 - 794
doc/pub/tutorial/fig-tut/mpl_code_Arc.py

@@ -1,794 +0,0 @@
-import matplotlib.pyplot as mpl
-import matplotlib.transforms as transforms
-
-mpl.ion()  # for interactive drawing
-fig = mpl.figure()
-
-ax = fig.gca()
-xmin, xmax, ymin, ymax = -2.0, 4.0, -2.0, 6.0
-ax.set_xlim(xmin, xmax)
-ax.set_ylim(ymin, ymax)
-ax.set_aspect('equal')
-
-
-
-mpl.grid(True)
-
-# arc
-mpl.arrow(x=-0.509204, y=1.93409, dx=-0.00843419, dy=-0.00224023,
-          facecolor='b', edgecolor='b',
-          linestyle='solid',
-          linewidth=2, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(-0.2, -0.2, 'center',
-        horizontalalignment='center', fontsize=14)
-ax.text(2.68468, 1.55, 'start_angle',
-        horizontalalignment='center', fontsize=14)
-
-# arc
-x = [2.5,
- 2.4999576921443607,
- 2.4998307700094053,
- 2.499619237890978,
- 2.4993231029486545,
- 2.4989423752055013,
- 2.4984770675477392,
- 2.497927195724303,
- 2.4972927783463112,
- 2.4965738368864345,
- 2.4957703956781705,
- 2.4948824819150186,
- 2.4939101256495606,
- 2.4928533597924436,
- 2.491712220111265,
- 2.4904867452293638,
- 2.489176976624511,
- 2.4877829586275078,
- 2.4863047384206833,
- 2.4847423660362997,
- 2.4830958943548573,
- 2.481365379103305,
- 2.4795508788531544,
- 2.4776524550184966,
- 2.475670171853926,
- 2.473604096452361,
- 2.4714542987427794,
- 2.4692208514878446,
- 2.466903830281448,
- 2.464503313546149,
- 2.46201938253052,
- 2.4594521213063967,
- 2.4568016167660334,
- 2.45406795861916,
- 2.4512512393899484,
- 2.4483515544138785,
- 2.4453690018345142,
- 2.442303682600177,
- 2.4391557004605358,
- 2.435925161963088,
- 2.4326121764495596,
- 2.4292168560522005,
- 2.425739315689991,
- 2.422179673064752,
- 2.41853804865716,
- 2.4148145657226707,
- 2.411009350287347,
- 2.407122531143594,
- 2.4031542398457972,
- 2.3991046107058733,
- 2.3949737807887224,
- 2.390761889907589,
- 2.38646908061933,
- 2.38209549821959,
- 2.377641290737884,
- 2.3731066089325847,
- 2.3684916062858234,
- 2.363796438998292,
- 2.359021265983959,
- 2.354166248864688,
- 2.3492315519647713,
- 2.3442173423053623,
- 2.339123789598829,
- 2.3339510662430043,
- 2.328699347315356,
- 2.323368810567056,
- 2.3179596364169686,
- 2.3124720079455403,
- 2.306906110888606,
- 2.3012621336311008,
- 2.295540267200685,
- 2.289740705261278,
- 2.2838636441065026,
- 2.2779092826530425,
- 2.2718778224339107,
- 2.2657694675916247,
- 2.2595844248713015,
- 2.2533229036136557,
- 2.2469851157479175,
- 2.2405712757846583,
- 2.2340816008085307,
- 2.2275163104709197,
- 2.2208756269825103,
- 2.214159775105765,
- 2.2073689821473175,
- 2.200503477950278,
- 2.193563494886455,
- 2.1865492678484895,
- 2.179461034241906,
- 2.1722990339770756,
- 2.165063509461097,
- 2.157754705589591,
- 2.1503728697384137,
- 2.142918251755281,
- 2.135391103951314,
- 2.1277916810924995,
- 2.1201202403910653,
- 2.1123770414967753,
- 2.104562346488144,
- 2.0966764198635603,
- 2.088719528532341,
- 2.0806919418056946,
- 2.0725939313876043,
- 2.0644257713656353,
- 2.056187738201656,
- 2.0478801107224793,
- 2.03950317011043,
- 2.031057199893823,
- 2.0225424859373686,
- 2.0139593164324983,
- 2.0053079818876096,
- 1.9965887751182323,
- 1.9878019912371194,
- 1.9789479276442588,
- 1.970026884016805,
- 1.9610391622989396,
- 1.9519850666916483,
- 1.9428649036424273,
- 1.93367898183491,
- 1.9244276121784196,
- 1.9151111077974452,
- 1.905729784021045,
- 1.8962839583721727,
- 1.8867739505569303,
- 1.877200082453748,
- 1.86756267810249,
- 1.857862063693486,
- 1.8480985675564905,
- 1.8382725201495718,
- 1.8283842540479265,
- 1.8184341039326222,
- 1.80842240657927,
- 1.7983495008466281,
- 1.788215727665129,
- 1.778021430025343,
- 1.7677669529663689,
- 1.7574526435641544,
- 1.7470788509197501,
- 1.7366459261474934,
- 1.7261542223631243,
- 1.7156040946718343,
- 1.7049959001562465,
- 1.694329997864331,
- 1.683606748797251,
- 1.6728265158971458,
- 1.6619896640348446,
- 1.6510965599975194,
- 1.6401475724762684,
- 1.6291430720536382,
- 1.6180834311910814,
- 1.6069690242163488,
- 1.595800227310821,
- 1.5845774184967758,
- 1.5733009776245939,
- 1.561971286359901,
- 1.5505887281706503,
- 1.539153688314146,
- 1.5276665538239997,
- 1.516127713497034,
- 1.504537557880121,
- 1.4928964792569657,
- 1.4812048716348272,
- 1.4694631307311832,
- 1.4576716539603372,
- 1.4458308404199665,
- 1.4339410908776153,
- 1.4220028077571298,
- 1.4100163951250364,
- 1.3979822586768675,
- 1.385900805723429,
- 1.3737724451770152,
- 1.361597587537568,
- 1.3493766448787827,
- 1.337110030834161,
- 1.3247981605830128,
- 1.312441450836401,
- 1.3000403198230388,
- 1.2875951872751359,
- 1.2751064744141885,
- 1.2625746039367256,
- 1.2500000000000002]
-y = [0.0,
- 0.014544328387484583,
- 0.029088164503492532,
- 0.04363101609320877,
- 0.058172390935140796,
- 0.07271179685777851,
- 0.08724874175625241,
- 0.10178273360898957,
- 0.11631328049436661,
- 0.13083989060735957,
- 0.14536207227618955,
- 0.1598793339789641,
- 0.17439118436031323,
- 0.18889713224802018,
- 0.2033966866696457,
- 0.21788935686914537,
- 0.23237465232348048,
- 0.24685208275921977,
- 0.2613211581691336,
- 0.27578138882877923,
- 0.29023228531307554,
- 0.30467335851286864,
- 0.3191041196514865,
- 0.3335240803012817,
- 0.3479327524001635,
- 0.3623296482681168,
- 0.37671428062370776,
- 0.3910861626005771,
- 0.40544480776391856,
- 0.41978973012694265,
- 0.43412044416732576,
- 0.4484364648436434,
- 0.46273730761178644,
- 0.47702248844136197,
- 0.49129152383207525,
- 0.5055439308300947,
- 0.5197792270443982,
- 0.5339969306631001,
- 0.5481965604697582,
- 0.5623776358596624,
- 0.5765396768561003,
- 0.5906822041266032,
- 0.6048047389991692,
- 0.618906803478465,
- 0.6329879202620043,
- 0.6470476127563018,
- 0.6610854050930054,
- 0.6751008221450018,
- 0.6890933895424978,
- 0.7030626336890764,
- 0.7170080817777256,
- 0.7309292618068418,
- 0.7448257025962048,
- 0.7586969338029265,
- 0.7725424859373684,
- 0.7863618903790339,
- 0.8001546793924288,
- 0.8139203861428916,
- 0.8276585447123951,
- 0.8413686901153157,
- 0.8550503583141716,
- 0.8687030862353283,
- 0.8823264117846721,
- 0.8959198738632506,
- 0.9094830123828785,
- 0.9230153682817109,
- 0.9365164835397799,
- 0.9499859011944972,
- 0.9634231653561207,
- 0.9768278212231842,
- 0.9901994150978919,
- 1.0035374944014728,
- 1.0168416076895004,
- 1.0301113046671708,
- 1.0433461362045446,
- 1.0565456543517484,
- 1.0697094123541355,
- 1.0828369646674074,
- 1.0959278669726933,
- 1.1089816761915896,
- 1.1219979505011553,
- 1.1349762493488669,
- 1.147916133467529,
- 1.1608171648901422,
- 1.1736789069647267,
- 1.186500924369101,
- 1.1992827831256152,
- 1.2120240506158424,
- 1.2247242955952173,
- 1.237383088207635,
- 1.2499999999999998,
- 1.2625746039367247,
- 1.275106474414188,
- 1.287595187275135,
- 1.3000403198230384,
- 1.3124414508364004,
- 1.3247981605830121,
- 1.3371100308341606,
- 1.3493766448787818,
- 1.3615975875375674,
- 1.373772445177015,
- 1.3859008057234283,
- 1.3979822586768669,
- 1.4100163951250357,
- 1.4220028077571292,
- 1.4339410908776151,
- 1.445830840419966,
- 1.4576716539603365,
- 1.4694631307311825,
- 1.4812048716348267,
- 1.4928964792569652,
- 1.5045375578801203,
- 1.5161277134970332,
- 1.527666553823999,
- 1.5391536883141455,
- 1.5505887281706499,
- 1.5619712863599002,
- 1.5733009776245934,
- 1.5845774184967754,
- 1.5958002273108205,
- 1.6069690242163481,
- 1.6180834311910808,
- 1.6291430720536377,
- 1.640147572476268,
- 1.6510965599975191,
- 1.6619896640348442,
- 1.6728265158971454,
- 1.6836067487972506,
- 1.6943299978643305,
- 1.7049959001562462,
- 1.7156040946718338,
- 1.726154222363124,
- 1.736645926147493,
- 1.74707885091975,
- 1.7574526435641542,
- 1.7677669529663687,
- 1.7780214300253427,
- 1.7882157276651283,
- 1.7983495008466277,
- 1.8084224065792696,
- 1.8184341039326215,
- 1.828384254047926,
- 1.8382725201495713,
- 1.8480985675564898,
- 1.8578620636934853,
- 1.8675626781024899,
- 1.8772000824537476,
- 1.8867739505569299,
- 1.8962839583721722,
- 1.9057297840210445,
- 1.9151111077974448,
- 1.924427612178419,
- 1.9336789818349098,
- 1.942864903642427,
- 1.9519850666916478,
- 1.961039162298939,
- 1.9700268840168045,
- 1.9789479276442585,
- 1.9878019912371192,
- 1.9965887751182319,
- 2.005307981887609,
- 2.0139593164324983,
- 2.022542485937368,
- 2.0310571998938225,
- 2.03950317011043,
- 2.0478801107224793,
- 2.0561877382016553,
- 2.064425771365635,
- 2.072593931387604,
- 2.080691941805694,
- 2.0887195285323408,
- 2.09667641986356,
- 2.104562346488143,
- 2.1123770414967753,
- 2.1201202403910644,
- 2.127791681092499,
- 2.1353911039513136,
- 2.1429182517552805,
- 2.1503728697384132,
- 2.1577547055895905,
- 2.1650635094610964]
-[line] = ax.plot(x, y, 'k', linewidth=1, linestyle='dashed')
-
-# line
-x = [0.0, 4.0]
-y = [0.0, 0.0]
-[line] = ax.plot(x, y, 'k', linewidth=1, linestyle='dashed')
-
-# line
-x = [0.0, 2.0000000000000004]
-y = [0.0, 3.4641016151377544]
-[line] = ax.plot(x, y, 'k', linewidth=1, linestyle='dashed')
-ax.text(0.629904, 0.791025, 'radius',
-        horizontalalignment='left', fontsize=14)
-
-# line
-mpl.arrow(x=1, y=1.73205, dx=-1, dy=-1.73205,
-          facecolor='k', edgecolor='k',
-          linestyle='dashed',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=0, y=0, dx=1, dy=1.73205,
-          facecolor='k', edgecolor='k',
-          linestyle='dashed',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-
-# line
-x = [0.0, -1.0352761804100834]
-y = [0.0, 3.8637033051562732]
-[line] = ax.plot(x, y, 'k', linewidth=1, linestyle='dashed')
-ax.text(0.430736, 3.27177, 'arc_angle',
-        horizontalalignment='center', fontsize=14)
-
-# arc
-x = [1.5000000000000004,
- 1.488649511025625,
- 1.477270680310402,
- 1.4658637244908648,
- 1.4544288607390112,
- 1.4429663067581633,
- 1.4314762807788257,
- 1.4199590015545303,
- 1.4084146883576727,
- 1.3968435609753347,
- 1.3852458397051022,
- 1.3736217453508708,
- 1.3619714992186405,
- 1.3502953231123052,
- 1.3385934393294268,
- 1.3268660706570043,
- 1.3151134403672324,
- 1.3033357722132515,
- 1.2915332904248857,
- 1.2797062197043756,
- 1.2678547852220987,
- 1.2559792126122844,
- 1.2440797279687175,
- 1.2321565578404323,
- 1.2202099292274011,
- 1.2082400695762117,
- 1.1962472067757388,
- 1.184231569152802,
- 1.1721933854678217,
- 1.1601328849104626,
- 1.1480502970952695,
- 1.1359458520572991,
- 1.1238197802477365,
- 1.1116723125295092,
- 1.099503680172892,
- 1.0873141148511052,
- 1.075103848635901,
- 1.062873113993148,
- 1.0506221437784022,
- 1.038351171232479,
- 1.0260604299770064,
- 1.0137501540099814,
- 1.0014205777013134,
- 0.9890719357883619,
- 0.9767044633714703,
- 0.9643183959094851,
- 0.9519139692152769,
- 0.9394914194512493,
- 0.9270509831248424,
- 0.9145928970840327,
- 0.9021173985128199,
- 0.8896247249267135,
- 0.8771151141682103,
- 0.8645888044022682,
- 0.8520460341117683,
- 0.8394870420929765,
- 0.8269120674509975,
- 0.814321349595223,
- 0.8017151282347709,
- 0.7890936433739248,
- 0.7764571353075629,
- 0.7638058446165829,
- 0.7511400121633245,
- 0.7384598790869795,
- 0.7257656867990037,
- 0.71305767697852,
- 0.7003360915677164,
- 0.6876011727672428,
- 0.6748531630315955,
- 0.6620923050645039,
- 0.6493188418143094,
- 0.636533016469339,
- 0.6237350724532784,
- 0.6109252534205329,
- 0.5981038032515915,
- 0.585270966048385,
- 0.5724269861296347,
- 0.5595721080262044,
- 0.5467065764764429,
- 0.5338306364215253,
- 0.5209445330007912,
- 0.5080485115470743,
- 0.4951428175820335,
- 0.482227696811479,
- 0.46930339512069275,
- 0.4563701585697504,
- 0.4434282333888323,
- 0.43047786597353854,
- 0.41751930288019706,
- 0.40455279082116924,
- 0.39157857666015516,
- 0.37859690740748986,
- 0.36560803021544247,
- 0.3526121923735131,
- 0.3396096413037205,
- 0.3266006245558942,
- 0.313585389802961,
- 0.30056418483622893,
- 0.28753725756067217,
- 0.2745048559902076,
- 0.2614672282429751,
- 0.24842462253661374,
- 0.235377287183535,
- 0.22232547058619806,
- 0.20926942123237635,
- 0.19620938769042914,
- 0.1831456186045714,
- 0.17007836269013277,
- 0.1570078687288319,
- 0.14393438556403237,
- 0.13085816209600803,
- 0.11777944727720599,
- 0.10469849010750323,
- 0.09161553962946846,
- 0.07853084492362009,
- 0.06544465510368347,
- 0.05235721931185079,
- 0.03926878671403372,
- 0.026179606495121688,
- 0.013089927854240412,
- 1.8369701987210297e-16,
- -0.01308992785423938,
- -0.026179606495121327,
- -0.03926878671403335,
- -0.052357219311849765,
- -0.06544465510368311,
- -0.07853084492361906,
- -0.09161553962946742,
- -0.10469849010750287,
- -0.11777944727720498,
- -0.13085816209600767,
- -0.14393438556403138,
- -0.15700786872883085,
- -0.1700783626901324,
- -0.18314561860457035,
- -0.19620938769042878,
- -0.209269421232376,
- -0.222325470586197,
- -0.23537728718353462,
- -0.24842462253661268,
- -0.261467228242974,
- -0.2745048559902072,
- -0.28753725756067117,
- -0.3005641848362286,
- -0.31358538980296,
- -0.32660062455589317,
- -0.3396096413037201,
- -0.35261219237351205,
- -0.3656080302154421,
- -0.37859690740748875,
- -0.39157857666015417,
- -0.4045527908211689,
- -0.41751930288019606,
- -0.43047786597353743,
- -0.44342823338883197,
- -0.4563701585697494,
- -0.4693033951206924,
- -0.482227696811478,
- -0.4951428175820325,
- -0.5080485115470739,
- -0.5209445330007902,
- -0.5338306364215251,
- -0.5467065764764419,
- -0.5595721080262033,
- -0.5724269861296344,
- -0.5852709660483839,
- -0.5981038032515912,
- -0.6109252534205319,
- -0.6237350724532773,
- -0.6365330164693387,
- -0.6493188418143083,
- -0.6620923050645029,
- -0.674853163031595,
- -0.6876011727672418,
- -0.700336091567716,
- -0.713057676978519,
- -0.7257656867990027,
- -0.7384598790869792,
- -0.7511400121633235,
- -0.7638058446165825,
- -0.7764571353075619]
-y = [2.598076211353316,
- 2.6045964434674262,
- 2.611067087819699,
- 2.6174880212183913,
- 2.623859121418187,
- 2.630180267122523,
- 2.636451337985896,
- 2.6426722146161565,
- 2.6488427785767805,
- 2.6549629123891254,
- 2.661032499534665,
- 2.6670514244572088,
- 2.6730195725651034,
- 2.6789368302334107,
- 2.684803084806075,
- 2.6906182245980648,
- 2.6963821388975013,
- 2.7020947179677637,
- 2.7077558530495818,
- 2.7133654363631035,
- 2.7189233611099493,
- 2.7244295214752436,
- 2.7298838126296294,
- 2.7352861307312653,
- 2.7406363729278027,
- 2.745934437358341,
- 2.751180223155372,
- 2.756373630446695,
- 2.7615145603573206,
- 2.766602915011355,
- 2.77163859753386,
- 2.7766215120526994,
- 2.781551563700362,
- 2.7864286586157725,
- 2.791252703946074,
- 2.7960236078483955,
- 2.8007412794916053,
- 2.805405629058035,
- 2.8100165677451927,
- 2.8145740077674524,
- 2.819077862357725,
- 2.8235280457691116,
- 2.8279244732765347,
- 2.8322670611783525,
- 2.8365557267979504,
- 2.840790388485317,
- 2.844970965618598,
- 2.849097378605631,
- 2.8531695488854605,
- 2.857187398929835,
- 2.8611508522446805,
- 2.86505983337156,
- 2.868914267889106,
- 2.8727140824144435,
- 2.876459204604579,
- 2.8801495631577856,
- 2.8837850878149567,
- 2.887365709360942,
- 2.890891359625869,
- 2.894361971486439,
- 2.8977774788672046,
- 2.901137816741829,
- 2.904442921134323,
- 2.907692729120263,
- 2.9108871788279895,
- 2.9140262094397844,
- 2.9171097611930294,
- 2.9201377753813453,
- 2.9231101943557056,
- 2.926026961525538,
- 2.9288880213598,
- 2.9316933193880366,
- 2.9344428022014166,
- 2.9371364174537513,
- 2.9397741138624887,
- 2.9423558412096913,
- 2.944881550342992,
- 2.9473511931765293,
- 2.9497647226918637,
- 2.9521220929388727,
- 2.954423259036624,
- 2.956668177174233,
- 2.958856804611694,
- 2.9609890996806953,
- 2.9630650217854133,
- 2.965084531403282,
- 2.9670475900857505,
- 2.9689541604590106,
- 2.970804206224711,
- 2.9725976921606465,
- 2.974334584121431,
- 2.976014849039145,
- 2.977638454923966,
- 2.9792053708647788,
- 2.9807155670297623,
- 2.982169014666959,
- 2.9835656861048196,
- 2.9849055547527352,
- 2.9861885951015363,
- 2.9874147827239854,
- 2.988584094275237,
- 2.989696507493284,
- 2.990752001199384,
- 2.991750555298457,
- 2.9926921507794724,
- 2.99357676971581,
- 2.994404395265601,
- 2.995175011672046,
- 2.9958886042637216,
- 2.9965451594548522,
- 2.9971446647455733,
- 2.9976871087221686,
- 2.998172481057287,
- 2.9986007725101387,
- 2.998971974926672,
- 2.9992860812397275,
- 2.999543085469174,
- 2.999742982722021,
- 2.999885769192514,
- 2.9999714421622032,
- 3.0,
- 2.9999714421622032,
- 2.999885769192514,
- 2.999742982722021,
- 2.999543085469174,
- 2.9992860812397275,
- 2.998971974926672,
- 2.998600772510139,
- 2.998172481057287,
- 2.9976871087221686,
- 2.9971446647455733,
- 2.9965451594548522,
- 2.9958886042637216,
- 2.995175011672046,
- 2.994404395265601,
- 2.99357676971581,
- 2.9926921507794724,
- 2.991750555298457,
- 2.990752001199384,
- 2.989696507493284,
- 2.988584094275237,
- 2.9874147827239854,
- 2.9861885951015363,
- 2.9849055547527352,
- 2.98356568610482,
- 2.982169014666959,
- 2.9807155670297623,
- 2.9792053708647788,
- 2.9776384549239663,
- 2.976014849039145,
- 2.9743345841214315,
- 2.9725976921606465,
- 2.9708042062247113,
- 2.9689541604590106,
- 2.9670475900857505,
- 2.9650845314032823,
- 2.9630650217854133,
- 2.960989099680696,
- 2.9588568046116945,
- 2.956668177174233,
- 2.9544232590366244,
- 2.9521220929388727,
- 2.9497647226918637,
- 2.9473511931765293,
- 2.944881550342992,
- 2.9423558412096917,
- 2.9397741138624887,
- 2.9371364174537513,
- 2.934442802201417,
- 2.9316933193880366,
- 2.9288880213598,
- 2.9260269615255385,
- 2.9231101943557056,
- 2.9201377753813453,
- 2.91710976119303,
- 2.9140262094397844,
- 2.9108871788279895,
- 2.907692729120263,
- 2.9044429211343235,
- 2.9011378167418296,
- 2.897777478867205]
-[line] = ax.plot(x, y, 'k', linewidth=1, linestyle='dashed')
-mpl.title("Arc")
-mpl.draw()
-mpl.savefig("tmp_Arc.png", dpi=None)
-mpl.savefig("tmp_Arc.pdf")

+ 0 - 122
doc/pub/tutorial/fig-tut/mpl_code_Axis.py

@@ -1,122 +0,0 @@
-import matplotlib.pyplot as mpl
-import matplotlib.transforms as transforms
-
-mpl.ion()  # for interactive drawing
-fig = mpl.figure()
-
-ax = fig.gca()
-xmin, xmax, ymin, ymax = 0.0, 15.0, -7.0, 8.0
-ax.set_xlim(xmin, xmax)
-ax.set_ylim(ymin, ymax)
-ax.set_aspect('equal')
-
-
-
-# line
-x = [12.240192378864668, 12.5]
-y = [2.150000000000001, 2.0000000000000004]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='solid')
-
-# line
-x = [7.5, 12.5]
-y = [2.0, 2.0000000000000004]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='solid')
-
-# line
-x = [12.240192378864668, 12.5]
-y = [1.8499999999999999, 2.0000000000000004]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='solid')
-ax.text(12.8333, 2, 'x',
-        horizontalalignment='center', fontsize=14)
-
-# line
-x = [7.35, 7.5]
-y = [6.740192378864668, 7.0]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='solid')
-
-# line
-x = [7.5, 7.5]
-y = [2.0, 7.0]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='solid')
-
-# line
-x = [7.65, 7.5]
-y = [6.740192378864668, 7.0]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='solid')
-ax.text(7.5, 7.33333, 'y',
-        horizontalalignment='center', fontsize=14)
-mpl.draw()
-
-# line
-x = [11.034779889691228, 11.33022221559489]
-y = [5.161843595132618, 5.213938048432697]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dashed')
-
-# line
-x = [7.5, 11.33022221559489]
-y = [2.0, 5.213938048432697]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dashed')
-
-# line
-x = [11.22761617259719, 11.33022221559489]
-y = [4.932030262196924, 5.213938048432697]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dashed')
-ax.text(11.5856, 5.4282, 'x',
-        horizontalalignment='center', fontsize=14)
-
-# line
-x = [4.338156404867384, 4.286061951567303]
-y = [5.534779889691228, 5.83022221559489]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dashed')
-
-# line
-x = [7.5, 4.286061951567303]
-y = [2.0, 5.83022221559489]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dashed')
-
-# line
-x = [4.567969737803077, 4.286061951567303]
-y = [5.727616172597189, 5.83022221559489]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dashed')
-ax.text(4.0718, 6.08557, 'y',
-        horizontalalignment='center', fontsize=14)
-mpl.draw()
-
-# line
-x = [6.824595394571309, 6.631759111665348]
-y = [-2.694225432125347, -2.92403876506104]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dotted')
-
-# line
-x = [7.5, 6.631759111665348]
-y = [2.0, -2.92403876506104]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dotted')
-
-# line
-x = [6.5291530686676476, 6.631759111665348]
-y = [-2.642130978825267, -2.92403876506104]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dotted')
-ax.text(6.57388, -3.25231, 'x',
-        horizontalalignment='center', fontsize=14)
-
-# line
-x = [12.194225432125346, 12.424038765061042]
-y = [1.3245953945713098, 1.1317591116653478]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dotted')
-
-# line
-x = [7.5, 12.424038765061042]
-y = [2.0, 1.1317591116653478]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dotted')
-
-# line
-x = [12.142130978825266, 12.424038765061042]
-y = [1.029153068667647, 1.1317591116653478]
-[line] = ax.plot(x, y, 'r', linewidth=2, linestyle='dotted')
-ax.text(12.7523, 1.07388, 'y',
-        horizontalalignment='center', fontsize=14)
-mpl.draw()
-mpl.title("Axis")
-mpl.draw()
-mpl.savefig("tmp_Axis.png", dpi=None)
-mpl.savefig("tmp_Axis.pdf")

+ 0 - 195
doc/pub/tutorial/fig-tut/mpl_code_Dashpot.py

@@ -1,195 +0,0 @@
-import matplotlib.pyplot as mpl
-import matplotlib.transforms as transforms
-
-mpl.ion()  # for interactive drawing
-fig = mpl.figure()
-
-ax = fig.gca()
-xmin, xmax, ymin, ymax = 0.0, 11.0, -2.5, 7.5
-ax.set_xlim(xmin, xmax)
-ax.set_ylim(ymin, ymax)
-ax.set_aspect('equal')
-
-
-
-mpl.grid(True)
-
-# line
-x = [1.5, 1.5]
-y = [0.0, 1.25]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-
-# line
-x = [1.5, 1.5]
-y = [5.0, 2.395833333333333]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-
-# rectangle
-x = [1.0833333333333333,
- 1.9166666666666665,
- 1.9166666666666665,
- 1.0833333333333333,
- 1.0833333333333333]
-y = [2.083333333333333,
- 2.083333333333333,
- 2.395833333333333,
- 2.395833333333333,
- 2.083333333333333]
-[line] = ax.fill(x, y, 'white', edgecolor='b', linewidth=2, hatch='X')
-
-# pot
-x = [1.0, 1.0, 2.0, 2.0]
-y = [3.75, 1.25, 1.25, 3.75]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-ax.text(1.5, 5.5, 'Dashpot (default)',
-        horizontalalignment='center', fontsize=14)
-
-# line
-x = [6.5, 6.5]
-y = [0.0, 2.0]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-
-# line
-x = [6.5, 6.5]
-y = [6.0, 4.5]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-
-# rectangle
-x = [6.083333333333333,
- 6.916666666666666,
- 6.916666666666666,
- 6.083333333333333,
- 6.083333333333333]
-y = [4.1875, 4.1875, 4.5, 4.5, 4.1875]
-[line] = ax.fill(x, y, 'white', edgecolor='b', linewidth=2, hatch='X')
-
-# pot
-x = [6.0, 6.0, 7.0, 7.0]
-y = [4.5, 2.0, 2.0, 4.5]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-ax.text(6.5, -1.56667, 'width',
-        horizontalalignment='center', fontsize=14)
-
-# line
-mpl.arrow(x=6, y=-1.75, dx=1, dy=0,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=7, y=-1.75, dx=-1, dy=0,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.annotate('start', xy=(6.5, 0), xycoords='data',
-            textcoords='data', xytext=(5.75, -0.75),
-            horizontalalignment='center',
-            verticalalignment='top',
-            fontsize=14,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-ax.annotate('bar_length', xy=[ 5.5  1. ], xycoords='data',
-            textcoords='data', xytext=(3.5, 1.5),
-            horizontalalignment='left',
-            verticalalignment='top',
-            fontsize=14,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-
-# line
-mpl.arrow(x=5.5, y=2, dx=0, dy=-2,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=5.5, y=0, dx=0, dy=2,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.annotate('total_length', xy=[ 8.5  3. ], xycoords='data',
-            textcoords='data', xytext=(8.75, 5.0),
-            horizontalalignment='left',
-            verticalalignment='top',
-            fontsize=14,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-
-# line
-mpl.arrow(x=8.5, y=6, dx=0, dy=-6,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=8.5, y=0, dx=0, dy=6,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.annotate('dashpot_length', xy=[ 7.5   3.25], xycoords='data',
-            textcoords='data', xytext=(7.0, -0.5),
-            horizontalalignment='left',
-            verticalalignment='top',
-            fontsize=14,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-
-# line
-mpl.arrow(x=7.5, y=4.5, dx=0, dy=-2.5,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=7.5, y=2, dx=0, dy=2.5,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.annotate('piston_pos', xy=[ 5.5      3.09375], xycoords='data',
-            textcoords='data', xytext=(3.5, 3.6875),
-            horizontalalignment='left',
-            verticalalignment='top',
-            fontsize=14,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-
-# line
-mpl.arrow(x=5.5, y=4.1875, dx=0, dy=-2.1875,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=5.5, y=2, dx=0, dy=2.1875,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.title("Dashpot")
-mpl.draw()
-mpl.savefig("tmp_Dashpot.png", dpi=None)
-mpl.savefig("tmp_Dashpot.pdf")

+ 0 - 149
doc/pub/tutorial/fig-tut/mpl_code_Distance_wText.py

@@ -1,149 +0,0 @@
-import matplotlib.pyplot as mpl
-import matplotlib.transforms as transforms
-
-mpl.ion()  # for interactive drawing
-fig = mpl.figure()
-
-ax = fig.gca()
-xmin, xmax, ymin, ymax = 0.0, 10.0, 0.0, 6.0
-ax.set_xlim(xmin, xmax)
-ax.set_ylim(ymin, ymax)
-ax.set_aspect('equal')
-
-
-ax.text(1.13014, 3.14588, '$ 2\\pi R^2 $',
-        horizontalalignment='left', fontsize=14)
-
-# line
-mpl.arrow(x=2, y=4.5, dx=-2, dy=-2.5,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=0, y=2, dx=2, dy=2.5,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(6, 5.16667, '$ 2\\pi R^2 $',
-        horizontalalignment='center', fontsize=14)
-
-# line
-mpl.arrow(x=4, y=5, dx=4, dy=0,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=8, y=5, dx=-4, dy=0,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(1.07454, 5.14907, '$ 2\\pi R^2 $',
-        horizontalalignment='center', fontsize=14)
-
-# line
-mpl.arrow(x=0, y=5.5, dx=2, dy=-1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=2, y=4.5, dx=-2, dy=1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(1.11785, 1.11785, '$ 2\\pi R^2 $',
-        horizontalalignment='left', fontsize=14)
-
-# line
-mpl.arrow(x=0, y=2, dx=2, dy=-2,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=2, y=0, dx=-2, dy=2,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(8.8882, 1.27639, '$ 2\\pi R^2 $',
-        horizontalalignment='right', fontsize=14)
-
-# line
-mpl.arrow(x=8, y=2, dx=2, dy=-1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=10, y=1, dx=-2, dy=1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(8.92546, 3.35093, '$ 2\\pi R^2 $',
-        horizontalalignment='center', fontsize=14)
-
-# line
-mpl.arrow(x=8, y=4, dx=2, dy=-1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=10, y=3, dx=-2, dy=1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.text(4.16667, 4.5, '$ 2\\pi R^2 $',
-        horizontalalignment='left', fontsize=14)
-
-# line
-mpl.arrow(x=4, y=5, dx=0, dy=-1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=4, y=4, dx=0, dy=1,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.annotate('text_spacing=-1./40, alignment="right"', xy=(9, 1.2), xycoords='data',
-            textcoords='data', xytext=(4, 0.5),
-            horizontalalignment='left',
-            verticalalignment='top',
-            fontsize=10,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-ax.annotate('text_spacing=-1./60', xy=(9, 3.2), xycoords='data',
-            textcoords='data', xytext=(4, 3.5),
-            horizontalalignment='left',
-            verticalalignment='top',
-            fontsize=10,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-mpl.title("Distance_wText and text positioning")
-mpl.draw()
-mpl.savefig("tmp_Distance_wText.png", dpi=None)
-mpl.savefig("tmp_Distance_wText.pdf")

+ 0 - 66
doc/pub/tutorial/fig-tut/mpl_code_Rectangle.py

@@ -1,66 +0,0 @@
-import matplotlib.pyplot as mpl
-import matplotlib.transforms as transforms
-
-mpl.ion()  # for interactive drawing
-fig = mpl.figure()
-
-ax = fig.gca()
-xmin, xmax, ymin, ymax = 0.0, 8.0, -1.5, 6.0
-ax.set_xlim(xmin, xmax)
-ax.set_ylim(ymin, ymax)
-ax.set_aspect('equal')
-
-
-
-mpl.grid(True)
-
-# rectangle
-x = [2.0, 6.0, 6.0, 2.0, 2.0]
-y = [0.0, 0.0, 3.0, 3.0, 0.0]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-ax.text(4, -0.466667, 'width',
-        horizontalalignment='center', fontsize=14)
-
-# line
-mpl.arrow(x=2, y=-0.6, dx=4, dy=0,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=6, y=-0.6, dx=-4, dy=0,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-ax.annotate('lower_left_corner', xy=[ 2.  0.], xycoords='data',
-            textcoords='data', xytext=[ 1.2 -0.6],
-            horizontalalignment='center',
-            verticalalignment='top',
-            fontsize=14,
-            arrowprops=dict(arrowstyle='->',
-                            facecolor='black',
-                            linewidth=2,
-                            shrinkA=5,
-                            shrinkB=5))
-ax.text(6.93333, 1.5, 'height',
-        horizontalalignment='left', fontsize=14)
-
-# line
-mpl.arrow(x=6.8, y=3, dx=0, dy=-3,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.arrow(x=6.8, y=0, dx=0, dy=3,
-          facecolor='k', edgecolor='k',
-          linestyle='solid',
-          linewidth=1, head_width=0.1,
-          length_includes_head=True,
-          shape='full')
-mpl.title("Rectangle")
-mpl.draw()
-mpl.savefig("tmp_Rectangle.png", dpi=None)
-mpl.savefig("tmp_Rectangle.pdf")

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 2219
doc/pub/tutorial/fig-tut/mpl_code_Spring.py


+ 0 - 30
doc/pub/tutorial/fig-tut/mpl_code_Triangle.py

@@ -1,30 +0,0 @@
-import matplotlib.pyplot as mpl
-import matplotlib.transforms as transforms
-
-mpl.ion()  # for interactive drawing
-fig = mpl.figure()
-
-ax = fig.gca()
-xmin, xmax, ymin, ymax = 0.0, 8.0, -1.5, 3.6
-ax.set_xlim(xmin, xmax)
-ax.set_ylim(ymin, ymax)
-ax.set_aspect('equal')
-
-
-
-mpl.grid(True)
-
-# triangle
-x = [2.0, 6.0, 3.2, 2.0]
-y = [0.0, 2.0, 3.0, 0.0]
-[line] = ax.plot(x, y, 'b', linewidth=2, linestyle='solid')
-ax.text(6, 2, 'p2',
-        horizontalalignment='center', fontsize=14)
-ax.text(3.2, 3, 'p3',
-        horizontalalignment='center', fontsize=14)
-ax.text(2, 0, 'p1',
-        horizontalalignment='center', fontsize=14)
-mpl.title("Triangle")
-mpl.draw()
-mpl.savefig("tmp_Triangle.png", dpi=None)
-mpl.savefig("tmp_Triangle.pdf")

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 4025
doc/pub/tutorial/fig-tut/mpl_code_Wavy.py


BIN
doc/pub/tutorial/fig-tut/pendulum.png


BIN
doc/pub/tutorial/fig-tut/pendulum1.pdf


BIN
doc/pub/tutorial/fig-tut/pendulum1.png


BIN
doc/pub/tutorial/fig-tut/pendulum1_wgrid.pdf


BIN
doc/pub/tutorial/fig-tut/pendulum1_wgrid.png


BIN
doc/pub/tutorial/fig-tut/pendulum5.pdf


BIN
doc/pub/tutorial/fig-tut/pendulum5.png


BIN
doc/pub/tutorial/fig-tut/pendulum5_wgrid.pdf


BIN
doc/pub/tutorial/fig-tut/pendulum5_wgrid.png


BIN
doc/pub/tutorial/fig-tut/vehicle0.pdf


BIN
doc/pub/tutorial/fig-tut/vehicle0.png


BIN
doc/pub/tutorial/fig-tut/vehicle0_dim.pdf


BIN
doc/pub/tutorial/fig-tut/vehicle0_dim.png


BIN
doc/pub/tutorial/fig-tut/vehicle0_hier1.pdf


BIN
doc/pub/tutorial/fig-tut/vehicle0_hier1.png


BIN
doc/pub/tutorial/fig-tut/vehicle0a.png


BIN
doc/pub/tutorial/fig-tut/vehicle0a_c.png


BIN
doc/pub/tutorial/fig-tut/vehicle0b.png


BIN
doc/pub/tutorial/fig-tut/vehicle0b_c.png


+ 0 - 0
doc/pub/tutorial/fig-tut/vehicle1.pdf


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است