<< Chapter < Page Chapter >> Page >

resultant[0].toFixed(2)

In this case, the "[0]" means to retrieve the value stored in thearray element identified by the index value 0.

Once that value has been retrieved, the built-in toFixed method is called, passing the literal value 2 as a parameter, to format the valueso that it will be displayed with two digits to the right of the decimal point.

Figure 5 shows that value displayed in the line of text that reads:

Velocity magnitude = 3.00 miles/hour

(Note that very few of the values that I display in these modules comply with the rules for decimal digits and significant figures that I explained in anearlier module.)

A partial solution to the problem

A partial answer to the question posed for this exercise is that the magnitude of the man's overall velocity with respect to the ground is 3 milesper hour as shown in Figure 5 .

The rest of the solution

The next statement in Listing 3 uses a similar syntax to retrieve the value from the second element in the array object (the element with an index value of1) and to display it as

Velocity angle = 0.00 degrees

as shown in Figure 5 .

This means that the man is moving due east (the same direction that the train is moving) with a velocity of 3 miles per hour with reference to the ground.

Analysis of the results

Now I will tell you why I used a strange walking speed (2.933 feet per second) for the man. As it turns out, this is very close to 2 miles per hour, and Iwanted the man to have a walking speed that would result in simple numeric results.

Let's review the problem

The train is moving east with a uniform velocity of 1 mile per hour relative to the ground.

The man is moving east with a uniform velocity of 2 miles per hour (2.933 feet per second) relative to the train.

What is the man's velocity relative to the ground?

The algebraic sum of the magnitudes

Because the man and the train are both moving along the same straight line, and the man's velocity is stated relative to the train, the magnitude of the man's velocityrelative to the ground is the algebraic sum of the magnitudes of the two velocities. Because they are both moving in the same direction, that algebraicsum is additive.

An analysis of the velocities

The train is moving 1 mile per hour with reference to the ground, and the man is moving 2 miles per hour with reference to the train (along the same line andin the same direction as the train). Therefore, the man is moving 1+2=3 miles per hour with reference to the ground.

This means that an observer standing on the ground at a point on a line perpendicular to the train would perceive the man to be moving to the to theright with a velocity of 3 miles per hour (assuming that the train is moving to the right).

A zero-degree angle is not required

Note that it isn't necessary that the train and the man be moving at an angle of zero degrees (east). The magnitude of the result would be the same regardless of thedirection that they are moving provided they are moving along the same straight line.

We will specify a different common direction for the train and the man in the next exercise.

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask