<%@ LANGUAGE="VBSCRIPT" %>
<%
Set Obj = Server.CreateObject("WebHW.problem")
Obj.Problem_init
%>
<html>
<head>
<LINK REL=STYLESHEET HREF="<%= Session("VRoot")& "styles.css" %>" TYPE="text/css">

<script language="JavaScript">
function setup(){
     document.EField.setAutoRefresh(false);
   
document.EField.setDefault();
    document.EField.setXRange(-5,5);
    document.EField.setShowTime(false);
    document.EField.setShowContours(false);
    document.EField.setShowFieldLines(false);
    document.EField.setShowFieldVectors(false);
    document.EField.setShowForce(true);    
 

    /* Test Charge */
    id=document.EField.addObject("testcharge","x=0,y=0,r=6");
    document.EField.setDragable(id,true);
    document.EField.setRGB(id,0,0,255);
 

    <% For I = 1 To Session("R1") %>
             id=document.EField.addObject("charge",
   
         "x=<%= Session("R" & I) - 4.5 %>,y=<%= ((-1)^I) * (Session("R" & (10 - I)) - 4.5) %>,q=2,r=12");
            document.EField.setDragable(id,true);
              document.EField.setRGB(id,0,0,0);
    <% Next %>
    <% For I = 1 To Session("R2") %>
       id=document.EField.addObject("charge",
   
     "x=<%= ((-1)^I) * (Session("R" & (10 - I)) - 5) %>,y=-<%= Session("R" & I) - 5 %>,q=-2,r=12");
         document.EField.setDragable(id,true);
         document.EField.setRGB(id,0,0,0);
    <% Next %>
 

    document.EField.setAutoRefresh(true);
}
</script>

<title>WebHW Problem</title>
</head>
<body onload="setup()">

<% Obj.Problem_Begin %>
 

<p align="center">
<applet CODEBASE="<%= Session("VRoot")& "Physlet_classes" %>"
    archive="EField4_.jar,STools4.jar" code="eField4.EField.class"
    NAME="EField" ID="EField" WIDTH="450" HEIGHT="450" HSPACE="0" VSPACE="0"
    ALIGN="middle">
    <param name="FPS" value="10">
    <param name="dt" value="0.02">
    <param name="ShowControls" value="false">
    <param name="ShowContours" value="false">
    <param name="ShowFieldLines" value="false">
    <param name="ShowFieldVectors" value="false">
    <param name="ShowLabels" value="false">
    <param name="ShowCharge" value="true">
    <param name="Potential" value="0">
    <param name="Range" value="-5,5,-4,4">
    <param name="GridSize" value="64">
</applet>

</p>
<p>A group of unknown charges are shown on the screen along with vectors representing the forces
on each charge. You can click-drag on any charge to change its position. The absolute-value
of each charge is identical and equal to <%= Session("R3") %>.<%= Session("R4") %> x 10<sup>-6</sup>C;
however, some of the charges are positive and some are negative.
<p>Also shown is a small, blue, positive test charge.
 

<p>What is the net charge of this distribution? You may neglect the charge on the blue test charge.

<% Session("whw_N1_Answer") = (1.0E-6) * (Session("R3") + Session("R4")/10) * (Session("R1") - Session("R2")) %>
<% Obj.Output_numeric_question(1) %>C

<% Obj.Problem_End %>
<hr>
<% Obj.Problem_status %>
</body>
</html>