| isPointOnBoundary | R Documentation |
This function checks if a point P is on a polygon boundary.
isPointOnBoundary(xPoint, yPoint, boundary)
xPoint |
x coordinate of point P. |
yPoint |
y coordinate of point P. |
boundary |
A data frame with four columns representing segments comprising the boundary. |
Logical; whether the point is on the boundary.
pointsDF <- data.frame(x = c(1, 2, 4, 7, 10,
12, 13, 15, 16),
y = c(1, 1, 2, 3, 3, 2,
1, 2, 1))
hullIndices <- grDevices::chull(pointsDF[, 1], pointsDF[, 2])
hull <- convexHull(pointsDF, hullIndices)
hullSegments <- pointsToSegments(hull)
isPointOnBoundary(2, 3, hullSegments)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.