<< Chapter < Page Chapter >> Page >

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.

Questions & Answers

What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Game 2302 - mathematical applications for game development. OpenStax CNX. Jan 09, 2016 Download for free at https://legacy.cnx.org/content/col11450/1.33
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?