Sample data defining an enclosed spiral 2D polygon.
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Load polygon.
data(spiral)
# Plot the polygon.
plot(rbind(spiral,spiral[1,]),type="l")
# Generate 3333 random test points.
set.seed(1902)
n <- 3333
x1 <- rnorm(n) ; x2 <- rnorm(n)
X <- cbind(x1,x2)
queries <- as.matrix(X)
# Check whether test points are contained in the polygon.
# Most of these points will lie outside the polygon.
containment = pip2d(spiral,queries);
|
Loading required package: misc3d
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.