O'Reilly logo

Beginning Math and Physics for Game Programmers by Wendy Stahler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2, “Geometry Snippets”

Pythagorean Theorem

In a right triangle, the square of the length c of the hypotenuse is equal to the sum of the squares of the lengths a and b of the other two sides: c2 = a2 + b2.

Distance Formula in 2D

where P1(x1,y1) and P2(x2,y2) are points on the line.

Distance Formula in 3D

where P1(x1,y1,z1) and P2(x2,y2,z2) are points on the line.

Midpoint Formula in 2D

is the midpoint between P1(x1,y1) and P2(x2,y2).

Midpoint ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required