geometry - How to optimally plot parametric continuous curve? -
let's have parametric curve, example circle:
x = r * cos(t) y = r * sin(t)
we want plot curve on screen in way that:
- every pixel painted once (the optimal part)
- there painted pixel each (x, y) lies on curve (the continuous part)
if plot (x, y) each t in [t1, t2], these conditions not met.
i searching general solution parametric curve.
a general solution 100% satisfies criteria not exist.
so have compromize.
usually tackled starting stepsize (usually parameter routine), stepsize can subdivided triggered heuristic e.g.:
subdivide when distance covered segment larger given distance (e.g. 1 pixel)
subdivide when curve direction changes much
or combination of these.
usually limit subdivision given avoid taking forever.
many systems offer parametric plotting start changeable default setting heuristic params , step size. user can adapt these if curve not "nice" enough or if takes long.
the problem there pathological curves defeat method of drawing making miss details or taking overly long.
Comments
Post a Comment