<< Chapter < Page | Chapter >> Page > |
Screen output
The text shown in Figure 16 should appear in your browser window when you open the html file in your browser.
Figure 16 . Screen output for Listing #1. |
---|
Start Script
The resultant is:Magnitude = 10.00
Angle = 135.00End Script |
Analysis of the output
Figure 16 shows the resultant force when the vector forces shown earlier are added.
The requirement for equilibrium
Two or more coplanar forces concurrent at a point are in equilibrium if the sums of their components, taken along two mutually perpendicular axes are zero.
The vector sum is not zero
As you can see from Figure 16 , the vector sum of the forces shown earlier is not zero. The resultant vector has a magnitude of 10 newtons and a direction of 135 degrees.
Therefore, the tent pole is not in equilibrium and is subject to falling down. If itfalls, it will probably fall in the direction of 135 degrees because there is a resultant force of 10 newtons pulling it in that direction.
Add a 10-newton force at 315 degrees
To put the tent pole in equilibrium, we would need to add one more force of 10 newtons in the opposite direction of the resultant shown in Figure 16 . In particular, one more guy wire is needed that adds a 10-newton pulling force inthe direction of 315 degrees.
Analysis of the code
We will deal with causing the tent pole to be in equilibrium shortly. Right now, let's make certain that we understand the code shown in Listing 1 .
I doubt that you will find anything new in this script because I explained the use of components for computing vector sums in an earlier module.
A function named getAngle
Listing 1 begins with the definition of a function named getAngle that I explained in an earlier module. Therefore, I won't explain that code again inthis module.
Declare working variables
Following the definition of the getAngle function, Listing 1 declares and initializes several working variables.
Enter a while loop
Then control goes into a while loop that computes the sum of the x-components and the sum of the y-components for each of the forces shown earlier .
Those forces are uniformly spaced around the tent pole with a 10-newton force vector every 45 degrees beginning at 0 and extending to 270 degrees inclusive. That makes iteasy to compute and add the components using a while loop.
The code in the while loop begins by computing the components of the force vector at 0 degrees, and then computes and accumulates the x and y components for eachof the remaining force vectors with a new force vector every 45 degrees up to and including the force vector at 270 degrees.
Storage locations for the vector sum
When the while loop exits, after computing the sum of the x-components and the sum of the y-components for the seven forces shown earlier , the sum of the x-components is stored in the variable named resultX and the sum of they-components is stored in the variable named resultY.
Compute the magnitude and angle of the resultant vector
The magnitude of the resultant vector is computed as the square root of the sum of the squares of the x and y components. The getAngle method is called toget the angle of the resultant force vector.
Notification Switch
Would you like to follow the 'Accessible physics concepts for blind students' conversation and receive update notifications?