Split numpy array into similar array based on its content
take the length of the line on every axes, the split as you want.
example:
point 1: [0,0]
point 2: [1,1]
then:
length of the line on X axes: 1-0 = 1
also in the Y axes.
now, if you want to split it in two, just divide these lengths, and create a new array.
[0,0],[.5,.5],[1,1]
I have a 2D numpy array that represents the coordinates (x, y) of a curve, and I want to split that curve into parts of the same length, obtaining the coordinates of the division points.
The most easy example is a line defined for two points, for example [[0,0],[1,1]], and if I want to split it in two parts the result would be [0.5,0.5], and for three parts [[0.33,0.33],[0.67,0.67]] and so on.
How can I do that in a large array where the data is less simple? I'm trying to split the array by its length but the results aren't good.