|
@@ -305,7 +305,7 @@ You can try this by running the present example in the file
|
|
|
# #ifdef PRIMER_BOOK
|
|
# #ifdef PRIMER_BOOK
|
|
|
`vehicle0.py`.
|
|
`vehicle0.py`.
|
|
|
# #else
|
|
# #else
|
|
|
-"`vehicle0.py`": "http://hplgit.github.com/pysketcher/doc/src/sketcher/sketcher.do.txt".
|
|
|
|
|
|
|
+"`vehicle0.py`": "http://hplgit.github.com/pysketcher/doc/src/sketcher/src-sketcher/vehicle0.py", or view a ready-made "movie": "http://hplgit.github.com/pysketcher/doc/src/sketcher/src-sketcher/vehicle0_animation/anim.html".
|
|
|
# #endif
|
|
# #endif
|
|
|
|
|
|
|
|
=== Animation: Rolling the Wheels ===
|
|
=== Animation: Rolling the Wheels ===
|
|
@@ -370,8 +370,12 @@ def move_vehicle(t, fig):
|
|
|
w2 = fig['vehicle']['wheels']['wheel2']
|
|
w2 = fig['vehicle']['wheels']['wheel2']
|
|
|
w2.rotate(degrees(angle), center=(wheel1_center+4, R))
|
|
w2.rotate(degrees(angle), center=(wheel1_center+4, R))
|
|
|
!ec
|
|
!ec
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+The complete example is found in the file
|
|
|
|
|
+# #ifdef PRIMER_BOOK
|
|
|
|
|
+`vehicle1.py`.
|
|
|
|
|
+# #else
|
|
|
|
|
+"`vehicle1.py`": "http://hplgit.github.com/pysketcher/doc/src/sketcher/src-sketcher/vehicle0.py". You may run this file or watch a "ready-made movie": "http://hplgit.github.com/pysketcher/doc/src/sketcher/src-sketcher/vehicle0_animation/anim.html".
|
|
|
|
|
+# #endif
|
|
|
|
|
|
|
|
The great advantage with making figures this way through programming,
|
|
The great advantage with making figures this way through programming,
|
|
|
rather than using interactive drawing programs, is that the
|
|
rather than using interactive drawing programs, is that the
|
|
@@ -380,7 +384,11 @@ can be parameterized through variables such that the
|
|
|
proportions of parts of the figure can be quickly changed,
|
|
proportions of parts of the figure can be quickly changed,
|
|
|
groups of objects can easily be manipulated (translated, rotated,
|
|
groups of objects can easily be manipulated (translated, rotated,
|
|
|
scaled), objects can be left out while experimenting with the
|
|
scaled), objects can be left out while experimenting with the
|
|
|
-figure, to mention some important features.
|
|
|
|
|
|
|
+figure, to mention some important features. However, the single
|
|
|
|
|
+most important feature is the ability to make animations governed
|
|
|
|
|
+by mathematical formulas, maybe coming from simulations
|
|
|
|
|
+based on solving differential equations reflecting the physics
|
|
|
|
|
+of the problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|