align_curves | R Documentation |
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
.
align_curves(data_curve1, data_curve2, closed = FALSE, eps = 0.01)
data_curve1 |
|
data_curve2 |
same as |
closed |
|
eps |
convergence tolerance |
an object of class aligned_curves
, which is a list
with entries
data_curve1 |
|
data_curve2_aligned |
|
elastic_dist |
elastic distance between curve1 and curve2 |
closed |
|
#open curves
data_curve1 <- data.frame(x1 = c(1, 0.5, -1, -1), x2 = c(1, -0.5, -1, 1))
data_curve2 <- data.frame(x1 = c(0.1,0.7)*sin(1:6), x2 = cos(1:6))
aligned_curves <- align_curves(data_curve1, data_curve2)
plot(aligned_curves)
#different parametrization of the first curve
data_curve1$t <- 0:3/3
align_curves(data_curve1, data_curve2)
#closed curves
data_curve1 <- data.frame(x1 = sin(0:12/5), x2 = cos(0:12/5))
data_curve2 <- data.frame(x1 = c(1, 0.5, -1, -1), x2 = c(1, -0.5, -1, 1))
aligned_curves_closed <- align_curves(data_curve1, data_curve2, closed = TRUE)
plot(aligned_curves_closed, asp = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.