bound.angle | R Documentation |
The function calculates the angle of azimuth from a Cartesian coordination given in X
and Y
to a nearest neighbor coordinate
given by nX
and nY
. The nearest neighbor coordinates can be obtained using the function near.bound
.
bound.angle(X, Y, nX, nY)
X |
Cartesian X coordinate of interest. |
Y |
Cartesian Y coordinate of interest. |
nX |
Cartesian X coordinate of nearest neighbor point on a boundary. |
nY |
Cartesian Y coordinate of nearest neighbor point on a boundary. |
The function returns the nearest neighbor angles (in degrees) with respect to a four coordinate system ala ARC-GIS Near(Analysis).
Output angles range from -180^{\circ}
to 180^{\circ}
: 0^{\circ}
to the East, 90^{\circ}
to the North, 180^{\circ}
(or -180^{\circ}
) to the West,
and -90^{\circ}
to the South.
Returns a vector of nearest neighbor angles.
Ken Aho
near.bound
, prp
bX<-seq(0,49)/46
bY<-c(4.89000,4.88200,4.87400,4.87300,4.88000,4.87900,4.87900,4.90100,4.90800,
4.91000,4.93300,4.94000,4.91100,4.90000,4.91700,4.93000,4.93500,4.93700,
4.93300,4.94500,4.95900,4.95400,4.95100,4.95800,4.95810,4.95811,4.95810,
4.96100,4.96200,4.96300,4.96500,4.96500,4.96600,4.96700,4.96540,4.96400,
4.97600,4.97900,4.98000,4.98000,4.98100,4.97900,4.98000,4.97800,4.97600,
4.97700,4.97400,4.97300,4.97100,4.97000)
X<-c(0.004166667,0.108333333,0.316666667,0.525000000,0.483333333,0.608333333,
0.662500000,0.683333333,0.900000000,1.070833333)
Y<-c(4.67,4.25,4.26,4.50,4.90,4.10,4.70,4.40,4.20,4.30)
nn<-near.bound(X,Y,bX,bY)
bound.angle(X,Y,nn[,1],nn[,2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.