Displaying 1 result from an estimated 1 matches for "x_rdm".
Did you mean:
x_rd
2006 Oct 07
1
random point in a circle centred in a geographical position
...(289800)
> y_utm<-c(4603900)
> coord<-as.data.frame(cbind(x_utm,y_utm))
# Generate a random radius with a maximum distance of 1000 meters from the original location.
>radius<-runif(1,0,1000)
# Generate a random angle
>angle<-runif(1,0,360)
#Generate a random x coordinate
>x_rdm<-coord$x_utm[1]+radius*cos(angle)
#Generate a random y coordinate
>y_rdm<-coord$y_utm[1]+radius*sin(angle)
>result<-as.data.frame(cbind(x_rdm,y_rdm, x_utm, y_utm))
# We can calculate the distance between the original and the random location
> result$dist_m<-sqrt(((coord$x_utm-r...