OpticsBenchApplet will appear below in a Java enabled browser.
SEE THE JAVA DOCUMENTATION MADE BY JAVADOC:
Public Methods Accesible via JavaScript:
IN PIX_PER_UNIT VALUES: adds elements at relative positions determined by pixPerUnit.
public void addAperature(double x,double openingSize){}
//adds an aperature to the screen with position x and opening size centered about the middle line of total width openingSizepublic void addDielectric(double x, double n1, double n2, double r){}
//adds an index of refraction interface at position x and radius of curvature r. n1 and n2 are indices of refraction on either side of dielectric. For r = 0, the dielectric behaves as though it has r = infinity (a flat interface). Will not show internal reflection or aberation.public void addIndexChange(double x, double delN){}
//adds a flat index change of delN with a radius of curvature of infinity. Accounts for internal reflection, Snell's law.public void addISource(double x, double y, int size, double angle){}
//adds an infinite source (parallel rays), with position x and y. Size is height of beam and angle is the slope of the rays. Positive y's are above the center horizontal axis. Negative y's are below the center axis.public void addLens(double x, double fl){}
//adds a lens with position x and focal length fl.public void addMirror(double x, double fl){}
//adds a mirror with position x and focal length fl. Radius of curvature is related to focal length.public void addPSource(double x, double y){}
//adds a principle-ray source at position x and y. Three rays, one parallel, one through center, and one through focal point. Positive y's are above the center horizontal axis. Negative y's are below the center axis.public void addRefraction(double x, double delN, double r){}
//adds an index change of delN with a radius of curvature of r. This is a second order aproximation that accounts for internal reflection, Snell's law, and spherical aberation.public void addScreen(double x){}
//adds a screen at position x. Screens draw dots where rays intercept.public void addSource(double x, double y,double rayIncrement,double raySlope){}
//adds a point source with position x and y. rayIncrement is the different in slope of each of the rays. raySlope is the slope of the top most ray. The smaller the rayIncrement is the more rays will be drawn. The larger the raySlope is the wider the spread of the rays will be. Positive y's are above the center horizontal axis. Negative y's are below the center axis.
IN EXACT PIXEL VALUES: adds elements at exact pixel coordinates. Overrides pixPerUnit settings. Only difference is 'P' in method name and integer versus double entry in method call.
public void addAperatureP(int x,int openingSize){}
//adds an aperature to the screen with position x and opening size centered about the middle line of total width openingSizepublic void addDielectricP(int x, double n1, double n2, int r){}
//adds an index of refraction interface at position x and radius of curvature r. n1 and n2 are indices of refraction on either side of dielectric. For r = 0, the dielectric behaves as though it has r = infinity (a flat interface). Will not show internal reflection or aberation.public void addIndexChangeP(double x, double delN){}
//adds a flat index change of delN with a radius of curvature of infinity. Accounts for internal reflection, Snell's law.public void addISourceP(int x, int y, int size, double angle){}
//adds an infinite source (parallel rays), with position x and y. Size is height of beam and angle is the slope of the rays. Positive y's are above the center horizontal axis. Negative y's are below the center axis.public void addLensP(int x, double fl){}
//adds a lens with position x and focal length fl.public void addMirrorP(int x, double fl){}
//adds a mirror with position x and focal length fl. Radius of curvature is related to focal length.public void addPSourceP(int x, int y){}
//adds a principle-ray source at position x and y. Three rays, one parallel, one through center, and one through focal point. Positive y's are above the center horizontal axis. Negative y's are below the center axis.public void addRefractionP(double x, double delN, double r){}
//adds an index change of delN with a radius of curvature of r. This is a second order aproximation that accounts for internal reflection, Snell's law, and spherical aberation.public void addScreenP(int x){}
//adds a screen at position x. Screens draw dots where rays intercept.public void addSourceP(int x, int y,double rayIncrement,double raySlope){}
//adds a point source with position x and y. rayIncrement is the different in slope of each of the rays. raySlope is the slope of the top most ray. The smaller the rayIncrement is the more rays will be drawn. The larger the raySlope is the wider the spread of the rays will be. Positive y's are above the center horizontal axis. Negative y's are below the center axis.
public void setDrag(boolean d){}
//if drag is true the elements can be moved. If drag is false,
they can't. Once a value is set, it affects all elements added
after.
public void setPropertyDrag(boolean pd){}
//if propertyDrag is true, the property of the element can be
changed. Once a value is set, it affects all elements added
after.
public void setInfo(boolean i){}
//determines if information about each element will be shown when
it is the active element. Affects all elements added after
change.
public void setSize(double s){}
//sets the ratio of size of lens and mirrors. 1.0 is full screen.
0.0 is nothing. 0.5 is half-height centered about middle.
Dielectrics are always full screen.
public void setDirection(int d){}
//sets direction of sources. 1 is left to right. -1 is right to
left. Affects all sources added after value is set.
public void setPixPerUnit(int ppu){}
//sets pixels per unit. Takes effect immediately for bench and on
all elements added after the fact. Meant to be set only once
before scripting.
public void clearAll(){}
//clears all elements and sources from bench. Used before most
scripts.
public void setDefault(){
//calls the following methods.
setPixPerUnit(100);
setInfo(false);
setSize(0.8);
setDrag(false);
setPropertyDrag(false);
setDirection(1);
}
public void setUnDefault(){
//calls the following methods, basically the same as setDefault,
except that it allows dragging and turns on the info.
setPixPerUnit(100);
setInfo(true);
setSize(0.8);
setDrag(true);
setPropertyDrag(true);
setDirection(1);
}
TRYING TO GET TO WORK IN APPLET:
public void setRayColor(int r, int g, int b){}
//will eventually set the colors of the rays for all sources
added after the value is set.
RETURN
TO INDEX
RETURN TO MIKE'S
HOME PAGE
RETURN TO DC PHYSICS