Description Usage Arguments Value Examples
Generate polypon points for Ramer–Douglas–Peucker algorithm visualization.
1 | GeneratePolygon(pt1, pt2, dist = 1)
|
pt1 |
. |
pt2 |
. |
dist |
. |
a matrix with dimension 4*2 denoting the 4 vertices of the polygon.
1 2 3 4 5 | library(ggplot2)
point_set <- rbind(c(0,0),c(2,2))
GeneratePolygon(point_set[1,],point_set[2,])
df <- data.frame(t(GeneratePolygon(point_set[1,],point_set[2,],dist=0.2)))
ggplot(df,aes(X1,X2)) + geom_polygon(fill='lightblue',alpha=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.