transport (version 0.12-2)

power_diagram: Compute the Power Diagram of Weighted Sites in 2-Dimensional Space

Description

Compute the power diagram of weighted sites in 2-dimensional space.

Usage

power_diagram(xi, eta, w, rect = NA)
# S3 method for power_diagram
plot(x, weights=FALSE, add=FALSE, col=4, lwd=1.5, ...)

Arguments

xi,eta,w

vectors of equal length, where xi, eta are the coordinates of the sites and w are the corresponding weights.

rect

vetor of length 4. To get a finite representation of the power diagram, it will be intersected with the rectangle \([rect[1],rect[2]] \times [rect[3],rect[4]]\). Defaults to c(min(xi),max(xi),min(eta),max(eta)).

x

a power diagram as returned from power_diagram.

weights

logical. If TRUE, weights of non-redundant sites with non-negative weight are represented as circles whose radii are equal to the square roots of the corresponding weights.

add

logical. Should the power diagram be plotted on top of current graphics?

col,lwd,...

further arguments graphic parameters used by plot.default.

Author

Björn Bähre bjobae@gmail.com
(slightly modified by Dominic Schuhmacher dschuhm1@uni-goettingen.de)

Details

The function power_diagram implements an algorithm by Edelsbrunner and Shah (1996) which computes regular triangulations and thus its dual representation, the power diagram. For point location, an algorithm devised by Devillers (2002) is used.

References

H. Edelsbrunner, N. R. Shah (1996), Incremental Topological Flipping Works for Regular Triangulations, Algorithmica 15, 223--241.

O. Devillers (2002), The Delaunay Hierarchy, International Journal of Foundations of Computer Science 13, 163--180.

Examples

Run this code
    xi <- runif(100)
    eta <- runif(100)
    w <- runif(100,0,0.005)
    x <- power_diagram(xi,eta,w,rect=c(0,1,0,1))
    plot(x,weights=TRUE)

Run the code above in your browser using DataLab