Re: graph smoothing algorithm


[Prev][Next][Index][Thread]

Re: graph smoothing algorithm



At 04:09 PM 11/18/96 -0500, Tony Lieuallen wrote:
>for y=whatever to whatever
>xold=x
>yold=y
>figure out x
>line from (xold,yold) to (x,y)
>loop
>
>(note that that is just pseudocode)
>not really that hard


This works, but not for the application in which I need it. The problem is
that I need to do PtOff for the line between (xold,yold) and (x,y). It's
part of a simple (it used to be simple anyway) inequality-graphing program
(I wanted it to draw a blank line between the shading and the graph, and to
make the graphed line dotted if it's a > or < equation). Since I have to use
PtOff to make the dots white, this method would work.


Idea:
If I just lower the delta-x value i use to calculate the y-values, then I
could also get a smoother graph. The disadvantage here is that it would slow
things down, and lines that have really steep slopes or curves (like y>5x-6)
would still not be smooth enough.


Any ideas?


--Ludwig
----------------------------------------------------------------------
<a href="mailto:ludwigp@sns.com">ludwigp@sns.com</a>     http://www.sns.com/~ludwigp <- Updated 11/5/96
PGP Key &amp; Geek Code available on web page


References: