
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
sl1 <- streamline(points = cbind(X = runif(10), Y = runif(10), Z = runif(10)))
sl2 <- streamline(points = cbind(X = runif(10), Y = runif(10), Z = runif(10)))
compute_hausdorff_distance(sl1, sl2)
#> [1] 0.7950254