f: Density For Distance Between Two Points In Rectangles
Description
This evaluates the density for the distance between two
points, each distribution uniformly and independently in rectangles.
The rectangles are congruent and lie on a lattice. Three special
cases exist, when the two rectangles
coincide, when the two rectangles lie on the same row
(or column) of the lattice and when the
two rectangles lie on different rows and columns.
Usage
f(d, rowwidth, colwidth, ax, bx, i, j)
Arguments
d
distance
rowwidth, colwidth
Dimensions of the rectangle
ax,bx
Coordinate of the lower left corner of the second
rectangle. Lower left corner of the first is at the origin
i,j
Second rectangle lies in i-th row and j-th column of lattice.
References
B. Ghosh "Random distances within a rectangle and between two
rectangles", Bulletin of the Calcutta Mathematical Society, 1951, 43, 17-24
D. Clifford, "Computation of Spatial Covariance Matrices", JCGS, March 2005, vol. 14, no. 1, pp. 155-167(13)
d <- 0.75
f(d,rowwidth=1,colwidth=1,ax=0,bx=0,i=1,j=1) ## two points in a unit squaref(d,rowwidth=1,colwidth=1,ax=1,bx=0,i=2,j=1) ## two points in squares, squares are side by side