Game Development Reference

In-Depth Information

The discriminant is then given by

(

)

′

3

′

2

D

=−

108

pq

+

.

(6.15)

Setting

D

(

)

′

′

3

′

2

D

=

−+

pq

(6.16)

108

lets us express
r
and
s
as

r

=−+−

3

q

′

D

′

3

′

′

s

=−−−

q

D

.

(6.17)

As with quadratic equations, the discriminant gives us information about how

many real roots exist. In the case that

, the value of
x
given in Equation

(6.13) represents the only real solution of Equation (6.9).

′
<

D

0

In the case that

′
=

, we have
rs

=

, so there are two real solutions, one of

D

0

which is a double root:

x r

xx ρ ρ r

=

=+

2

1

(

)

2

,

=−

r

.

(6.18)

23

′
>

, Equation (6.13) yields three distinct real

solutions. Unfortunately, we still have to use complex numbers to calculate these

solutions. An alternative method can be applied in this case that does not require

complex arithmetic. The method relies on the trigonometric identity

In the remaining case that

D

0

3

4cos

θ

−

3cos

θ

=

cos 3

θ

,

(6.19)

which can be verified using the Euler formula (see Exercise 1 at the end
of this

chapter). Making the substitution

=

2

m θ

cos

in Equation (6.9) with

mp

=−

3

,

x

gives us

8

m

3

cos

3

θ pm θ q

+

2

cos

+

=

0

.

(6.20)

(Note that
p
must be negative in order for
D

′

to be positive.) Replacing
p
with

−

3
m

2

2
m
out of the first two terms yields

3

and factoring

(

)

2

m

3

4 cos

3

θ

−

3cos

θ q

+

=

0

.

(6.21)

Search Nedrilad ::

Custom Search