<%@ 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(){

//setup position plots
document.Animator_x.setAutoRefresh(false);
document.DataGraph_x.setAutoRefresh(false);
document.Animator_x.setDefault();
document.Animator_x.setPixPerUnit(100);
document.Animator_x.shiftPixOrigin(-10,-68);
document.Animator_x.setGridUnit(0.1);
document.Animator_x.setShapeRGB(255,255,255);
id=document.Animator_x.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_x.setRGB(id,150,150,150);
id=document.Animator_x.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_x.setRGB(id,15,15,150);
document.DataGraph_x.setAutoscaleX(false);
document.DataGraph_x.setAutoscaleY(false);
document.DataGraph_x.setMinMaxX(0,4);
document.DataGraph_x.setMinMaxY(-2.8,2.8);
document.DataGraph_x.clearSeries(1);
document.DataGraph_x.setSeriesStyle(1,true,0);
document.DataGraph_x.setLastPointMarker(1,true);
document.DataGraph_x.setLabelX("Time");
document.DataGraph_x.setLabelY("Position");
document.Animator_x.setAutoRefresh(true);
document.DataGraph_x.setAutoRefresh(true);
//setup velocity plots
document.Animator_v.setAutoRefresh(false);
document.DataGraph_v.setAutoRefresh(false);
document.Animator_v.setDefault();
document.Animator_v.setPixPerUnit(100);
document.Animator_v.shiftPixOrigin(-10,-68);
document.Animator_v.setGridUnit(0.1);
document.Animator_v.setShapeRGB(255,255,255);
id=document.Animator_v.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_v.setRGB(id,150,150,150);
id=document.Animator_v.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_v.setRGB(id,15,15,150);
document.DataGraph_v.setAutoscaleX(false);
document.DataGraph_v.setAutoscaleY(false);
document.DataGraph_v.setMinMaxX(0,4);
document.DataGraph_v.setMinMaxY(-7.5,7.5);
document.DataGraph_v.clearSeries(1);
document.DataGraph_v.setSeriesStyle(1,true,0);
document.DataGraph_v.setLastPointMarker(1,true);
document.DataGraph_v.setLabelX("Time");
document.DataGraph_v.setLabelY("Velocity");
document.Animator_v.setAutoRefresh(true);
document.DataGraph_v.setAutoRefresh(true);
//setup acceleration plots
document.Animator_a.setAutoRefresh(false);
document.DataGraph_a.setAutoRefresh(false);
document.Animator_a.setDefault();
document.Animator_a.setPixPerUnit(100);
document.Animator_a.shiftPixOrigin(-10,-68);
document.Animator_a.setGridUnit(0.1);
document.Animator_a.setShapeRGB(255,255,255);
id=document.Animator_a.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_a.setRGB(id,150,150,150);
id=document.Animator_a.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_a.setRGB(id,15,15,150);
document.DataGraph_a.setAutoscaleX(false);
document.DataGraph_a.setAutoscaleY(false);
document.DataGraph_a.setMinMaxX(0,4);
document.DataGraph_a.setMinMaxY(-9,9);
document.DataGraph_a.clearSeries(1);
document.DataGraph_a.setSeriesStyle(1,true,0);
document.DataGraph_a.setLastPointMarker(1,true);
document.DataGraph_a.setLabelX("Time");
document.DataGraph_a.setLabelY("Acceleration");
document.Animator_a.setAutoRefresh(true);
document.DataGraph_a.setAutoRefresh(true);

}

