Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] to draw a smooth arc

Jim Lemon

2007-05-02

Replies:

(Ted Harding) wrote:
> This thread prompts me to ask about something I've
> been pondering for a while, as to whether there's an
> implementation somewhere ticked away in the R resources.
>
> So far, people have been responding to the original query
> in terms of increasing the numbers of points, and joining
> these by lines.
>
> However, if you're using PostScript output, you can draw
> really smooth curves by exploiting PS's "curveto" operator.
> This draws a cubic-curve segment in the following way:
>
> ...
> Anyway. The Question: is there a general function for the
> above kind of smooth curve-drawing?
>
Hi Ted,
My experience with this some years ago was in anti-aliasing visual
stimuli presented on a PC monitor. The intended line was calculated
pixel by pixel and the each pixel that the line touched was assigned a
value based on a sawtooth function. The peak of the function was always
exactly on the intended line and the luminance of the pixel was a linear
function of the distance of its center along a perpendicular to the
line. We used the width of a pixel as the lateral extent of the function
with adequate success. The lines appeared smooth until the viewer could
resolve the individual pixels. Wider lines used a trapezoidal
distribution of luminance with the same slope on the limbs. I must note
that we did not have to create our stimuli in real time, and this method
might be too slow. However, I am fairly certain that if the function
knew about the characteristics of the output device, one could base a
curveto function on this.

Jim

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
©2008 r-help.com - Jax Systems, LLC, U.S.A.