|
OpticsApplet supports the addObject method
with the following signature
addObject(String name, String attributes)
The first argument is the name of the object to be added, and the second is a comma-delimited
list of parameters. A lens can be added using the following JavaScript statement:
id=document.physletname.addObject("lens", "x=1,f=-2");.
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.
Name |
Attributes |
aperture |
x- double x position
of the center in world units |
b |
x- double x position
of the center in world units |
bench |
No attributes. Use this parameter to determine the drawing order for the optic elements relative to the geometric objects. |
box A hollow rectangle. |
x- double x position
of the center in world units |
circle |
x- double x position
of the center in world units |
constraint |
xmin- double The minimum
x value. A constraint, by itself, will have no effect. It must be attached to a dragable object using the setConstriant method. |
dielectric |
x- double x position
of the center in world units. Models and change in index of refraction using Snell's law. Aberrations are observed. See also refraction. |
image |
x- double x position
of the center in world units OpticsApplet will search for
images in the code-base directory. This is the directory containing the jar files. |
lens |
x- double x position
of the center in world units. |
m |
x- double x position
in world units. |
mirror |
x- double x position
of the center in world units. |
protractor a protractor for measuring angles |
x- double x position of the vertex in world units |
rectangle |
x- double x position
of the center in world units |
refraction |
x- double x position
of the center in world units. Models and change in index
of refraction using the small angle approximation. |
screen |
x- double x position of the center in world units |
shell |
x- double x position
of the center in world units |
source |
x- double x
position of the center in world units. |
text A fixed text string followed by an optional calculation. |
x- double x position
of the left side of the text in world units Text objects are often slaved
to other objects. If a text object is slaved to a wire, it takes on
the properties of that wire and can evaluate a function of t, x, y, flux,
and v. |