Stretching out an array

后端 未结 3 1797
梦谈多话
梦谈多话 2021-02-08 11:03

I\'ve got a vector of samples that form a curve. Let\'s imagine there are 1000 points in it. If I want to stretch it to fill 1500 points, what is the simplest algorithm that g

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 11:17

    Simplest option I can think of is just a fn that expands the array based on mean averages, so:

    x,y,z

    becomes

    x, avg(x,y), y, avg (y,z), z

    If you need more data points, just run it multiple times on the vector.

提交回复
热议问题