# f: Density For Distance Between Two Points In Rectangles In spatialCovariance: Computation of Spatial Covariance Matrices for Data on 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

 `1` ```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.

David Clifford

## 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)

## Examples

 ```1 2 3``` ```d <- 0.75 f(d,rowwidth=1,colwidth=1,ax=0,bx=0,i=1,j=1) ## two points in a unit square f(d,rowwidth=1,colwidth=1,ax=1,bx=0,i=2,j=1) ## two points in squares, squares are side by side ```

### Example output

```[1] 1.056139
[1] 0.703125
```

spatialCovariance documentation built on May 2, 2019, 9:43 a.m.