(b) Verify the new zero for p
(c) Deflate verified zero from pdeflated
This algorithm finds all roots of complex and real
polynomials. If AllCPolyZeros algorithm works with
a real polynomial (imaginary part of each coefficient
is zero) and a real initial approximation of ˜z ∈ R, it
will never get enclosures of a pair of conjugate com-
plex zeros of p(z), because all complex arithmetic op-
erations deliver a real result. However, for finding
a complex conjugate zero of a real polynomial, All-
CPolyZeros algorithm must start with a non-real ini-
tial approximation ˜z.
3 SPATIAL COHERENCE
In this section, some improvements to speed up of
CAllPolyZero algorithm are shown. This algorithm
needs an initial approximation ˜z to start the process.
If this parameter is near to the exact root then it is nec-
essary a few number of iterations. This means that is
necessary to supply a good initial approximation ˜z to
reduce the algorithm execution time.
Numerous optimization methods for ray tracing
have been suggested since it was first introduced
(Whitted, 1980). Many have suggested the exploita-
tion of spatial coherence (Glassner, 1989). Once a
single ray has been processed, a ray emitted for a
nearby pixel at a similar direction will hit, most likely,
a nearby target. We propose to exploit spatial coher-
ence, so that if a primary ray hit a surface in pixel
(j, k), it is very probable that the primary rays of
neighboring pixels hit the same object. These neigh-
boring pixels are (j−1, k−1), (j, k−1), (j+1, k−1),
(j − 1, k), (j + 1, k), (j − 1, k + 1), (j, k + 1) and
(j + 1, k + 1).
In order to find the initial approximation of the root
associated to pixel (j, k), we propose to choose the
average value of the roots in the neighboring pixels.
Following, we show how to compute this average ini-
tial approximation ˜z for pixel (j, k):
1. CAllPolyZero only can use the roots associated to
pixels: (j − 1, k − 1), (j, k − 1), (j + 1, k − 1) and
(j − 1, k). Notice that the roots associated to the
remaining neighboring pixels have not been com-
puted yet.
2. If a primary ray does not hit an object in a neighbor-
ing pixel, then this pixel is not used in this average.
3. If every primary rays of neighboring pixels does
not hit an object then the initial approximation ˜z is
0 + i.
4. If several primary rays of neighboring pixels hit
some objects:
(a) If the primary rays hit the same object, we cal-
culate only a single average value of the initial
approximation.
(b) If the primary rays hit several objects, several
average values of the initial approximations are
computed, one for each object.
4 RAY TRACING IN COMPLEX
SPACE
The previous sections describes our general algorithm
for computing all roots of a polynomial, and compu-
tations are done in the complex space. In this section,
we will briefly describe the technique used to com-
pute the colour of each pixel in an image rendered
by ray tracing techniques. The traditional ray tracing
uses the minimum positive root to assign the colour of
a pixel in real space. A complex number z = x + i · y
can be represented in complex space, like ρ · e
i·θ
, the
magnitude represents its modulus ρ and the angle θ its
complex argument (see Figure 1).
Figure 1: Sampling complex space.
In our algorithm the selected root is that with the
minimum magnitude and with its complex argument
θ in a selected range given by σ ≤ θ ≤ σ + δ. The
selected root will determine the final colour of a pixel.
This means that the rendering process is guided not
only by the magnitude of the roots but also it can play
with their complex arguments. This algorithm will
allow to sample the complex space, so that different
images can be obtained by choosing the interval angle
[σ, σ + δ] (see Figure 1). For example, for rendering
a scene in the real space, σ = 0 and δ = 10
−10
are
appropriate values. However, for σ = 0.1 and δ =
π
4
,
the selected roots belong to the complex space with
angles between 0.1 ≤ θ ≤ 0.1 +
π
4
and their complex
VISAPP 2006 - IMAGE FORMATION AND PROCESSING
142