// ********* position plot functions *****************
function animation_1_x(){

document.Animator_x.setAutoRefresh(false);
document.DataGraph_x.setAutoRefresh(false);
document.Animator_x.setDefault();
document.Animator_x.setPixPerUnit(100);
document.Animator_x.shiftPixOrigin(-10,-68);
document.Animator_x.setGridUnit(0.1);
document.Animator_x.setShapeRGB(255,255,255);
cid=document.Animator_x.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
setup
id=document.Animator_x.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_x.setRGB(id,150,150,150);
id=document.Animator_x.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_x.setRGB(id,15,15,150);
document.Animator_x.setOneShot(0,4,"End of Animation");
document.DataGraph_x.setAutoscaleX(false);
document.DataGraph_x.setAutoscaleY(false);
document.DataGraph_x.setMinMaxX(0,4);
document.DataGraph_x.setMinMaxY(-2.8,2.8);
document.DataGraph_x.clearSeries(1);
document.DataGraph_x.setSeriesStyle(1,true,0);
document.DataGraph_x.setLastPointMarker(1,true);
document.DataGraph_x.setLabelX("Time (s)");
document.DataGraph_x.setLabelY("Position");
document.DataGraph_x.setTitle("Graph 1");
gid1=document.DataGraph_x.getGraphID();
document.Animator_x.deleteDataConnections();
conid1=document.Animator_x.makeDataConnection(cid,gid1,1,"t","-vx/3");
document.Animator_x.updateDataConnections();
document.Animator_x.setAutoRefresh(true);
document.DataGraph_x.setAutoRefresh(true);
document.Animator_x.forward();

}

function animation_2_x(){

document.Animator_x.setAutoRefresh(false);
document.DataGraph_x.setAutoRefresh(false);
document.Animator_x.setDefault();
document.Animator_x.setPixPerUnit(100);
document.Animator_x.shiftPixOrigin(-10,-68);
document.Animator_x.setGridUnit(0.1);
document.Animator_x.setShapeRGB(255,255,255);
cid=document.Animator_x.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_x.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_x.setRGB(id,150,150,150);
id=document.Animator_x.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_x.setRGB(id,15,15,150);
document.Animator_x.setOneShot(0,4,"End of Animation");
bid=document.Animator_x.addObject("rectangle","w=1,h=1,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54+0.45*(t-0.9))*step(t-0.9),y=-20.73");
document.DataGraph_x.setAutoscaleX(false);
document.DataGraph_x.setAutoscaleY(false);
document.DataGraph_x.setMinMaxX(0,4);
document.DataGraph_x.setMinMaxY(-2.8,2.8);
document.DataGraph_x.clearSeries(1);
document.DataGraph_x.setSeriesStyle(1,true,0);
document.DataGraph_x.setLastPointMarker(1,true);
document.DataGraph_x.setLabelX("Time (s)");
document.DataGraph_x.setLabelY("Position");
document.DataGraph_x.setTitle("Graph 2");
gid1=document.DataGraph_x.getGraphID();
document.Animator_x.deleteDataConnections();
conid1=document.Animator_x.makeDataConnection(bid,gid1,1,"t","x");
document.Animator_x.updateDataConnections();
document.Animator_x.setAutoRefresh(true);
document.DataGraph_x.setAutoRefresh(true);
document.Animator_x.forward();

}

function animation_3_x(){

document.Animator_x.setAutoRefresh(false);
document.DataGraph_x.setAutoRefresh(false);
document.Animator_x.setDefault();
document.Animator_x.setPixPerUnit(100);
document.Animator_x.shiftPixOrigin(-10,-68);
document.Animator_x.setGridUnit(0.1);
document.Animator_x.setShapeRGB(255,255,255);
cid=document.Animator_x.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_x.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_x.setRGB(id,150,150,150);
id=document.Animator_x.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_x.setRGB(id,15,15,150);
document.Animator_x.setOneShot(0,4,"End of Animation");
document.DataGraph_x.setAutoscaleX(false);
document.DataGraph_x.setAutoscaleY(false);
document.DataGraph_x.setMinMaxX(0,4);
document.DataGraph_x.setMinMaxY(-2.8,2.8);
document.DataGraph_x.clearSeries(1);
document.DataGraph_x.setSeriesStyle(1,true,0);
document.DataGraph_x.setLastPointMarker(1,true);
document.DataGraph_x.setLabelX("Time (s)");
document.DataGraph_x.setLabelY("Position");
document.DataGraph_x.setTitle("Graph 3");
gid1=document.DataGraph_x.getGraphID();
conid1=document.Animator_x.makeDataConnection(cid,gid1,1,"t","x");
document.Animator_x.updateDataConnections();
document.Animator_x.setAutoRefresh(true);
document.DataGraph_x.setAutoRefresh(true);
document.Animator_x.forward();

}

