Coverts list of point locations to a set of equally spaced points through linear interpolation.
equa_dist_points_angle(df, num_splits = 13)
df | 2 column data frame with all points (x,y) |
---|---|
num_splits | integer number of points for the path to be represented in |
new_compression data.frame (num_splits x 2) of points along the path equally spaced
library(dplyr) my_df <- data.frame(x = 1:20) %>% mutate(y = x) my_df_compression <- equa_dist_points_angle(my_df) my_df_compression#> x y #> 1 1.000000 1.000000 #> 2 2.583333 2.583333 #> 3 4.166667 4.166667 #> 4 5.750000 5.750000 #> 5 7.333333 7.333333 #> 6 8.916667 8.916667 #> 7 10.500000 10.500000 #> 8 12.083333 12.083333 #> 9 13.666667 13.666667 #> 10 15.250000 15.250000 #> 11 16.833333 16.833333 #> 12 18.416667 18.416667 #> 13 20.000000 20.000000