Sie sind auf Seite 1von 4

A Quick Assesment of Automatic Curve Discretization

Conte do u
1 Problem Statement 2 Dening Accuracy 2.1 y=f(x) error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 x=f(y) error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Distance error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Solutions 3.1 Laying the path . . . 3.2 Curvature . . . . . . 3.3 Simulated Annealing 3.4 GA . . . . . . . . . . 3 3 3 3 3 4 4 4 4 4

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

Problem Statement

In numerical number crunching it is frequently faster to implement 1d functions as a table lookup algorithm with linear interpolation, specially if the function has a high computional cost. In order to obtain a good performance it is necessary to minimize the number of points in the table (the search time should be O(lg(N)) at worst). But at the same time it is important to guarantee that acucracy is not lost in the discretization. It is thus desirableto to use an algorithm that generates the discretization guaranteeing a minimum accuracy, and at the same time producing a discretization with the minimum number of segments, or with a reasonaly small number of segments.

Dening Accuracy

To specify a minimum accuracy it is necessary to dene it in a more precise way. A few dierent possible denitions: Distance error y=f(x) error x=f(y) error combinations of the above

2.1

y=f(x) error

If we are to supply a table lookup / interpolation routine that returns y=f(x), this is the only criteria required for generating the table.

2.2

x=f(y) error

Same as the previous.

2.3

Distance error

Specially for visual representations, it may be more useful to employ a maximum distance criteria. One more step is still required to be able to perform the curve generation. We now have a local criteriafor accepting a certain segment as a good enough representation of the target function. But it is still necessary to have a number to represent the quality of the set of segments chosen. The most natural and immediate criteria is the sum of the squared errors of all the segments.

1 0 tx 0 1 ty 0 0 1

3
3.1

Solutions
Laying the path

In this algorithm the initial node is set at the desired starting point. The next node then is set as the next node is then dened by a trial and error algorithm (binary search, or golden ration search) that looks for the next (rst) point in the curve that matches the minimum quality criteria. It is of no use at this point to try to improve on quality (reducing the length of the segment) beyond that, since we would be increasing the number of segments.

3.2

Curvature

Using the local curvature as a criteria.

3.3 3.4

Simulated Annealing GA

Referncias e
[1] Foley, van Dam, Feiner, Hughes, Phillips, Introduction to Computer Graphics Addison-Wesley, 2nd Edition, 1983. [2] Hearn , Baker, Computer Graphics Prentice Hall, 2nd Edition, 1997. [3] Rezende, Stol, Fundamentos de Geometria Computacional IX Escaola de Computaao, 1994. c

Das könnte Ihnen auch gefallen