Re: XForms: xyplot problem

moini@eleceng.adelaide.edu.au
Fri, 2 Oct 1998 15:05:01 +0930 (CST)

# To subscribers of the xforms list from moini@eleceng.adelaide.edu.au :

>
> Interesting problem. This might be a problem that has no
> solution. If you look at the data carefully, once the data
> is mapped into pixel space, the derivative at each point
> is more than 5,000, i.e., vertical lines. (sin(0) is 0,
> sin(1) is about 0.85. You want to map -0.001 to y=10 and
> -0.001 to about y=200 pixels, this means at point 0 (sin(0),
> y is about 100, at point 1 (sin(1)), y is about -75,000, i.e.,
> way outside the window. If you try to draw such a line
> (0,100) to (10,75000), you'll get a vertical line). This
> has nothing to do with precision.

Absolutely right. So the line is actually wrapped around and is drawn many
times. The simplest solution would be, during the conversion from float to
XPoint, to clamp the large numbers to 2^16-1 as you said.
I don't know how the internals of the xyplot work, but if the conersion is
done only once, and then other translation and scaling toolkits are used
for zooming and x/ybounds, then everytime that something happens all the
curves should be converted, which may make the things a bit sluggish.
But it would be better than the crash.
Cheers

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/