function animation_4_x(){

document.Animator_x.setAutoRefresh(false);
document.DataGraph_x.setAutoRefresh(false);
document.Animator_x.setDefault();
document.Animator_x.setPixPerUnit(100);
document.Animator_x.shiftPixOrigin(-10,-68);
document.Animator_x.setGridUnit(0.1);
document.Animator_x.setShapeRGB(255,255,255);
cid=document.Animator_x.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_x.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_x.setRGB(id,150,150,150);
id=document.Animator_x.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_x.setRGB(id,15,15,150);
document.Animator_x.setOneShot(0,4,"End of Animation");
bid=document.Animator_x.addObject("rectangle","w=1,h=1,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54+0.45*(t-0.9))*step(t-0.9),y=0.73");
document.DataGraph_x.setAutoscaleX(false);
document.DataGraph_x.setAutoscaleY(false);
document.DataGraph_x.setMinMaxX(0,4);
document.DataGraph_x.setMinMaxY(-2.8,2.8);
document.DataGraph_x.clearSeries(1);
document.DataGraph_x.setSeriesStyle(1,true,0);
document.DataGraph_x.setLastPointMarker(1,true);
document.DataGraph_x.setTitle("Graph 4");
document.DataGraph_x.setLabelX("Time (s)");
document.DataGraph_x.setLabelY("Position");
gid1=document.DataGraph_x.getGraphID();
document.Animator_x.deleteDataConnections();
conid1=document.Animator_x.makeDataConnection(cid,gid1,1,"t","-x");
document.Animator_x.updateDataConnections();
document.Animator_x.setAutoRefresh(true);
document.DataGraph_x.setAutoRefresh(true);
document.Animator_x.forward();

}

// ********* velocity plot functions *****************

function animation_1_v(){

document.Animator_v.setAutoRefresh(false);
document.DataGraph_v.setAutoRefresh(false);
document.Animator_v.setDefault();
document.Animator_v.setPixPerUnit(100);
document.Animator_v.shiftPixOrigin(-10,-68);
document.Animator_v.setGridUnit(0.1);
document.Animator_v.setShapeRGB(255,255,255);
cid=document.Animator_v.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_v.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_v.setRGB(id,150,150,150);
id=document.Animator_v.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_v.setRGB(id,15,15,150);
document.Animator_v.setOneShot(0,4,"End of Animation");
document.DataGraph_v.setAutoscaleX(false);
document.DataGraph_v.setAutoscaleY(false);
document.DataGraph_v.setMinMaxX(0,4);
document.DataGraph_v.setMinMaxY(-7.5,7.5);
document.DataGraph_v.clearSeries(1);
document.DataGraph_v.setSeriesStyle(1,true,0);
document.DataGraph_v.setLastPointMarker(1,true);
document.DataGraph_v.setLabelX("Time (s)");
document.DataGraph_v.setLabelY("Velocity");
document.DataGraph_v.setTitle("Graph 1");
gid1=document.DataGraph_v.getGraphID();
document.Animator_v.deleteDataConnections();
conid1=document.Animator_v.makeDataConnection(cid,gid1,1,"t","vx");
document.Animator_v.updateDataConnections();
document.Animator_v.setAutoRefresh(true);
document.DataGraph_v.setAutoRefresh(true);
document.Animator_v.forward();

}

