# 2.5 Game 2302-0350 units and dimensional analysis  (Page 6/10)

 Page 6 / 10

Rearranging the terms

We can rearrange the terms and rewrite this equation as

distance = (63360 * inch * 1*foot * 1 * mile)/(12*inch*5280*foot)

Canceling like terms

Canceling out like terms in the numerator and denominator leaves us with

distance = (63360*mile)/(12*5280)

Doing the arithmetic, we get

distance = 1*mile

(Obviously, I started out with a set of numbers that were designed to cause the final answer to be one mile, but that was simply for convenience.)

There you have it

You have seen a detailed procedure for converting from a distance expressed in paces (for a specific individual) to the same distanceexpressed in miles. Obviously, once you understand the overall procedure, you could omit and/or combine some of the steps to simplify the process.

## Using JavaScript to convert units

Let's write, execute, and analyze a script that solves the same problem.

The objective of the script is to convert a distance of 2112 paces to a distance in miles where it is given that

• 100 paces = 3000 inches
• 12 inches = 1 foot
• 5280 feet = 1 mile

Please copy the code from Listing 1 into an html file and open the file in your browser.

Listing 1 . Convert from paces to miles.

```>!-- File JavaScript01.html ------------------------------>>html>>body>>script language="JavaScript1.3">var d = 2112 //distance, units = paces document.write("d = " + d + " paces" + "<br/>") var d2 = 3000 //distance, units = inchesvar d3 = 100 //distance, units = paces var f1 = d2/d3 //factor, units = inches/pacedocument.write( "f1 =" + f1 + " inches/pace" + "<br/>") //pace*inch/pace = inchvar d = d *f1 //distance, units = inches document.write("d = " + d + " inches" + "<br/>") var f2 = 1/12 //factor, units = feet/inchdocument.write( "f2 = " + f2 + " feet/inch" + "<br/>") //inch*feet/inch = feetvar d = d *f2 //distance, units = feet document.write("d = " + d + " feet" + "<br/>") var f3 = 1/5280 //factor, units = miles/footdocument.write( "f3 = " + f3 + " miles/foot" + "<br/>") //feet*mile/feet = milevar d = d *f3 //distance, units = miles document.write("d = " + d + " mile" + "<br/>") //Now reverse the process using reciprocals//(pace/inch)*(inch/foot)*(foot/mile) = pace/mile var f4 =(1/f1)*(1/f2)*(1/f3) //factor, units = paces/miledocument.write( "f4 = " + f4 + " paces/mile" + "<br/>") //miles*paces/mile = pacesvar d = d *f4 //distance, units = paces document.write("d = " + d + " paces" + "<br/>") document.write("The End")>/script>>/body>>/html>```

Screen output

When you open the html file in your browser, the text shown in Figure 5 should appear in your browser window.

Figure 5 . Screen output for Listing #1.
```d = 2112 paces f1 =30 inches/paced = 63360 inches f2 = 0.08333333333333333 feet/inchd = 5280 feet f3 = 0.0001893939393939394 miles/footd = 1 mile f4 = 2112 paces/miled = 2112 paces The End```

Discuss the output first

Let's begin our discussion with the screen output shown in Figure 5 and then go back and examine the code that produced that output.

Figure 5 begins with a distance (labeled d ) expressed in units of paces. The value is 2112 paces, which is the distance from your home to your school discussed earlier.

how can chip be made from sand
is this allso about nanoscale material
Almas
are nano particles real
yeah
Joseph
Hello, if I study Physics teacher in bachelor, can I study Nanotechnology in master?
no can't
Lohitha
where is the latest information on a no technology how can I find it
William
currently
William
where we get a research paper on Nano chemistry....?
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
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
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
has a lot of application modern world
Kamaluddeen
yes
narayan
what is variations in raman spectra for nanomaterials
ya I also want to know the raman spectra
Bhagvanji
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
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!