currently I've been trying to shorten numeric arrays without the data values losing relativity to each other.
So first here is an example: Assume an array of length 5
var test = [ 1.0, 0.5, 0.2, 0.5, 1.0 ]; // sum = 3.2
now we want to shorten it to the length of 4 without changing or losing the "curve" it would display as in e.g. a graph.
// wanted output = [ 1.125, 0.475, 0.475, 1.125 ] // sum = 3.2
I've tried to find this under alot of different search terms but couldnt find any example code of what I was trying to do.