function animation_2_v(){

document.Animator_v.setAutoRefresh(false);
document.DataGraph_v.setAutoRefresh(false);
document.Animator_v.setDefault();
document.Animator_v.setPixPerUnit(100);
document.Animator_v.shiftPixOrigin(-10,-68);
document.Animator_v.setGridUnit(0.1);
document.Animator_v.setShapeRGB(255,255,255);
cid=document.Animator_v.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_v.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_v.setRGB(id,150,150,150);
id=document.Animator_v.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_v.setRGB(id,15,15,150);
document.Animator_v.setOneShot(0,4,"End of Animation");
bid=document.Animator_v.addObject("rectangle","w=1,h=1,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54+0.45*(t-0.9))*step(t-0.9),y=-20.73");
document.DataGraph_v.setAutoscaleX(false);
document.DataGraph_v.setAutoscaleY(false);
document.DataGraph_v.setMinMaxX(0,4);
document.DataGraph_v.setMinMaxY(-7.5,7.5);
document.DataGraph_v.clearSeries(1);
document.DataGraph_v.setSeriesStyle(1,true,0);
document.DataGraph_v.setLastPointMarker(1,true);
document.DataGraph_v.setLabelX("Time (s)");
document.DataGraph_v.setLabelY("Velocity");
document.DataGraph_v.setTitle("Graph 2");
gid1=document.DataGraph_v.getGraphID();
document.Animator_v.deleteDataConnections();
conid1=document.Animator_v.makeDataConnection(bid,gid1,1,"t","vx");
document.Animator_v.updateDataConnections();
document.Animator_v.setAutoRefresh(true);
document.DataGraph_v.setAutoRefresh(true);
document.Animator_v.forward();

}

function animation_3_v(){

document.Animator_v.setAutoRefresh(false);
document.DataGraph_v.setAutoRefresh(false);
document.Animator_v.setDefault();
document.Animator_v.setPixPerUnit(100);
document.Animator_v.shiftPixOrigin(-10,-68);
document.Animator_v.setGridUnit(0.1);
document.Animator_v.setShapeRGB(255,255,255);
cid=document.Animator_v.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_v.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_v.setRGB(id,150,150,150);
id=document.Animator_v.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_v.setRGB(id,15,15,150);
document.Animator_v.setOneShot(0,4,"End of Animation");
document.DataGraph_v.setAutoscaleX(false);
document.DataGraph_v.setAutoscaleY(false);
document.DataGraph_v.setMinMaxX(0,4);
document.DataGraph_v.setMinMaxY(-7.5,7.5);
document.DataGraph_v.clearSeries(1);
document.DataGraph_v.setSeriesStyle(1,true,0);
document.DataGraph_v.setLastPointMarker(1,true);
document.DataGraph_v.setLabelX("Time (s)");
document.DataGraph_v.setLabelY("Velocity");
document.DataGraph_v.setTitle("Graph 3");
gid1=document.DataGraph_v.getGraphID();
conid1=document.Animator_v.makeDataConnection(cid,gid1,1,"t","-vx");
document.Animator_v.updateDataConnections();
document.Animator_v.setAutoRefresh(true);
document.DataGraph_v.setAutoRefresh(true);
document.Animator_v.forward();

}

function animation_4_v(){

document.Animator_v.setAutoRefresh(false);
document.DataGraph_v.setAutoRefresh(false);
document.Animator_v.setDefault();
document.Animator_v.setPixPerUnit(100);
document.Animator_v.shiftPixOrigin(-10,-68);
document.Animator_v.setGridUnit(0.1);
document.Animator_v.setShapeRGB(255,255,255);
cid=document.Animator_v.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_v.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_v.setRGB(id,150,150,150);
id=document.Animator_v.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_v.setRGB(id,15,15,150);
document.Animator_v.setOneShot(0,4,"End of Animation");
bid=document.Animator_v.addObject("rectangle","w=1,h=1,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54+0.45*(t-0.9))*step(t-0.9),y=20.73");
document.DataGraph_v.setAutoscaleX(false);
document.DataGraph_v.setAutoscaleY(false);
document.DataGraph_v.setMinMaxX(0,4);
document.DataGraph_v.setMinMaxY(-7.5,7.5);
document.DataGraph_v.clearSeries(1);
document.DataGraph_v.setSeriesStyle(1,true,0);
document.DataGraph_v.setLastPointMarker(1,true);
document.DataGraph_v.setTitle("Graph 4");
document.DataGraph_v.setLabelX("Time (s)");
document.DataGraph_v.setLabelY("Velocity");
gid1=document.DataGraph_v.getGraphID();
document.Animator_v.deleteDataConnections();
conid1=document.Animator_v.makeDataConnection(bid,gid1,1,"t","-vx");
document.Animator_v.updateDataConnections();
document.Animator_v.setAutoRefresh(true);
document.DataGraph_v.setAutoRefresh(true);
document.Animator_v.forward();

}

