# 0.9 Phy1060: motion -- displacement and vectors  (Page 12/13)

 Page 12 / 13

Display the results

Finally Listing 2 calls the document.write method several times in succession to display the values stored in some of the variables mentioned above in thebrowser window as shown in Figure 12 . As you can see, the magnitude and angle of the resultant agrees with the estimate that I made using the graphic methodearlier.

## Subtracting vectors

To subtract one vector from another using the mathematical approach, simply reverse the algebraic sign on the horizontal and vertical components for thesubtrahend vector and perform the addition shown in Listing 2 .

## Adding more than two vectors

Let's work through a problem that requires the addition of four vectors.

A graphical solution

First I would like for you to lay out the vectors, tail-to-head on your graph board to create a solution to this problem.

Pretend that you take a walk consisting of the following sequential segments. Angles are specified relative to east with east being zero degrees. Positiveangles are counter-clockwise and negative angles are clockwise.

The segments are as follows:

• 12 meters at 20 degrees
• 8 meters at 120 degrees
• 10.5 meters at -74 degrees
• 12.5 meters at 145 degrees

When you reach the end of the walk, what is your displacement (distance and direction) relative to the location at which you began the walk. You shouldbe able to do a reasonable job of measuring the displacement using your graph board.

A mathematical solution

Please copy the code shown in Listing 3 into an html file and open the html file in your browser.

Listing 3 . The sum of four vectors.
```<!-- File JavaScript03.html --><html><body><script language="JavaScript1.3">//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//Specify the magnitudes and angles of four vectors. //Convert the angles from degrees to radians.var vecAmag = 12; var vecAang = 20*Math.PI/180;//degrees*radians/degrees=radiansvar vecBmag = 8; var vecBang = 120*Math.PI/180;//degrees*radians/degrees=radiansvar vecCmag = 10.5; var vecCang = -74*Math.PI/180;//degrees*radians/degrees=radiansvar vecDmag = 12.5; var vecDang = 145*Math.PI/180;//degrees*radians/degrees=radians//Compute the horizontal and vertical components of each vector. var vecAh = vecAmag*Math.cos(vecAang);var vecAv = vecAmag*Math.sin(vecAang); var vecBh = vecBmag*Math.cos(vecBang);var vecBv = vecBmag*Math.sin(vecBang); var vecCh = vecCmag*Math.cos(vecCang);var vecCv = vecCmag*Math.sin(vecCang); var vecDh = vecDmag*Math.cos(vecDang);var vecDv = vecDmag*Math.sin(vecDang); //Compute the sums of the horizontal and vertical components from// the four vectors to get the horizontal and vertical component // of the resultant vector.var vecResultH = vecAh + vecBh + vecCh + vecDh; var vecResultV = vecAv + vecBv + vecCv + vecDv;//Use the Pythagorean theorem to compute the magnitude of the// resultant vector. var vecResultMag = Math.sqrt(Math.pow(vecResultH,2) +Math.pow(vecResultV,2)); //Compute the angle of the resultant vector.vecResultAng = getAngle(vecResultH,vecResultV); document.write("Hello from JavaScript" + "</br>") document.write("vecResultMag = " + vecResultMag.toFixed(2) + "</br>"); document.write("vecResultAng = " + vecResultAng.toFixed(2) + "</br>"); document.write("The End")</script></body></html>```

where we get a research paper on Nano chemistry....?
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
Got questions? Join the online conversation and get instant answers! By OpenStax By Anh Dao By Madison Christian By Tod McGrath By OpenStax By OpenStax By Samuel Madden By Rhodes By OpenStax By OpenStax