lineSegmentsCRSConversion: Line segments Coordinate Reference System conversion

Description Usage References Examples

View source: R/lineSegmentsCRSConversion.R

Description

Line segments conversion from a angles-length-centers to endpoints coordinates

Usage

1

References

equation 1.78, page 56 of D:/IMP/Transferencia/ReporteMetodologiasDFN_FmendozaT.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
ae <- circular(c(0, 45, 90, 135),units="degrees",
               template="geographics")
le <- c(2, sqrt(2) * 3, 3, sqrt(2) * 3)
ends <- data.frame(x0 = c(0, 1, 1, -1),
                   y0 = c(1, 1, 0,  1),
                   x1 = c(0, 4, 4, -4),
                   y1 = c(3, 4, 0,  4)
)
xe <- data.frame(a = ae, l = le,
                   x = (ends$x0 + ends$x1) / 2,
                   y = (ends$y0 + ends$y1) / 2)
plotSegments(
  segment=list( g1 = list(x0 = ends$x0, y0 = ends$y0,
                          x1 = ends$x1, y1 = ends$y1)),
  asp=1, main="Segments")
points.default(xe$x, xe$y, pch=20) # adding the midpoints to the current plot
print(ends)
lineSegmentsCRSConversion(x = xe)

mathphysmx/percolation documentation built on Aug. 14, 2019, 2:03 a.m.