|
EMWave allows users to show the relationship between electric and magnetic fields in a traveling E&M wave.
<applet codebase="../classes" archive="EMWave4_.jar,STools4.jar" \ code="emwave4.EMWave.class" name="EMWave" width="300"> <param name="ShowControls" value="true" /> <param name="Orientation" value="0" /> <param name="FPS" value="10" /> <param name="Translation" value=".4" /> </applet>
EMWave Parameters |
||
ShowControls | boolean | True shows the control panel with angle sliders. |
Orientation | int | Zero for vertical; one for horizontal. 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. |
FPS | int | Sets the animation frames per second. |
Translation | double | A value that specifies the distance (in units) the waves are translated for every animation frame. |
STools Parameters |
||
AppletNames | string | A comma delimited list of applet names occurring within this html page. (See OnLoad.) |
Debug | int | Enables debugging messages in Java console; 0 = no messages, 255 = verbose messages. |
OnLoad | string | A JavaScript function that will be invoked using LiveConnect after all applets have been loaded. (See AppletNames.) |
Resources | string | A file containing translations of internal text such as buttons and labels. |
A typical EMWave script is written as follows:
<script language="JavaScript"> function linear() { document.EMWave.deleteAll(); document.EMWave.setWaveLineDensity(2); document.EMWave.setPixPerUnit(8); document.EMWave.setRGB(22,50,134); document.EMWave.createFilledSquare(-20,20); document.EMWave.setRGB(222,223,27); document.EMWave.createAxes(0,0,-20,10); document.EMWave.setRGB(135,52,55); document.EMWave.createLinear(150,3.14); } </script>