emwave4
Class EMWave

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byedu.davidson.tools.SApplet
                      extended byemwave4.EMWave
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, edu.davidson.tools.SStepable

public class EMWave
extends SApplet
implements edu.davidson.tools.SStepable

Class EMWave

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.davidson.tools.SApplet
destroyed
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 void createAxes(double x, double y, double z, double s)
          Creates axes at (x,y,z) with length s.
 void 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.
 void 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.
 void createFilledSquare(double z, double s)
          Creates a filled square at {0,0,z}with a side length s.
 void createLinear(double z1, double z2, double a, double ph, double p)
          Creates a linearly polarized wave extending from z1 to z2 with amplitude a, phase ph, and polarization pol.
 void createParsed(java.lang.String s, double z1, double z2, double p)
          Creates a wave function with an amplitdue envelope defined by a function extending from z1 to z2 with polarization pol.
 void createPlane(double z1, double length, double width, double p)
          Creates a plane composed of lines at {0,0,z}with length l, width w, and polarization pol.
 void createSquare(double z, double s)
          Creates an outlined square at {0,0,z} with a side length s.
 void deleteAll()
          Deletes all objects from the screen.
 void forward()
          Starts the animation.
 void pause()
          Pauses the animation.
 void setOrientation(double t, double a, double p)
          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).
 void setOrigin(int x, int y)
          Translates the origin from the current origin to {x,y}.
 void setPixPerUnit(int ppu)
          Sets the scale.
 void setPlaneLineDensity(int d)
          Sets the line density of the all Plane figures to d.
 void setRGB(int r, int g, int b)
          Sets the color to {r,g,b} in which all subsequent figures are drawn in.
 void setWavelength(double l)
          Sets the wavelength of all waves to w.
 void setWaveLineDensity(int d)
          Sets the line density of all waves to d.
 void step(double dt, double time)
          Step to the next animation frame.
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, checkAppletNames, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, formatValue, getAppletName, getClockID, getClockTime, getDataFromDS, getDataListener, getDataSource, getDataSource, getDebugLevel, getID, getSourceData, getSourceVariables, isClockRunning, isValidFunction, makeDataConnection, removeDataListener, removeDataSource, reset, reverse, sendDataToListener, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setConnectionWindowX, setConnectionWindowY, setDebugLevel, setDefault, setDt, setExternalClock, setFPS, setIndependentClock, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stop, stopClock, updateDataConnection, updateDataConnections
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

forward

public void forward()
Starts the animation.

Overrides:
forward in class SApplet

pause

public void pause()
Pauses the animation.

Overrides:
pause in class SApplet

step

public void step(double dt,
                 double time)
Step to the next animation frame.

Specified by:
step in interface edu.davidson.tools.SStepable
Parameters:
dt - the time step
time - the current time.

setOrientation

public void setOrientation(double t,
                           double a,
                           double p)
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). 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..

Parameters:
t -
a -
p -

setOrigin

public void setOrigin(int x,
                      int y)
Translates the origin from the current origin to {x,y}. The default origin is the center of the window. The origin, x and y, is in pixels.

Parameters:
x -
y -

setWaveLineDensity

public void setWaveLineDensity(int d)
Sets the line density of all waves to d. 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.

Parameters:
d -

setPlaneLineDensity

public void setPlaneLineDensity(int d)
Sets the line density of the all Plane figures to d. 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.

Parameters:
d -

setPixPerUnit

public void setPixPerUnit(int ppu)
Sets the scale.

Parameters:
ppu -

setWavelength

public void setWavelength(double l)
Sets the wavelength of all waves to w. The wavelength is in units. The default is 20.

Parameters:
l -

setRGB

public void setRGB(int r,
                   int g,
                   int b)
Sets the color to {r,g,b} in which all subsequent figures are drawn in. The color is specified by red (r), green (g), and blue (b) components in the range of 0-255.

Parameters:
r -
g -
b -

createAxes

public void createAxes(double x,
                       double y,
                       double z,
                       double s)
Creates axes at (x,y,z) with length s.

Parameters:
x -
y -
z -
s -

createSquare

public void createSquare(double z,
                         double s)
Creates an outlined square at {0,0,z} with a side length s. Position and length are in world units which have a default value of 10 pixels per 1 unit.

Parameters:
z -
s -

createFilledSquare

public void createFilledSquare(double z,
                               double s)
Creates a filled square at {0,0,z}with a side length s. Position and length are in units which has a default value of 10 pixels per 1 unit.

Parameters:
z -
s -

createLinear

public void createLinear(double z1,
                         double z2,
                         double a,
                         double ph,
                         double p)
Creates a linearly polarized wave extending from z1 to z2 with amplitude a, phase ph, and polarization pol. 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
Parameters:
z1 -
z2 -
a -
ph - the phase angle
p - the polarizaiton

createCircularRight

public void 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. 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
Parameters:
z1 -
z2 -
a -
ph -

createCircularLeft

public void 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. 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
Parameters:
z1 -
z2 -
a -
ph -

createPlane

public void createPlane(double z1,
                        double length,
                        double width,
                        double p)
Creates a plane composed of lines at {0,0,z}with length l, width w, and polarization pol. Position and length are in world units which has a default value of 10 pixels per 1 unit.

Parameters:
z1 -
length -
width -
p -

createParsed

public void createParsed(java.lang.String s,
                         double z1,
                         double z2,
                         double p)
Creates a wave function with an amplitdue envelope defined by a function extending from z1 to z2 with polarization pol. The function must be a function of z. The figure propagates in the positive z direction, so z1 must be less than z2. That is, z1
Parameters:
s - the amplitude function
z1 -
z2 -
p -

deleteAll

public void deleteAll()
Deletes all objects from the screen.



Visit the Davidson College Physlet Site for additional information.