[Jprogramming] Re: Evening output

Raul Miller rauldmiller at gmail.com
Fri Dec 28 05:41:20 HKT 2007


On 12/27/07, Devon McCormick <devonmcc at gmail.com> wrote:
> Well, something like
>   1 o. _1 o. 8%~i:49
> just gives me a straight line.

I see two problems here.

First, if you want variable x, you need to include your x axis
values in the data you send to plot.

Second, the domain of _1&o. lies between _1 and 1

Try:
   plot (;1&o.) _1 o. 8%~i:49

> In any case, I'm looking for a solution to evenly space the results
> of any function - sine is only an example function.

I think this amounts to solving for k=((dx%dt)^2)+(dy%dt)^2)
for some arbitrary function y of x so you can find the arbitrary
function x of t.

Instead of trying to approach this directly, I might try generating lots
of extra points, and then finding the distance between each point
and then doing a sum scan on them and then using I. to find points
roughly separated by an even interval and using those indices to
select from your original surplus of points.  (That said, I have not
tested this approach -- and note that ill-behaved functions could
still have unevenly spaced points, or other such issues.)

-- 
Raul


More information about the Programming mailing list