Game Development Reference
In-Depth Information
Chapter 6 Summary
Analytic Root Finding
Solutions to the quadratic equation
at
2
++=
bt
c
0
are given by the quadratic
formula:
2
−±
bb c
4
t
=
.
2
a
Cubic and quartic equations can also be solved analytically.
Numerical Root Finding
Roots of a function
()
f x can be found numerically using Newton's method,
which refines an approximate solution x using the formula
()
()
x
f
n
x
=−
x
.
n
+
1
n
f
x
n
The refinement formula for the reciprocal x of a number r is
(
)
x
=
x
2
rx
,
n
+
1
n
n
and the refinement formula for the reciprocal square root x of a number r is
1
(
)
x
=
x
3
rx
2
.
n
+
1
n
n
2
Intersection of a Ray and a Sphere
The points where a ray
()
PSV intersect a sphere of radius r are given by
the solutions of the quadratic equation
t
=+
t
22
(
)
2
2
.
Vt
+⋅
2
SV
t S
+−=
r
0
Normal Vector Calculation
The normal vector at a point
x yz on a surface defined by the function
,,
(
)
(
)
xyz
,,
=
0
is given by
=
xyz
,,
.
f
N
f
Reflection Vector Calculation
The reflection R of a vector L across the normal vector N is given by
Search Nedrilad ::




Custom Search