cachai.utilities.equidistant

cachai.utilities.equidistant(points)[source]

Resamples points along a curve to make them equidistant while preserving the overall shape.

Parameters
pointsnumpy.ndarray

1D array of points (x,y) defining the reference curve.

Returns

numpy.ndarray : 2D array

Examples

import cachai.utilities as chu
import numpy as np

# Create a non-uniform curve
original_points = np.array([[0, 0], [1, 2], [3, 1], [4, 4]])

# Make points equidistant
equal_points = chu.equidistant(original_points)

print(equal_points)
[[0.         0.        ]
 [1.27614237 1.86192881]
 [3.19526215 1.58578644]
 [4.         4.        ]]