Edge2 | R Documentation |
An edge is given by two vertices in the 2D space,
named A
and B
. This is for example an edge of a Voronoï cell
of a 2D Delaunay tessellation.
A
get or set the vertex A
B
get or set the vertex B
new()
Create a new Edge2
object.
Edge2$new(A, B)
A
the vertex A
B
the vertex B
A new Edge2
object.
edge <- Edge2$new(c(1, 1), c(2, 3)) edge edge$A edge$A <- c(1, 0) edge
print()
Show instance of an Edge2
object.
Edge2$print(...)
...
ignored
Edge2$new(c(2, 0), c(3, -1))
plot()
Plot an Edge2
object.
Edge2$plot(color = "black", ...)
color
the color of the edge
...
graphical parameters such as lty
or lwd
library(tessellation) centricSquare <- rbind( c(-1, 1), c(1, 1), c(1, -1), c(-1, -1), c(0, 0) ) d <- delaunay(centricSquare) v <- voronoi(d) cell5 <- v[[5]] # the cell of the point (0, 0), at the center isBoundedCell(cell5) # TRUE plot(centricSquare, type = "n") invisible(lapply(cell5[["cell"]], function(edge) edge$plot()))
stack()
Stack the two vertices of the edge (this is for internal purpose).
Edge2$stack()
clone()
The objects of this class are cloneable with this method.
Edge2$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `Edge2$new`
## ------------------------------------------------
edge <- Edge2$new(c(1, 1), c(2, 3))
edge
edge$A
edge$A <- c(1, 0)
edge
## ------------------------------------------------
## Method `Edge2$print`
## ------------------------------------------------
Edge2$new(c(2, 0), c(3, -1))
## ------------------------------------------------
## Method `Edge2$plot`
## ------------------------------------------------
library(tessellation)
centricSquare <- rbind(
c(-1, 1), c(1, 1), c(1, -1), c(-1, -1), c(0, 0)
)
d <- delaunay(centricSquare)
v <- voronoi(d)
cell5 <- v[[5]] # the cell of the point (0, 0), at the center
isBoundedCell(cell5) # TRUE
plot(centricSquare, type = "n")
invisible(lapply(cell5[["cell"]], function(edge) edge$plot()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.