compute_hausdorff_distance() method for two streamline objects
Source: R/shape.R
compute_hausdorff_distance-fiber-streamline-method.Rdcompute_hausdorff_distance() method for two streamline objects
Arguments
- x
A streamline object.
- y
A streamline object.
Value
A non-negative numeric scalar equal to
\(\max(d_H(x \to y),\, d_H(y \to x))\), where
\(d_H(A \to B) = \max_{a \in A} \min_{b \in B} \|a - b\|_2\) is the
directed Hausdorff distance. The core computation is performed in C++
via hausdorff_distance_cpp().
Examples
pts1 <- matrix(runif(30), ncol = 3)
colnames(pts1) <- c("X", "Y", "Z")
pts2 <- matrix(runif(30), ncol = 3)
colnames(pts2) <- c("X", "Y", "Z")
sl1 <- streamline(points = pts1)
sl2 <- streamline(points = pts2)
compute_hausdorff_distance(sl1, sl2)
#> [1] 0.402474