// ********* acceleration plot functions *****************

function animation_1_a(){

document.Animator_a.setAutoRefresh(false);
document.DataGraph_a.setAutoRefresh(false);
document.Animator_a.setDefault();
document.Animator_a.setPixPerUnit(100);
document.Animator_a.shiftPixOrigin(-10,-68);
document.Animator_a.setGridUnit(0.1);
document.Animator_a.setShapeRGB(255,255,255);
cid=document.Animator_a.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
bid=document.Animator_a.addObject("rectangle","w=1,h=1,x=(-8)*(1-step(t-0.9))+(-2 + t)*step(t-0.9),y=-20.73");
id=document.Animator_a.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_a.setRGB(id,150,150,150);
id=document.Animator_a.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_a.setRGB(id,15,15,150);
document.Animator_a.setOneShot(0,4,"End of Animation");
document.DataGraph_a.setAutoscaleX(false);
document.DataGraph_a.setAutoscaleY(false);
document.DataGraph_a.setMinMaxX(0,4);
document.DataGraph_a.setMinMaxY(-9,9);
document.DataGraph_a.clearSeries(1);
document.DataGraph_a.setSeriesStyle(1,true,0);
document.DataGraph_a.setLastPointMarker(1,true);
document.DataGraph_a.setLabelX("Time (s)");
document.DataGraph_a.setLabelY("Acceleration");
document.DataGraph_a.setTitle("Graph 1");
gid1=document.DataGraph_a.getGraphID();
document.Animator_a.deleteDataConnections();
conid1=document.Animator_a.makeDataConnection(bid,gid1,1,"t","x");
document.Animator_a.updateDataConnections();
document.Animator_a.setAutoRefresh(true);
document.DataGraph_a.setAutoRefresh(true);
document.Animator_a.forward();

}

function animation_2_a(){

document.Animator_a.setAutoRefresh(false);
document.DataGraph_a.setAutoRefresh(false);
document.Animator_a.setDefault();
document.Animator_a.setPixPerUnit(100);
document.Animator_a.shiftPixOrigin(-10,-68);
document.Animator_a.setGridUnit(0.1);
document.Animator_a.setShapeRGB(255,255,255);
cid=document.Animator_a.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_a.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
document.Animator_a.setRGB(id,150,150,150);
id=document.Animator_a.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_a.setRGB(id,15,15,150);
document.Animator_a.setOneShot(0,4,"End of Animation");
bid=document.Animator_a.addObject("rectangle","w=1,h=1,x=(8)*(1-step(t-0.9))+(2 - t)*step(t-0.9),y=-20.73");
document.DataGraph_a.setAutoscaleX(false);
document.DataGraph_a.setAutoscaleY(false);
document.DataGraph_a.setMinMaxX(0,4);
document.DataGraph_a.setMinMaxY(-9,9);
document.DataGraph_a.clearSeries(1);
document.DataGraph_a.setSeriesStyle(1,true,0);
document.DataGraph_a.setLastPointMarker(1,true);
document.DataGraph_a.setLabelX("Time (s)");
document.DataGraph_a.setLabelY("Acceleration");
document.DataGraph_a.setTitle("Graph 2");
gid1=document.DataGraph_a.getGraphID();
document.Animator_a.deleteDataConnections();
conid1=document.Animator_a.makeDataConnection(bid,gid1,1,"t","x");
document.Animator_a.updateDataConnections();
document.Animator_a.setAutoRefresh(true);
document.DataGraph_a.setAutoRefresh(true);
document.Animator_a.forward();

}

