Finds the optimal reparametrization of the second curve (stored in data_curve2) to the first one (stored in data_curve1) with respect to the elastic distance. Constructor function for class aligned_curves.
data_curve1: data.frame with observed points in each row. Each variable is one coordinate direction. If there is a variable t, it is treated as the time parametrization, not as an additional coordinate.
data_curve2: same as data_curve1
closed: TRUE if the curves should be treated as closed.
eps: convergence tolerance
Returns
an object of class aligned_curves, which is a list
with entries - data_curve1: data_curve1 with parametrization variable t
data_curve2_aligned: data_curve2 with initial parametrization variable t and optimal parametrization t_optim
elastic_dist: elastic distance between curve1 and curve2
closed: TRUE if the curves should have been treated as closed.