@physletName|Animator @code|animator4.Animator.class @archive|Animator4_.jar,STools4.jar @appletSize|400|300 @scriptHeader|setAutoRefresh(false); @scriptFooter|setAutoRefresh(true); @embedParam|b|ShowControls|false|show controls: @embedParam|i|FPS|10|animation frames per second: @embedParam|d|Dt|0.02|time step per frame: @embedParam|i|PixPerUnit|10|pixels per unit: @embedParam|d|GridUnit|1.0|on-screen grid unit: addObject|shp #FF707D >>> tt >>> Objects can either be moved arbitrarily along a trajectory or they can represent a point of mass in a dynamic simulation. Use their generated names "shp.." to change their properties, to move them or to make them interact with each other
>>> tt >>> Add object s|type|circle;rectangle;shell;box|shape: $ .|d|x|1.0|x: .|d|y|0.0|y: .|i|w||width: .|i|h||heigth: .|i|r||radius: addObject|img #FF707D >>> tt >>> Displays an image (gif/jpg/png) with upper left corner at (x,y),
The path to the image file must specify in respect to the directory of the applets jar-archives (e.g. "classes")
For instance, if there's a directory "images" in directory "classes" the path should read "images/xy.gif".
If these two directories were on the same level, it should rather be: "../images/xy.gif"
".." always addresses the parent directory
Safest is storing the image in the same directory as the jar-archives, so it is simply referred as "xy.gif"
>>> tt >>>
Add image
s|name|image|HIDDEN
$
.|d|x|3.0|At position x:
.|d|y|0.5|y:
.|s|file|smile.gif|display image:
setTrajectory|
#FFDA92
>>> tt >>>
Force an object to move along an analytic trajectory, x(t) and y(t).
Start the animation (clock t) with "forward", see below
>>> tt >>>
Trajectory
o|id||object:
s|xStr||x(t):
s|yStr||y(t):
setForce|
#FFDA92
>>> tt >>>
Make an object dynamic, so that it will obey Newton's second law.
Set their initial position, velocity and an external force.
(The initial position may change the object's current position.)
This command is also necessary for every object that interacts with others, see Interaction. In this case you can leave the external force to be zero.
Start the animation (clock t) with "forward", see below
>>> tt >>>
Make dynamic
o|id||object:
s|xStr|0|fxStr:
s|yStr|0|fyStr:
d|x|0.0|x:
d|y|0.0|y:
d|vx|0.0|vx:
d|vy|0.0|vy:
addInteraction|
#FFDA92
>>> tt >>>
Create an interaction force between two dynamic objects.
NOTE: You need to make both objects dynamic first.
The interaction is a function: f(t,x,y,r), that uses relative coordinates.
That is, x is the x separation between the objects. Etc.
The mode determines if the force acts along x, y, or r.
>>> tt >>>
Interaction
o|id1||object 1:
o|id2||object 2:
s|force|1/r/r|force:
s|mode|r;x;y|mode:
setMass|
#C5F928
>>> tt >>>
Set the mass of a dynamic object.
>>> tt >>>
Set mass
o|id||object:
d|m|1|mass:
setSticky|
#FFFF99
>>> tt >>>
Make an object sticky. A collision between two sticky objects will stop a calculation.
>>> tt >>>
Make sticky
o|id||object:
b|isSticky|true|is sticky:
setVisibility|
#FFFF99
>>> tt >>>
Makes an object visible or invisible. The object is not destroyed; it is hidden and can be made visible at any time.
>>> tt >>>
Visibility
o|id||object:
b|show|false|is visible:
setRGB|
#FFFF99
>>> tt >>>
Set the color of an object using a mixture of red (r), green (g), and blue (b). Primary colors are in the range 0...255.
>>> tt >>>
Color
o|id||object:
i|r|128|r:
i|g|0|g:
i|b|0|b:
setTrail|
#FFFF99
>>> tt >>>
Draw a trail of points as an object moves. (See also footprints and ghosts.)
>>> tt >>>
Trail
o|id||object:
i|pts|300|number of points in trail:
setFootPrints|
#FFFF99
>>> tt >>>
Draw a mark on the screen every n trail markings as the test charge moves. The trail must be set first.)
>>> tt >>>
Footprints
o|id||object:
i|n|3|n:
setGhost|
#FFFF99
>>> tt >>>
Draw a pale copy on the screen at every footprint. (See footprints.)
>>> tt >>>
Ghosts
o|id||object:
b|ghost|true|ghost:
forward|
#FFFFFF
>>> tt >>>
Start the animation.
>>> tt >>>
forward
stop|
#FFFFFF
>>> tt >>>
n/a
>>> tt >>>
stop
@physletName|DataGraph
@code|dataGraph.DataGraph.class
@archive|DataGraph4_.jar,STools4.jar
@appletSize|400|200
@scriptHeader|setAutoRefresh(false);
@scriptFooter|setAutoRefresh(true);
@embedParam|b|ShowControls|false|show controls:
@embedParam|b|AutoScaleX|false|AutoScaleX:
@embedParam|b|AutoScaleY|false|AutoScaleY:
getGraphID|graph
#FF707D
>>> tt >>>
This command gives you a handle (ID) for the graph in this applet in a variable called "graph.."
>>> tt >>>
Get graph
addObject|id
#FFDA92
>>> tt >>>
Add a graph of an analytic function.
f - String of the function. Usually f(x) or f(x,t).
var - String the independent variable
Functions can be explicit functions of time. The function will animate if the clock is running.
xmin - minimum value for the independent variable
xmax - maximum value for the independent variable
A function will use the graph's current xmin and xmax values if the following are not specified.
n - int the number of evaluation points
>>> tt >>>
function
s|name|function|HIDDEN
$
.|s|f|0.3|function:
.|s|var|x|independent var:
.|d|xmin||
xmin:
.|d|xmax||xmax:
.|i|n|100|points:
setRGB|
#FFDA92
>>> tt >>>
Set the color of the object.
>>> tt >>>
color
o|id||id:
i|r|1|r:
i|g|1|g:
i|b|1|b:
setMinMaxX|
#FFFF99
>>> tt >>>
Set the x axis minimum and maximum values. No effect if AutoscaleX is true.
>>> tt >>>
x range
d|xmin|-10|xmin:
d|xmax|10|xmax:
setMinMaxY|
#FFFF99
>>> tt >>>
Set the y axis minimum and maximum values. No effect if autoscale is true.
>>> tt >>>
y range
d|ymin|-10|ymin:
d|ymax|10|ymax:
setAutoscaleX|
#FFFF99
>>> tt >>>
Default: X axis extends automatically when values get out of range.
Set AutoscaleY to false to fix the initial range limits.
>>> tt >>>
Autoscale x
b|autoOn|true|Autoscale on:
setAutoscaleY|
#FFFF99
>>> tt >>>
Default: Y axis extends automatically when values get out of range.
Set AutoscaleY to false to fix the initial range limits.
>>> tt >>>
Autoscale y
b|autoOn|true|Autoscale on:
clearAllSeries|
#CCFFCC
>>> tt >>>
Clear all data from the graph.
>>> tt >>>
clear
setSeriesRGB|
#CCFFCC
>>> tt >>>
Set the series line and marker color.
>>> tt >>>
series color
i|id|1|series number:
i|r|1|r:
i|g|1|g:
i|b|1|b:
setSeriesStyle|
#CCFFCC
>>> tt >>>
Set the series style.
points can be connected or not.
marker: 0 for no marker, 1 for crosses, 2 for squares (default), 3 for circles
>>> tt >>>
series style
i|id|1|series number:
b|conPts|true|connect points:
i|m|1|marker:
setAutoReplaceData|
#CCFFCC
>>> tt >>>
Disables the clearSeries function so that new data will replace a dataset when the addData method is called.
>>> tt >>>
AutoReplaceData
i|id|1|series number:
b|auto|true|auto:
setTitle|
#B3EFFF
>>> tt >>>
Set title.
>>> tt >>>
Title
s|title||text:
setLabelX|
#B3EFFF
>>> tt >>>
Set label of x axis.
>>> tt >>>
x label
s|xlabel||text:
setLabelY|
#B3EFFF
>>> tt >>>
Set label of y axis.
>>> tt >>>
Y label
s|ylabel||text:
setShowAxes|
#B3EFFF
>>> tt >>>
Show or hide the the X and Y axes on the graph.
>>> tt >>>
show axes
b|show|true|show:
setStripChart|
#B3EFFF
>>> tt >>>
Set strip chart mode (moving window of a given width) paced by the specified series.
>>> tt >>>
setStripChart
i|sid|1|series:
i|numPts|10|width (data points):
b|stripChart|true|enabled:
setAutoRefresh|
#E9D3FF
>>> tt >>>
Set the autoRefresh property. Automatic repaint if true.
>>> tt >>>
AutoRefresh
b|auto|true|Automatic repaint: