<!-- This XML file has been created by Easy Java Simulations (Ejs). Visit http://www.um.es/fem/Ejs. -->
<!-- Please, save the file to your hard disk on your Ejs' user directory and open it with Ejs. -->
<Osejs version="4.2.7" password="">
<Osejs.Information>
<Title><![CDATA[]]></Title>
<Author><![CDATA[]]></Author>
<Keywords><![CDATA[]]></Keywords>
<Password><![CDATA[]]></Password>
<Level><![CDATA[]]></Level>
<Language><![CDATA[]]></Language>
<Abstract><![CDATA[]]></Abstract>
<ExecPassword><![CDATA[]]></ExecPassword>
<CaptureTools>true</CaptureTools>
<DataTools>true</DataTools>
<LanguageTools>true</LanguageTools>
<EmersionSupport>false</EmersionSupport>
<UseInterpreter>true</UseInterpreter>
<AdditionalLibraries>
</AdditionalLibraries>
<ImportStatements>
</ImportStatements>
<AuxiliaryFiles><![CDATA[]]></AuxiliaryFiles>
<DetectedFiles><![CDATA[]]></DetectedFiles>
</Osejs.Information>
<Osejs.Description>
<Osejs.Description.Page>
<Type>DESCRIPTION_EDITOR</Type>
<Name>Refraction - Snell's Law</Name>
<Active>true</Active>
<Content>
<![CDATA[
<html>
  <head>
    
  </head>
  <body>
    <h1>
      Snell's Law
    </h1>
    <p>
      This simulation illustrates Snell's Law.
    </p>
    <p>
      Snell's Law states that light, when it passes from one medium to 
      another, obeys the relationship:
    </p>
    <p>
      n<sub>1</sub> sin(&#952;<sub>1</sub>) = n<sub>2</sub> sin(&#952;<sub>2</sub>)
    </p>
    <p>
      n<sub>1 </sub>is the index of refraction of medium 1,
    </p>
    <p>
      n<sub>2 </sub>is the index of refraction of medium 2,
    </p>
    <p>
      &#952;<sub>1 </sub>is the angle, in medium 1, the light ray makes with 
      the normal,
    </p>
    <p>
      &#952;<sub>2 </sub>is the angle, in medium 2, the light ray makes with 
      the normal.
    </p>
    <p>
      The normal is the line perpendicular to the interface that passes 
      through the interface at the same location the light does. In this 
      simulation, the normal is a vertical line.
    </p>
  </body>
</html>

]]>

</Content>
</Osejs.Description.Page>
<Osejs.Description.Page>
<Type>DESCRIPTION_EDITOR</Type>
<Name>Activities</Name>
<Active>true</Active>
<Content>
<![CDATA[
<html>
  <head>
    
  </head>
  <body>
    <h1>
      Activities
    </h1>
    <h1>
      <font size="4">The positions of the points on the screen are specified 
      in meters - if you right-click on any point on the screen, the 
      coordinates of that point will show up in yellow in the bottom left of 
      medium 2 (the lower medium). </font>
    </h1>
    <ol>
      <li>
        When you first start the simulation, the light source is the red point 
        in medium 1. Drag the red point around the screen to change the angle 
        of incidence (the angle the light incident on the interface between 
        the two media makes with the normal to the interface, which is the 
        vertical line). When the light strikes the interface, it generally 
        splits into two rays, a reflected ray, which stays in the original 
        medium, and a refracted ray, which passes into the other medium. What 
        determines the direction of the reflected ray? What determines the 
        direction of the refracted ray?
      </li>
      <li>
        Use the sliders to adjust the index of refraction of each medium. How 
        do the values of the indices of refraction affect the reflected ray? 
        How do they affect the refracted ray?
      </li>
      <li>
        There are two ways that you can get light to pass from one medium into 
        another medium without changing direction. What are they?
      </li>
      <li>
        Make a prediction regarding this situation. First, start the light off 
        in medium 1. Move the purple point, in medium 2, so that the refracted 
        ray passes through it. If you hit the button so that the light now 
        starts in medium 2, from the purple point, will it pass through the 
        red point, in medium 1? Justify your prediction, and then use the 
        simulation to see if you are correct.
      </li>
      <li>
        Under some conditions, none of the light incident on the boundary will 
        pass through to the second medium. What is this phenomenon known as? 
        Under what conditions will it occur?
      </li>
    </ol>
  </body>
</html>

]]>

</Content>
</Osejs.Description.Page>
</Osejs.Description>
<Osejs.Model>
<Osejs.Model.FramesPerSecond>25</Osejs.Model.FramesPerSecond>
<Osejs.Model.StepsPerDisplay>1</Osejs.Model.StepsPerDisplay>
<Osejs.Model.Autostart>false</Osejs.Model.Autostart>
<Osejs.Model.Variables>
<Osejs.Model.Variables.Page>
<Type>VARIABLE_EDITOR</Type>
<Name>variables</Name>
<Active>true</Active>
<Content>
<PageComment><![CDATA[]]></PageComment>
<Variable>
<Name><![CDATA[helpFlag]]></Name>
<Value><![CDATA[false]]></Value>
<Type><![CDATA[boolean]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[helpLabel]]></Name>
<Value><![CDATA["Show Help"]]></Value>
<Type><![CDATA[String]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[x1]]></Name>
<Value><![CDATA[-0.8]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x coordinate of point 1]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[x2]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x coordinate of point 2]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[y1]]></Name>
<Value><![CDATA[3.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y coordinate of point 1]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[y2]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y coordinate of point 2]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[x3]]></Name>
<Value><![CDATA[0.8]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x coordinate of point 3]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[y3]]></Name>
<Value><![CDATA[-3.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y coordinate of point 3]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[zeroval]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[Always zero]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[oneFlag]]></Name>
<Value><![CDATA[true]]></Value>
<Type><![CDATA[boolean]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[twoFlag]]></Name>
<Value><![CDATA[false]]></Value>
<Type><![CDATA[boolean]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[]]></Name>
<Value><![CDATA[]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>

</Content>
</Osejs.Model.Variables.Page>
<Osejs.Model.Variables.Page>
<Type>VARIABLE_EDITOR</Type>
<Name>calculations</Name>
<Active>true</Active>
<Content>
<PageComment><![CDATA[]]></PageComment>
<Variable>
<Name><![CDATA[n1]]></Name>
<Value><![CDATA[1.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[index of refraction of medium 1]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[n2]]></Name>
<Value><![CDATA[1.5]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[index of refraction of medium 2]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[d1]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[distance from point 1 to point 2]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[d2]]></Name>
<Value><![CDATA[4.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[distance from point 2 to point 3]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[val1]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[value of n1 sin(theta1)]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[sintheta2]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[value of sin(theta2)]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[xvalRefract]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x-coordinate of end-point of the refracted ray]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[yvalRefract]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y-coordinate of end-point of the refracted ray]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[xvalReflect]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x-coordinate of end-point of the reflected ray]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[yvalReflect]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y-coordinate of end-point of the reflected ray]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[theta1]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[incident angle, in degrees]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[theta2]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[angle of refraction, in degrees]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[refractFlag]]></Name>
<Value><![CDATA[true]]></Value>
<Type><![CDATA[boolean]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[false if total internal reflection occurs]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[sinthetaCrit]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[sine of the critical angle]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[xCrit]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x coordinate of one endpoint of the critical angle line]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[yCrit]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y coordinate of one endpoint of the critical angle line]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[]]></Name>
<Value><![CDATA[]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>

</Content>
</Osejs.Model.Variables.Page>
<Osejs.Model.Variables.Page>
<Type>VARIABLE_EDITOR</Type>
<Name>color variables</Name>
<Active>true</Active>
<Content>
<PageComment><![CDATA[]]></PageComment>
<Variable>
<Name><![CDATA[redness]]></Name>
<Value><![CDATA[255]]></Value>
<Type><![CDATA[int]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[greenness]]></Name>
<Value><![CDATA[255]]></Value>
<Type><![CDATA[int]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[blueness]]></Name>
<Value><![CDATA[255]]></Value>
<Type><![CDATA[int]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[colorMedium1]]></Name>
<Value><![CDATA[]]></Value>
<Type><![CDATA[Object]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[colorMedium2]]></Name>
<Value><![CDATA[]]></Value>
<Type><![CDATA[Object]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[]]></Name>
<Value><![CDATA[]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>

</Content>
</Osejs.Model.Variables.Page>
<Osejs.Model.Variables.Page>
<Type>VARIABLE_EDITOR</Type>
<Name>StartandEnd</Name>
<Active>true</Active>
<Content>
<PageComment><![CDATA[]]></PageComment>
<Variable>
<Name><![CDATA[xStart]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[x coordinate of light source]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[yStart]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[y coordinate of light source]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[nStart]]></Name>
<Value><![CDATA[1.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[index of refraction of medium where the source is]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[nEnd]]></Name>
<Value><![CDATA[1.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[index of refraction of the second medium]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[thetaStart]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[incident angle]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[thetaEnd]]></Name>
<Value><![CDATA[0.0]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[angle of refraction]]></Comment>
</Variable>
<Variable>
<Name><![CDATA[]]></Name>
<Value><![CDATA[]]></Value>
<Type><![CDATA[double]]></Type>
<Dimension><![CDATA[]]></Dimension>
<Comment><![CDATA[]]></Comment>
</Variable>

</Content>
</Osejs.Model.Variables.Page>
</Osejs.Model.Variables>
<Osejs.Model.Initialization>
<Osejs.Model.Initialization.Page>
<Type>CODE_EDITOR</Type>
<Name>Init Page</Name>
<Active>true</Active>
<Content>
<Comment><![CDATA[]]></Comment>
<Code><![CDATA[
redness = 255 - (int)(160*(n1 - 1.0));
greenness = redness;
colorMedium1 = new java.awt.Color(redness,greenness,blueness);

redness = 255 - (int)(160*(n2 - 1.0));
greenness = redness;
colorMedium2 = new java.awt.Color(redness,greenness,blueness);
]]></Code>

</Content>
</Osejs.Model.Initialization.Page>
</Osejs.Model.Initialization>
<Osejs.Model.Evolution>
</Osejs.Model.Evolution>
<Osejs.Model.Constraints>
<Osejs.Model.Constraints.Page>
<Type>CODE_EDITOR</Type>
<Name>FixRel Page</Name>
<Active>true</Active>
<Content>
<Comment><![CDATA[]]></Comment>
<Code><![CDATA[
if (oneFlag)
{
  xStart = x1;
  yStart = y1;
  nStart = n1;
  nEnd = n2;
}
else
{
  xStart = x3;
  yStart = y3;
  nStart = n2;
  nEnd = n1;
}

d1 = Math.sqrt((x2-xStart)*(x2-xStart)+(y2-yStart)*(y2-yStart));
val1 = nStart*(x2-xStart)/d1;
sintheta2 = val1/nEnd;
thetaStart = (180.0/Math.PI)*Math.asin(Math.abs((x2-xStart)/d1));
thetaEnd = (180.0/Math.PI)*Math.asin(Math.abs(sintheta2));

xvalReflect = d2*(x2-xStart)/d1;
yvalReflect = d2*(yStart-y2)/d1;

if (Math.abs(sintheta2) > 1.0)
  {
    refractFlag = false;
  }
else
  {
    refractFlag = true;
    xvalRefract = d2*sintheta2;
    yvalRefract = Math.sqrt(d2*d2-xvalRefract*xvalRefract);
    if (oneFlag)
    {
      yvalRefract = -yvalRefract;
    }
  }
  
if (oneFlag)
{
  theta1 = thetaStart;
  theta2 = thetaEnd;
}
else
{
  theta2 = thetaStart;
  theta1 = thetaEnd;
}

sinthetaCrit = Math.min(n1,n2)/Math.max(n1,n2);
xCrit = d2*sinthetaCrit;
yCrit = Math.sqrt(d2*d2-xCrit*xCrit);
if (n2 > n1)
{
  yCrit = -yCrit;
}

]]></Code>

</Content>
</Osejs.Model.Constraints.Page>
</Osejs.Model.Constraints>
<Osejs.Model.Library>
</Osejs.Model.Library>
</Osejs.Model>
<Osejs.View>
<Osejs.View.Creation>
<Osejs.View.Creation.Element>
<Expanded>true</Expanded>
<Type>Elements.Frame</Type>
<Property name="name">MainWindow</Property>
<Property name="_ejs_mainWindow">true</Property>
<Property name="title"><![CDATA["Refraction - Snell's Law"]]></Property>
<Property name="layout"><![CDATA[border]]></Property>
<Property name="visible"><![CDATA[true]]></Property>
<Property name="location"><![CDATA["0,0"]]></Property>
<Property name="size"><![CDATA["637,500"]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Expanded>true</Expanded>
<Type>Elements.Panel</Type>
<Property name="name">RightPanel</Property>
<Property name="parent">MainWindow</Property>
<Property name="position">east</Property>
<Property name="layout"><![CDATA[border]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Expanded>true</Expanded>
<Type>Elements.Panel</Type>
<Property name="name">ButtonsPanel</Property>
<Property name="parent">RightPanel</Property>
<Property name="position">north</Property>
<Property name="layout"><![CDATA[grid:0,1,0,0]]></Property>
<Property name="size"><![CDATA["200,420"]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.RadioButton</Type>
<Property name="name">start1</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="selected"><![CDATA[true]]></Property>
<Property name="text"><![CDATA["Lights starts in medium 1"]]></Property>
<Property name="actionon"><![CDATA[oneFlag = true;
twoFlag = false;]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.RadioButton</Type>
<Property name="name">start2</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="selected"><![CDATA[false]]></Property>
<Property name="text"><![CDATA["Light starts in medium 2"]]></Property>
<Property name="actionon"><![CDATA[oneFlag = false;
twoFlag = true;]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.CheckBox</Type>
<Property name="name">criticalangle</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="variable"><![CDATA[showCrit]]></Property>
<Property name="selected"><![CDATA[false]]></Property>
<Property name="text"><![CDATA["Show critical angle"]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Slider</Type>
<Property name="name">n1</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="variable"><![CDATA[n1]]></Property>
<Property name="minimum"><![CDATA[1.0]]></Property>
<Property name="maximum"><![CDATA[2.5]]></Property>
<Property name="format"><![CDATA["n1 = 0.#"]]></Property>
<Property name="ticks"><![CDATA[16]]></Property>
<Property name="closest"><![CDATA[true]]></Property>
<Property name="dragaction"><![CDATA[_view.resetTraces();
redness = 255 - (int)(160*(n1 - 1.0));
greenness = redness;
colorMedium1 = new java.awt.Color(redness,greenness,blueness);]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Slider</Type>
<Property name="name">n2</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="variable"><![CDATA[n2]]></Property>
<Property name="value"><![CDATA[1.49995]]></Property>
<Property name="minimum"><![CDATA[1.0]]></Property>
<Property name="maximum"><![CDATA[2.5]]></Property>
<Property name="format"><![CDATA["n2 = 0.#"]]></Property>
<Property name="ticks"><![CDATA[16]]></Property>
<Property name="closest"><![CDATA[true]]></Property>
<Property name="dragaction"><![CDATA[_view.resetTraces();
redness = 255 - (int)(160*(n2 - 1.0));
greenness = redness;
colorMedium2 = new java.awt.Color(redness,greenness,blueness);]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Button</Type>
<Property name="name">reset</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="text"><![CDATA[Reset Simulation]]></Property>
<Property name="action"><![CDATA[_reset()]]></Property>
<Property name="background"><![CDATA[BLACK]]></Property>
<Property name="foreground"><![CDATA[RED]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Button</Type>
<Property name="name">instructions</Property>
<Property name="parent">ButtonsPanel</Property>
<Property name="text"><![CDATA[%helpLabel%]]></Property>
<Property name="action"><![CDATA[if (helpFlag)
{
helpFlag = false;
helpLabel = "Show Help";
}
else
{
helpFlag = true;
helpLabel = "Hide Help";
}]]></Property>
<Property name="background"><![CDATA[BLUE]]></Property>
<Property name="foreground"><![CDATA[YELLOW]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Expanded>true</Expanded>
<Type>Elements.DrawingPanel</Type>
<Property name="name">drawingPanel</Property>
<Property name="parent">MainWindow</Property>
<Property name="position">center</Property>
<Property name="autoscaleX"><![CDATA[false]]></Property>
<Property name="autoscaleY"><![CDATA[false]]></Property>
<Property name="minimumX"><![CDATA[-5.0]]></Property>
<Property name="maximumX"><![CDATA[5.0]]></Property>
<Property name="minimumY"><![CDATA[-5.0]]></Property>
<Property name="maximumY"><![CDATA[5.0]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Particle</Type>
<Property name="name">medium1</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[0.0]]></Property>
<Property name="y"><![CDATA[0.0]]></Property>
<Property name="sizex"><![CDATA[10.0]]></Property>
<Property name="sizey"><![CDATA[5.0]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[RECTANGLE]]></Property>
<Property name="elementposition"><![CDATA[SOUTH]]></Property>
<Property name="color"><![CDATA[colorMedium1]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Particle</Type>
<Property name="name">medium2</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[0.0]]></Property>
<Property name="y"><![CDATA[0.0]]></Property>
<Property name="sizex"><![CDATA[10.0]]></Property>
<Property name="sizey"><![CDATA[5.0]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[RECTANGLE]]></Property>
<Property name="elementposition"><![CDATA[NORTH]]></Property>
<Property name="color"><![CDATA[colorMedium2]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Arrow</Type>
<Property name="name">crit1</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x2]]></Property>
<Property name="y"><![CDATA[y2]]></Property>
<Property name="sizex"><![CDATA[xCrit]]></Property>
<Property name="sizey"><![CDATA[yCrit]]></Property>
<Property name="visible"><![CDATA[showCrit]]></Property>
<Property name="enabledSecondary"><![CDATA[false]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[SEGMENT]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Arrow</Type>
<Property name="name">crit2</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x2]]></Property>
<Property name="y"><![CDATA[y2]]></Property>
<Property name="sizex"><![CDATA[-xCrit]]></Property>
<Property name="sizey"><![CDATA[yCrit]]></Property>
<Property name="visible"><![CDATA[showCrit]]></Property>
<Property name="enabledSecondary"><![CDATA[false]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[SEGMENT]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Arrow</Type>
<Property name="name">normal</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x2]]></Property>
<Property name="y"><![CDATA[-4.0]]></Property>
<Property name="sizex"><![CDATA[0.0]]></Property>
<Property name="sizey"><![CDATA[8.0]]></Property>
<Property name="enabledSecondary"><![CDATA[false]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[SEGMENT]]></Property>
<Property name="color"><![CDATA[BLACK]]></Property>
<Property name="stroke"><![CDATA[1]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Arrow</Type>
<Property name="name">ray1</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[xStart]]></Property>
<Property name="y"><![CDATA[yStart]]></Property>
<Property name="sizex"><![CDATA[x2-xStart]]></Property>
<Property name="sizey"><![CDATA[y2-yStart]]></Property>
<Property name="enabledSecondary"><![CDATA[false]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[ARROW]]></Property>
<Property name="color"><![CDATA[RED]]></Property>
<Property name="secondaryColor"><![CDATA[RED]]></Property>
<Property name="stroke"><![CDATA[2]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Arrow</Type>
<Property name="name">ray2</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x2]]></Property>
<Property name="y"><![CDATA[y2]]></Property>
<Property name="sizex"><![CDATA[xvalRefract]]></Property>
<Property name="sizey"><![CDATA[yvalRefract]]></Property>
<Property name="visible"><![CDATA[refractFlag]]></Property>
<Property name="enabledSecondary"><![CDATA[false]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[ARROW]]></Property>
<Property name="color"><![CDATA[RED]]></Property>
<Property name="secondaryColor"><![CDATA[RED]]></Property>
<Property name="stroke"><![CDATA[2]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Arrow</Type>
<Property name="name">rayReflect</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x2]]></Property>
<Property name="y"><![CDATA[y2]]></Property>
<Property name="sizex"><![CDATA[xvalReflect]]></Property>
<Property name="sizey"><![CDATA[yvalReflect]]></Property>
<Property name="enabledSecondary"><![CDATA[false]]></Property>
<Property name="enabled"><![CDATA[false]]></Property>
<Property name="style"><![CDATA[ARROW]]></Property>
<Property name="color"><![CDATA[RED]]></Property>
<Property name="secondaryColor"><![CDATA[RED]]></Property>
<Property name="stroke"><![CDATA[2]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Particle</Type>
<Property name="name">point1</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x1]]></Property>
<Property name="y"><![CDATA[y1]]></Property>
<Property name="sizex"><![CDATA[0.2]]></Property>
<Property name="sizey"><![CDATA[0.2]]></Property>
<Property name="enabled"><![CDATA[true]]></Property>
<Property name="dragaction"><![CDATA[if (y1 < 0.0)
{
  y1 = 0.0;
}
_view.resetTraces();]]></Property>
<Property name="color"><![CDATA[RED]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Particle</Type>
<Property name="name">point2</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x2]]></Property>
<Property name="y"><![CDATA[y2]]></Property>
<Property name="sizex"><![CDATA[0.2]]></Property>
<Property name="sizey"><![CDATA[0.2]]></Property>
<Property name="enabled"><![CDATA[true]]></Property>
<Property name="dragaction"><![CDATA[y2 = zeroval]]></Property>
<Property name="color"><![CDATA[GREEN]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.Particle</Type>
<Property name="name">point3</Property>
<Property name="parent">drawingPanel</Property>
<Property name="x"><![CDATA[x3]]></Property>
<Property name="y"><![CDATA[y3]]></Property>
<Property name="sizex"><![CDATA[0.2]]></Property>
<Property name="sizey"><![CDATA[0.2]]></Property>
<Property name="enabled"><![CDATA[true]]></Property>
<Property name="dragaction"><![CDATA[if (y3 > 0.0)
 {
   y3 = 0.0;
 }
 _view.resetTraces();]]></Property>
<Property name="color"><![CDATA[MAGENTA]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Expanded>true</Expanded>
<Type>Elements.Panel</Type>
<Property name="name">output</Property>
<Property name="parent">MainWindow</Property>
<Property name="position">south</Property>
<Property name="layout"><![CDATA[GRID:0,1,0,0]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.ParsedField</Type>
<Property name="name">theta1</Property>
<Property name="parent">output</Property>
<Property name="variable"><![CDATA[theta1]]></Property>
<Property name="format"><![CDATA["theta1 (degrees) = 0.##"]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Arial,BOLD,14]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.ParsedField</Type>
<Property name="name">theta2</Property>
<Property name="parent">output</Property>
<Property name="variable"><![CDATA[theta2]]></Property>
<Property name="format"><![CDATA["theta2 (degrees) = 0.##"]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Arial,BOLD,14]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Expanded>false</Expanded>
<Type>Elements.Frame</Type>
<Property name="name">helpBox</Property>
<Property name="title"><![CDATA[Help]]></Property>
<Property name="layout"><![CDATA[grid:0,1,0,0]]></Property>
<Property name="visible"><![CDATA[helpFlag]]></Property>
<Property name="onClosing"><![CDATA[helpFlag = false;
helpLabel = "Show Help";]]></Property>
<Property name="location"><![CDATA["0,0"]]></Property>
<Property name="size"><![CDATA["729,295"]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line1</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["Use the sliders to set the index of refraction of each medium."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line2</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["The light source is either the red point in medium 1 or the purple point in medium 2."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line2B</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["Use the radio buttons to determine which point is the light source."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line3</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["The light travels via the green point on the interface (the boundary) between the media."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line4</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["You can click-and-drag any of the three points to move them around."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line5</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["The red point stays in medium 1 (at top), the purple point stays in medium 2 (on the bottom)."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line6</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["The table at the bottom shows the values of the angle of incidence and the angle of refraction."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line7</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["The angles are measured from the normal (the vertical line, in this situation)."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
<Osejs.View.Creation.Element>
<Type>Elements.TextField</Type>
<Property name="name">line8</Property>
<Property name="parent">helpBox</Property>
<Property name="value"><![CDATA["You can completely reset the simulation, if necessary, with the Reset Simulation button."]]></Property>
<Property name="editable"><![CDATA[false]]></Property>
<Property name="font"><![CDATA[Dialog,BOLD,16]]></Property>
</Osejs.View.Creation.Element>
</Osejs.View.Creation>
</Osejs.View>
<Osejs.Experiment>
</Osejs.Experiment>
</Osejs>
