dirProj: Computes new coordinates given bearings and distances.

View source: R/dirProj.r

dirProjR Documentation

Computes new coordinates given bearings and distances.

Description

Computes new coordinates from bearings (North = 0) and distances

Usage

dirProj(df,deg=TRUE)

Arguments

df

a matrix or data frame of 4 columns giving x, y coordinates, bearings and distances

deg

if TRUE (default) bearings are in degree, otherwise in radian

Details

Computings are based on euclidian distance. Therefore, the coordinates should be given in a projected (plan) system (e.g. UTM, Lambert, etc.) and the distance in the same units as the projection system (e.g. meters).

Value

a matrix of two columns with the projected coordinates

See Also

distSeg

Examples


df<-data.frame(x1=0,y1=0,alpha=runif(3,0,360),d=runif(3,0,1))
df
plot(-1:1,-1:1,type="n")
points(0,0,pch=19)
points(dirProj(df))
text(dirProj(df)[,1],dirProj(df)[,2],1:3,pos=4)

pgirmess documentation built on May 29, 2024, 4:26 a.m.

Related to dirProj in pgirmess...