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

<script language="JavaScript">
function setup() {
    //This problem is adapted from one originally scripted by Mario Belloni
    document.webhw.setAutoRefresh(false);
    document.webhw.setDefault();
    document.webhw.setTimeInterval(0,5);
    document.webhw.setPixPerUnit(100);
    document.webhw.setGridUnit(0.1);
    document.webhw.shiftPixOrigin(-225,-30);
    id1=document.webhw.addObject("rectangle",
         "w=20,h=20,x=<%= 1.2 + (3 * Session("R2"))/100 %>*t*t,y=0.5");
    document.webhw.setRGB(id1,0,255,0);
    document.webhw.setTrail(id1,250);
    document.webhw.setFootPrints(id1,10);
    document.webhw.setGhost(id1,true);
    tid1=document.webhw.addObject("text",
         "text=x=,calc=x,x=0,y=0");
    document.webhw.setFont(tid1,"Hevetica",1,10);
    document.webhw.setAnimationSlave(id1,tid1);
    document.webhw.setDisplayOffset(tid1,-20,20);
    document.webhw.setFormat(tid1,"%-+3.3f");
    id2=document.webhw.addObject("rectangle",
         "w=20,h=20,x=<%= 2.5 + (5 + Session("R3"))/100 %>*t,y=-0.3");
    document.webhw.setRGB(id2,255,150,0);
    document.webhw.setTrail(id2,250);
    document.webhw.setFootPrints(id2,10);
    document.webhw.setGhost(id2,true);
    tid2=document.webhw.addObject("text",
         "text=x=,calc=x,x=0,y=0");
    document.webhw.setFont(tid2,"Hevetica",1,10);
    document.webhw.setAnimationSlave(id2,tid2);
    document.webhw.setDisplayOffset(tid2,-20,20);
    document.webhw.setFormat(tid2,"%-+3.3f");
    id=document.webhw.addObject("rectangle",
         "w=620,h=10,x=2,y=-0.4");
    document.webhw.setRGB(id,150,150,150);
    id=document.webhw.addObject("rectangle",
         "w=620,h=10,x=2,y=0.4");
    document.webhw.setRGB(id,150,150,150);
    document.webhw.setOneShot(0,1.5,"End of Animation");
    document.webhw.setAutoRefresh(true);
}
</script>

</head>

<body onload="setup()">

<% Obj.Problem_Begin %>

<center>
<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"
archive="Animator4_.jar,STools4.jar"
code="animator4.Animator.class"
align="baseline" width="500" height="220"
id="webhw"
name="webhw">
<param name="FPS" value="50">
<param name="dt" value="0.01">
<param name="showControls" value="true">
</applet>
</center>

<p>Two carts start move on similar air tracks as shown in the animation (position is in meters and time is in seconds).
<hr>
<p>At what position will the green cart catch up to the orange cart?

<% Session("whw_N1_Answer") = ((2.5 + (5 + Session("R3")) / 100 )^2) / (1.2 + (3 * Session("R2")) / 100) %>
<% Obj.Output_numeric_question(1) %>m

<% Obj.Problem_End %>
<hr>
<% Obj.Problem_status %>
<p><%
'Uncomment the line below to display the correct answer
'Obj.Display_answers
%>
</body>
</html>