3.8 Right Triangles and the Pythagorean Theorem


3.8 Right Triangles and the Pythagorean Theorem

In order to discover the lengths of the sides of any polygon, we must measure. If we have plotted the vertices of any figure in a coordinate space, we can measure the length of the sides easily. However, in the above diagram, how can we calculate the length of the diagonal for this right triangle? Rather than simply measuring, is there a way, given the lengths of the other two sides, to obtain the length of the diagonal?

In a right triangle, the diagonal is the longest side and is called the hypotenuse. This side is always opposite the right angle. The ancient Greek mathematician Pythagoras discovered a method for calculating the length of the hypotenuse based upon the length of the other two sides. This is called the Pythagorean theorem.

The theorem is based on the idea of squares drawn onto each side of a right triangle-a square on every side, including the hypotenuse. It states that the square drawn on the hypotenuse will equal the square drawn on the other two sides. Take another look at Figure 3.16.

image from book
Figure 3.16

Note 

Remember, every side of a square is equal. To find the area of a square means to multiply the length of one side by itself-hence, to square a number. To find the length of one side, or rather to find the number before squaring, the square root is taken.

Therefore, the square on the hypotenuse can be calculated as follows:

  • Hyp2 = side12 + side22

Notice that since we are dealing with hypotenuse squared, in order to find the length of the hypotenuse, we must take the square root.




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

Similar book on Amazon
Beginning C++ Through Game Programming
Beginning C++ Through Game Programming
Beginning Game Programming
Beginning Game Programming
The Ultimate Guide to Video Game Writing and Design
The Ultimate Guide to Video Game Writing and Design

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net