Game Development Reference

In-Depth Information

a

b

c

.

(B.24)

=

=

sin

α

sin

β

sin

γ

Now observe the following Pythagorean relationships in the triangle shown

in Figure B.3.

2

2

2

+=

++=

x

yb

(

)

2

2

2

ax

y c

(B.25)

Solving the first equation for

y
and substituting into the second equation gives

us

(

)

c

2

=+ +−

=++

ax b x

ab x

2

2

2

2

2

2.

(B.26)

The value of
x
can be replaced by observing

x

πγ
b

(

)

cos

−=

.

(B.27)

(

)

Since

cos

πγ

−=−

cos

γ

, we have

=−

b γ

cos

.

(B.28)

x

Plugging this into Equation (B.26) produces the
law of cosines
:

2

2

2

c

=+−

ab bγ

2 s

.

(B.29)

Of course, this reduces to the Pythagorean theorem when
γ
is a right angle since

cos

π

2

=

0

.

Search Nedrilad ::

Custom Search