Pythagoras
From GPWiki
The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server. However, the GPWiki forums are still active! Come say hello. A triangle has sides A, B and C. The angle between A and B is 90° or π/2 radians. For the length of the sides the following goes: |\ | \ | \C A| \ |____\ B Pythagoras' Theorem states:
or
This allows us to calculate the length of a line in 2 dimensional space if we know the x and y coordinates of the endpoints. If the two points P and Q are given by: Then the length, L, of the line between two points P and Q is given by:
In 3D space, the z coordinates are included in a similar manner:
You can't do without Pythagoras, man. For more info see: Pythagorean Theorem on Wikipedia |
and


