selfcut.psp | R Documentation |
Finds any crossing points between the line segments in a line segment pattern, and cuts the segments into pieces at these crossing-points.
selfcut.psp(A, ..., eps)
A |
Line segment pattern (object of class |
eps |
Optional. Smallest permissible length of the resulting line segments. There is a sensible default. |
... |
Ignored. |
This function finds any crossing points between
different line segments in the line segment pattern A
,
and cuts the line segments into pieces at these intersection points.
A crossing point occurs whenever one of the line segments in A
intersects another line segment in A
, at a nonzero
angle of intersection.
Another line segment pattern (object of class "psp"
)
in the same window as A
with the same kind of marks as
A
.
The result also has an attribute "camefrom"
indicating
the provenance of each segment in the result.
For example camefrom[3]=2
means that the third segment in the
result is a piece of the second segment of A
.
.
selfcrossing.psp
X <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
Y <- selfcut.psp(X)
n <- nsegments(Y)
plot(Y %mark% factor(sample(seq_len(n), n, replace=TRUE)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.