planarSection: Sphere planar sections

Description Usage Arguments Details Value Author(s) Examples

View source: R/spheroid.R

Description

Planar intersection of spheres

Usage

1
planarSection(S, d, intern = FALSE, pl = 0)

Arguments

S

list of spheres of class sphere, see simPoissonSystem

d

distance of the (planar) xy-plane to the origin

intern

logical, FALSE (default), whether to return all discs or only those which have their centers inside the intersecting window

pl

print level, pl>0 for some verbose output

Details

The function computes the planar intersection of a sphere system, i.e. an intersection with the plane whose normal vector is given by c(0,0,1) and returns the diameters of the resulting discs.

Value

numeric vector of disc diameters

Author(s)

M. Baaske

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 lam <- 100
 
 # parameter rlnorm distribution (radii)
 theta <- list("size"=list("meanlog"=-2.5,"sdlog"=0.5))
 
 # simulation bounding box
 box <- list("xrange"=c(0,5),"yrange"=c(0,5),"zrange"=c(0,5))
 
 # simulate only 3D system
 S <- simPoissonSystem(theta,lam,size="rlnorm",box=box,type="spheres",
   intersect="original", pl=1)
 
 # return only objects whose centers are within
 # the intersection window
 sp <- planarSection(S,d=2.5,intern=TRUE,pl=1)
 
 # histogram of diameters
 hist(sp)
 summary(sp)
 
 # distribution of radii
 mean(log(sp/2))
 sd(log(sp/2))

unfoldr documentation built on Sept. 25, 2021, 1:07 a.m.