function animation_3_a(){

document.Animator_a.setAutoRefresh(false);
document.DataGraph_a.setAutoRefresh(false);
document.Animator_a.setDefault();
document.Animator_a.setPixPerUnit(100);
document.Animator_a.shiftPixOrigin(-10,-68);
document.Animator_a.setGridUnit(0.1);
document.Animator_a.setShapeRGB(255,255,255);
cid=document.Animator_a.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_a.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
bid=document.Animator_a.addObject("rectangle","w=1,h=1,x=(8)*(1-step(t-0.9))+(-8)*step(t-0.9),y=-20.73");
document.Animator_a.setRGB(id,150,150,150);
id=document.Animator_a.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_a.setRGB(id,15,15,150);
document.Animator_a.setOneShot(0,4,"End of Animation");
document.DataGraph_a.setAutoscaleX(false);
document.DataGraph_a.setAutoscaleY(false);
document.DataGraph_a.setMinMaxX(0,4);
document.DataGraph_a.setMinMaxY(-9,9);
document.DataGraph_a.clearSeries(1);
document.DataGraph_a.setSeriesStyle(1,true,0);
document.DataGraph_a.setLastPointMarker(1,true);
document.DataGraph_a.setLabelX("Time (s)");
document.DataGraph_a.setLabelY("Acceleration");
document.DataGraph_a.setTitle("Graph 3");
gid1=document.DataGraph_a.getGraphID();
conid1=document.Animator_a.makeDataConnection(bid,gid1,1,"t","x");
document.Animator_a.updateDataConnections();
document.Animator_a.setAutoRefresh(true);
document.DataGraph_a.setAutoRefresh(true);
document.Animator_a.forward();

}

function animation_4_a(){

document.Animator_a.setAutoRefresh(false);
document.DataGraph_a.setAutoRefresh(false);
document.Animator_a.setDefault();
document.Animator_a.setPixPerUnit(100);
document.Animator_a.shiftPixOrigin(-10,-68);
document.Animator_a.setGridUnit(0.1);
document.Animator_a.setShapeRGB(255,255,255);
cid=document.Animator_a.addObject("image","file=<%= Session("VRoot")& "images/l_monster_truck.gif" %>,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54-0.45*(t-0.9))*step(t-0.9),y=0.73");
id=document.Animator_a.addObject("rectangle","w=420,h=10,x=0.9,y=0.22");
bid=document.Animator_a.addObject("rectangle","w=1,h=1,x=(-8)*(1-step(t-0.9))+(0)*step(t-0.9),y=-20.73");
document.Animator_a.setRGB(id,150,150,150);
id=document.Animator_a.addObject("rectangle","w=180,h=10,x=-1.4,y=0.22");
document.Animator_a.setRGB(id,15,15,150);
document.Animator_a.setOneShot(0,4,"End of Animation");
//bid=document.Animator_a.addObject("rectangle","w=1,h=1,x=(2.7+(-4*t*t))*(1-step(t-0.9))+(-0.54+0.45*(t-0.9))*step(t-0.9),y=0.73");
document.DataGraph_a.setAutoscaleX(false);
document.DataGraph_a.setAutoscaleY(false);
document.DataGraph_a.setMinMaxX(0,4);
document.DataGraph_a.setMinMaxY(-9,9);
document.DataGraph_a.clearSeries(1);
document.DataGraph_a.setSeriesStyle(1,true,0);
document.DataGraph_a.setLastPointMarker(1,true);
document.DataGraph_a.setTitle("Graph 4");
document.DataGraph_a.setLabelX("Time (s)");
document.DataGraph_a.setLabelY("Acceleration");
gid1=document.DataGraph_a.getGraphID();
document.Animator_a.deleteDataConnections();
conid1=document.Animator_a.makeDataConnection(bid,gid1,1,"t","x");
document.Animator_a.updateDataConnections();
document.Animator_a.setAutoRefresh(true);
document.DataGraph_a.setAutoRefresh(true);
document.Animator_a.forward();

}
</script>

</head>
<body onload="setup()">

<% Obj.Problem_Begin %>

<p>A green monster truck moves as shown in the animation (position is in meters and time is in
seconds).</p>
<hr>
<table border="0" width="100%">
<tr>
<td width="50%">
<p>Click each link below, and determine which graph best represents the
position of the truck as a function of time during the animation.</p>

