Pythagorean Theorem

Finally, we come to the Pythagorean Theorem. Im not sure how officially this is a part of trigonometry, but its pretty interwoven with the subject and is another formula that you will use a lot. So, this is the best place to put it.

Pythagorus was a Greek guy who lived a long time ago. Thats your history lesson. Simply stated, his theorem says A squared + B squared = C squared. Now, if you know what the theorem is all about beforehand, that communicates it perfectly . Otherwise, it sounds like some kind of bizarre nursery rhyme . So lets explore it in more depth.

A more descriptive statement of the theorem is the sum of the squares of the two legs of a right triangle is equal to the square of the hypotenuse . Thats a mouthful. Say you have the triangle shown in Figure 3-21.

image from book
Figure 3-21: A right triangle

The two legs, A and B, have measurements of 3 and 4. The hypotenuse, C, measures 5. Mr. Pythagorus tells us that A 2 + B 2 = C 2 . Lets test it. Plug in the numbers , and you have 3 2 + 4 2 = 5 2 , which works out to 9 + 16 = 25. Yup, that works out pretty well.

Now, if you happen to know all three measurements like that, the Pythagorean Theorem is nothing more than an interesting relationship. But, if you know only two of the measurements, it becomes a powerful tool to quickly find the third. In Flash, the most common situation is where you know the lengths of the two legs and you want to know the hypotenuse. Specifically, you want to find the distance between two points.



Foundation ActionScript. Animation. Making Things Move
Foundation Actionscript 3.0 Animation: Making Things Move!
ISBN: 1590597915
EAN: 2147483647
Year: 2005
Pages: 137
Authors: Keith Peters

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