|
Ripple allows the creation of ripple tank sources as well as geometric shapes such as circles and rectangles using the addObject method.
addObject(String name, String attributes)
Objects usually, but not always, have an on-screen representation.
The first argument is the name of the object to be added, and the second is a comma-delimited
list of parameters. A circle can now be added to either applet using the following
JavaScript statement:
document.physletname.addObject("circle", "x=0,y=-1.0,r=10");.
The addObject method is very forgiving since not all parameters need to be specified. Default values are overridden only if the parameter appears in the list. Incorrect and unsupported parameters do not affect the applet and are ignored.
The table below lists the name and the associated parameters for version 4 of the Ripple Physlet. Consult the online documentation for information about other Physlets. OpticsBench, for example, supports the addObject method for lenses, mirrors, and light sources.
Name | Attributes |
arrow Arrows are often animation slaves of other objects. They can represent almost any vector since the h and v components can be functions of the variables. |
x- double position
of the base in world units |
box A hollow rectangle.
|
x- double position
of the base in world units |
caption Text. |
x- double position
of the base in world units |
constraint A constraint on dragged objects.
|
xmin- double minimum
x |
circle A filled circle. |
x- double position
of the base in world units |
cursor A circle with crosshairs |
x- double position
of the base in world units |
image A gif image. |
x- double position
of the base in world units |
protractor a protractor for measuring angles |
x- double x position of the vertex in world units |
rectangle A filled rectangle. |
x- double position
of the base in world units |
shell A hollow circle. |
x- double position
of the base in world units |
source A wave source. |
x- double position
of the base in world units |
text A text message with an optional calculation. |
x- double position
of the base in world units |