Re: [R] to draw a smooth arc

From: Jim Lemon <jim_at_bitwrit.com.au>
Date: Wed, 02 May 2007 20:16:51 +1000

(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_at_stat.math.ethz.ch mailing list
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. Received on Wed 02 May 2007 - 10:19:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 May 2007 - 10:31:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.