# create data.frame of trees with polar coordinates and diameters
trees <- data.frame(
x = rep(c(0, 10), each = 2),
y = rep(c(0, 10), each = 2),
z = rep(c(0, 2), each = 2),
azimuth = rep(c(0, pi / 3)),
dist = rep(c(2, 4)),
slope = rep(c(0, pi / 6)),
diameter.cm = c(15, 20, 25, 30)
)
trees
# compute projected coordinates
polar2Projected(trees$x, trees$y, trees$z, trees$azimuth, trees$dist,
trees$slope,
declination = 0.03, convergence = 0.02, trees$diameter.cm / 100
)
Run the code above in your browser using DataLab