<< Chapter < Page | Chapter >> Page > |
What is the velocity of the platform with reference to the ground below the ocean?
What is the velocity of the man with reference to the ground below the ocean?
Tactile graphics
An svg file named Phy1070d1.svg is provided for the creation of a tactile velocity vector diagram for this scenario. The table of key-value pairs for thisfile is provided in Figure 11 .
Figure 11 . Key-value pairs for the image in Phy1070d1.svg. |
---|
m: Exercise with three vectors in a plane
n: Man velocity vectoro: Sum of three vectors
p: Platform velocity vectorq: Ship velocity vector
r: File: Phy1070d1.svgs: Sum of two vectors
t: Summation vector lines are dashed |
The image contained in this file is shown in Figure 12 for the benefit of your assistant who will manually emboss the diagram. Anon-mirror-image version is shown in Figure 17 .
Figure 12 . Mirror image contained in the file named Phy1070d1.svg |
---|
Create the script
Please copy the code from Listing 4 into an html file and open the html file in your browser.
Listing 4 . An exercise with three vectors in a plane. |
---|
<!---------------- File JavaScript04.html ---------------------><html><body><script language="JavaScript1.3">document.write("Start Script</br>");
//The purpose of this function is to receive the adjacent// and opposite side values for a right triangle and to
// return the angle in degrees in the correct quadrant.function getAngle(x,y){
if((x == 0)&&(y == 0)){
//Angle is indeterminate. Just return zero.return 0;
}else if((x == 0)&&(y>0)){
//Avoid divide by zero denominator.return 90;
}else if((x == 0)&&(y<0)){
//Avoid divide by zero denominator.return -90;
}else if((x<0)&&(y>= 0)){
//Correct to second quadrantreturn Math.atan(y/x)*180/Math.PI + 180;
}else if((x<0)&&(y<= 0)){
//Correct to third quadrantreturn Math.atan(y/x)*180/Math.PI + 180;
}else{//First and fourth quadrants. No correction required.
return Math.atan(y/x)*180/Math.PI;}//end else
}//end function getAngle//------------------------------------------------------------//
//The purpose of this function is to add two vectors, given// the magnitude and angle (in degrees) for each vector.
// The magnitude and angle (in degrees) of the resultant// vector is returned in a two-element array, with the
// magnitude in the element at index 0 and the angle in the// element at index 1. Note that this function calls the
// getAngle function, which must also be provided in the// script. To use this function to subtract one vector from
// another, add 180 degrees to the angle for the subtrahend// vector before passing the angle to the function. To use
// this function to add more than two vectors, add the first// two vectors as normal, then add the output from this
// function to the third vector, etc., until all of the// vectors have been included in the sum.
function vectorSum(vecAmag,vecAang,vecBmag,vecBang){var vecResult = new Array(2);
//Compute the horizontal and vertical components
// of each vector.var vecAh = vecAmag*Math.cos(vecAang*Math.PI/180);
var vecAv = vecAmag*Math.sin(vecAang*Math.PI/180);var vecBh = vecBmag*Math.cos(vecBang*Math.PI/180);
var vecBv = vecBmag*Math.sin(vecBang*Math.PI/180);//Compute the sums of the horizontal and vertical
// components from the two vectors to get the// horizontal and vertical component of the
// resultant vector.var vecResultH = vecAh + vecBh;
var vecResultV = vecAv + vecBv;//Use the Pythagorean theorem to compute the magnitude of
// the resultant vector.vecResult[0] = Math.sqrt(Math.pow(vecResultH,2) +Math.pow(vecResultV,2));
//Compute the angle of the resultant vector in degrees.vecResult[1] = getAngle(vecResultH,vecResultV);return vecResult;
}//end vectorSum function//------------------------------------------------------------//
//Main body of script begins here.//Establish the magnitude and angle for each vector.
var vecShipMag = 2;//magnitude of velocity of ship in miles/hrvar vecShipAng = 0;//angle of velocity of ship in degrees
var vecPlatMag = 2;//magnitude of velocity of platform miles/hrvar vecPlatAng = 45;//angle of velocity of platform in degrees
var vecManMag = 2;//Magnitude of velocity of man in miles/hrvar vecManAng = 90;//angle of velocity of man in degrees
//Add two vectorsvar platformVel =
vectorSum(vecShipMag,vecShipAng,vecPlatMag,vecPlatAng);//Add in the third vector
var manVel =vectorSum(platformVel[0],platformVel[1],vecManMag,vecManAng);
//Display the magnitude and direction of the resultant vectors.document.write("Platform velocity magnitude = " +
platformVel[0].toFixed(2) + " miles/hour</br>");
document.write("Platform velocity angle = " +platformVel[1].toFixed(2) + " degrees</br>");
document.write("Man velocity magnitude = " +manVel[0].toFixed(2) + " miles/hour</br>");
document.write("Man velocity angle = " +manVel[1].toFixed(2) + " degrees</br>");
document.write("End Script");</script></body></html> |
Notification Switch
Would you like to follow the 'Accessible physics concepts for blind students' conversation and receive update notifications?