runif_on_spherePatch | R Documentation |

Uniform sampling on a spherical patch (in dimension 3).

```
runif_on_spherePatch(n, r = 1, phi1, phi2, theta1, theta2)
```

`n` |
number of simulations |

`r` |
radius |

`phi1, phi2` |
numbers defining the latitudinal angle range |

`theta1, theta2` |
numbers defining the longitudinal angle range |

A sphere patch is the part of the sphere whose polar angles
`theta`

and `phi`

satisfy
`0 <= theta1 <= theta <= theta2 <= 2*pi`

and
`0 <= phi1 <= phi <= phi2 <= pi`

.

The simulations in a `n`

times `3`

matrix.

`runif_on_stri`

for sampling on a spherical triangle.

```
# sampling on the first orthant:
sims <-
runif_on_spherePatch(100, phi1 = 0, phi2 = pi/2, theta1 = 0, theta2 = pi/2)
## Not run:
library(rgl)
spheres3d(0, 0, 0, color = "red", alpha = 0.5)
points3d(sims)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.