Introduction to Game Programming with C++ (Wordware Game Developers Library)

3.7 Square Numbers and Square Roots

Subsequent sections focus on examining trigonometry and the importance of right triangles. However, before proceeding we should investigate square numbers and square roots.

Square numbers are the results of numbers that are multiplied by themselves, such as 1 × 1, 2 × 2, 3 × 3, 4 × 4, and so on.The first few square numbers are:

The square roots of those numbers refer to the number which when multiplied by itself would equal that result. So the square root of 4 is 2 because 22 = 4. When a number is squared, we do not typically write, say, 4×4. We saw in an earlier chapter that we use an exponent, such as 42.

Similarly, there is a notation for writing square roots. For this, we use the radical symbol. The number written underneath the radical is called the radicand. An example follows.

Figure 3.15

Категории