<%
Session("whw_M1_Choice1") = "<a href=""JavaScript:animation_1_x()"">Graph 1</a>"
Session("whw_M1_Choice2") = "<a href=""JavaScript:animation_2_x()"">Graph 2</a>"
Session("whw_M1_Choice3") = "<a href=""JavaScript:animation_3_x()"">Graph 3</a>"
Session("whw_M1_Choice4") = "<a href=""JavaScript:animation_4_x()"">Graph 4</a>"
Session("whw_M1_Answer") = 3
%>
<% Obj.Output_mc_question(1) %>

</td>
<td width="50%">
 
<table border="1" bgcolor="#C0C0C0">
<tr>
<td align="center">

<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"
    archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
    code="dataGraph.DataGraph.class"
    id="DataGraph_x" name="DataGraph_x"
    width="450" height="200"
    hspace="0" vspace="0" align="middle">
    <param name="ShowControls" value="false">
</applet>

</td>
</tr>
<tr>
<td align="center">

<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"
    archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
    code="animator4.Animator.class" align="baseline"
    width="450" height="100"
    id="Animator_x" name="Animator_x">
    <param name="FPS" value="10">
    <param name="dt" value="0.05">
    <param name="showControls" value="false">
</applet>
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<table border="0" width="100%">
<tr>
<td width="50%">
<p>Click each link below, and determine which graph best represents the
velocity of the truck as a function of time during the animation.</p>

<%
Session("whw_M2_Choice1") = "<a href=""JavaScript:animation_1_v()"">Graph 1</a>"
Session("whw_M2_Choice2") = "<a href=""JavaScript:animation_2_v()"">Graph 2</a>"
Session("whw_M2_Choice3") = "<a href=""JavaScript:animation_3_v()"">Graph 3</a>"
Session("whw_M2_Choice4") = "<a href=""JavaScript:animation_4_v()"">Graph 4</a>"
Session("whw_M2_Answer") = 1
%>
<% Obj.Output_mc_question(2) %>
</td>
<td width="50%">
 
<table border="1" bgcolor="#C0C0C0">
<tr>

<td align="center">
<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"

    archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
    code="dataGraph.DataGraph.class"
    id="DataGraph_v" name="DataGraph_v"
    width="450" height="200"
    hspace="0" vspace="0" align="middle">
    <param name="ShowControls" value="false">
</applet>
</td>
</tr>
<tr>

<td align="center">
<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"

    archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
    code="animator4.Animator.class" align="baseline"
    width="450" height="100"
    id="Animator_v" name="Animator_v">
    <param name="FPS" value="10">
    <param name="dt" value="0.05">
    <param name="showControls" value="false">
</applet>
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<table border="0" width="100%">
<tr>
<td width="50%">
<p>Click each link below, and determine which graph best represents the
acceleration of the truck as a function of time during the animation.</p>

<%
Session("whw_M3_Choice1") = "<a href=""JavaScript:animation_1_a()"">Graph 1</a>"
Session("whw_M3_Choice2") = "<a href=""JavaScript:animation_2_a()"">Graph 2</a>"
Session("whw_M3_Choice3") = "<a href=""JavaScript:animation_3_a()"">Graph 3</a>"
Session("whw_M3_Choice4") = "<a href=""JavaScript:animation_4_a()"">Graph 4</a>"
Session("whw_M3_Answer") = 4
%>
<% Obj.Output_mc_question(3) %>

</td>
<td width="50%">
<table border="1" bgcolor="#C0C0C0">
<tr>
<td align="center">
<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"
    archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
    code="dataGraph.DataGraph.class"
    id="DataGraph_a" name="DataGraph_a"
    width="450" height="200"
    hspace="0" vspace="0" align="middle">
    <param name="ShowControls" value="false">
</applet>
</td>
</tr>
<tr>

<td align="center">
<applet codebase="<%= Session("VRoot")& "Physlet_classes" %>"
    archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
    code="animator4.Animator.class" align="baseline"
    width="450" height="100"
    id="Animator_a" name="Animator_a">
    <param name="FPS" value="10">
    <param name="dt" value="0.05">
    <param name="showControls" value="false">
</applet>
</td>
</tr>
</table>
</td>
</tr>
</table>

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