circular2xy: Calculate XY coordinates based on distance and bearing

Description Usage Arguments Value Examples

View source: R/circular2xy.R

Description

Function converts distance and bearing into XY coordinates. It is useful to generate stem maps (forestry) based on field data (in forestry usually distance and bearing to a tree from a plot center are collected to define tree locations). Optionally center coordinates of the plot may be provided.

Usage

1
circular2xy(distance, bearing, center.x = 0, center.y = 0)

Arguments

distance

a vector of distances.

bearing

a vector of bearings, in degrees (0 - 360).

center.x

An x coordinate of a plot center

center.y

An y coordinate of a plot center

Value

a data frame with x and y columns

Examples

1
2
3
4
d <- runif(10,min = 0.5,max=10)
b <- runif(10,min = 0,max=360)
plot(circular2xy(d,b))
plot(circular2xy(d,b,1000,2500))

ptompalski/UsefulRFunctions documentation built on May 26, 2019, 11:32 a.m.