3D Wave Physlet
|
|
Click-drag to the right or left to rotate about the z axis. Click-drag up or down to
rotate in the xy plane.
Requres Java 1.1 browser such as IE 4.01 or Communicator 4.05 with Java patch from Sun. |
Documentation
Embedding
- <APPLET code="EMWave.class" width=600 height=500>
- <PARAM NAME = "showControls" VALUE = "false">
- <PARAM NAME = "animate" VALUE = "true">
<PARAM NAME = "orientation" VALUE = "0">
<PARAM NAME = "framesPerSec" VALUE = "10">
<PARAM NAME = "translation" VALUE = "2">
- </APPLET>
- showControls
- is a true/false boolean that reveals or conceals the display of a control panel containing
three sliders which rotate the figures in three dimensions.
- animate
- is a true/false boolean that species the display of an animated wave or a static wave.
- orientation
- is a an integer of either 0 or 1. A value of 0 orients the z-axis vertically with propagation
proceeding upwards. Rotation then occurs about the z-axis for side-to-side drags and about the
line of nodes for up and down drags.
- framesPerSec
- is an integer value which specifies how fast the applet animates--or rather, how man times a
second the figures are redrawn.
- translation
- is a double value which specifies the distance (in units) the waves are translated for every
animation--that is, every redrawing of the screen.
JavaScript
The follow public methods can be called from within an HTML page using JavScript.
createAxes(double x, double y, double z, double s )
Creates a set of axes at {x,y,z} with lengths s.
Notes: Position and lengths are in units which has a default value of 10 pixels per
1 unit
createCircularLeft(double z1, double z2, double a,
double ph)
Creates a clockwise rotating circular wave
extending from z1 to z2, with amplitude a, and phase ph.
Notes
- Position and amplitude are in units which has a default value of 10 pixels per 1
unit.
- The wave propagates in the positive z direction, so z1 must be less than z2.
That is, z1<z2.
- The phase, ph, is in radians.
createCircularRight(double z1, double z2,double a,
double ph)
- Creates a counterclockwise rotating circular
wave extending from z1 to z2, with amplitude a and phase ph.
- Notes:
- Position and amplitude are in units which has a default value of 10 pixels per 1
unit.
- The wave propagates in the positive z direction, so z1 must be less than z2.
That is, z1<z2.
- The phase, ph, is in radians.
createFilledSquare(double z, double s)
- Creates a filled square at {0,0,z}with a
side length s.
- Notes: Position and length are in units which has a default value of 10 pixels
per 1 unit.
createLinear(double z1, double z2, double a, double
ph, double pol)
- Creates a linear wave extending from z1 to
z2 with amplitude a, phase ph, and polarization pol.
Notes:
- Position and amplitude are in units which has a default value of 10 pixels per 1
unit.
- The wave propagates in the positive z direction, so z1 must be less than z2.
That is, z1<z2.
- The phase, ph, and polarization, pol, are in radians.
createParsedWave(String func, double z1, double z2,
double pol)
- Creates a wave or function defined by func
extending from z1 to z2 with polarization pol.
- Notes:
- func must be a function of z.
- The figure propagates in the positive z direction, so z1 must be less
than z2. That is, z1<z2.
- The polarization, pol, is in radians.
createPlane(double z, double l, double w, double pol)
- Creates a plane composed of lines at
{0,0,z}with length l, width w, and polarization pol.
- Notes: Position and length are in units
which has a default value of 10 pixels per 1 unit.
createSquare(double z, double s)
- Creates an outlined square at {0,0,z} with a
side length s.
- Notes: Position and length are in units
which has a default value of 10 pixels per 1 unit.
setOrientation(double theta, double alpha,
double phi)
- Rotates the figures an amount theta in the x-y plane (z-axis rotation), alpha in the x-z
plane (y-axis rotation), and theta in the y-z plane (x-axis rotation).
Notes:
- Angles are in radians.
- When all three angles are zero the positive x-axis points horizontally to the right, the
positive y-axis points vertically upwards, and the positive z-axis points out of the
screen..
setOrigin(int x, int y)
- Translates the origin from the current
origin to {x,y}. The default origin is the center of the window
- Notes: The origin, x and y, is in pixels.
setPlaneLineDensity(int d)
- Sets the line density of the Plane figure to
d.
Notes:The line density is how many pixels
there are per line--that is, how many pixels the lines are separated by. The default is 2.
-
setPixPerUnit(int ppu)
- Sets the number of pixels contained in one
unit to ppu. All figures are described in units--amplitude, extent, height, width,
etc.
- Notes:The default is 10 pixels per 1 unit.
setRGB(int r, int g, int b)
- Sets the color to {r,g,b} in which all
subsequent figures are drawn in.
Notes:The color is specified by red (r),
green (g), and blue (b) components in the range of 0-255.
setWavelength(double w)
- Sets the wavelength of all waves to w.
- Notes: The wavelength is in units. The
default is 20.
setWaveLineDensity(double d)
Sets the line density of all waves to d.
Notes: The line density is how many pixels there
are per line--that is, how many pixels the lines are separated by. The default is 2.
deleteAll()
Deletes all figures.