Learn R Programming

spatstat.geom (version 3.7-2)

SupportFun: Support Function

Description

Create the support function of a two-dimensional domain.

Usage

SupportFun(W, origin = c(0, 0))

Arguments

Value

A function in the R language with one argument theta.

Details

The support function \(h_W(\theta)\) of a set \(W\) is defined by $$ h_W(\theta) = \sup\{ x \cos\theta + y\sin\theta : (x,y) \in W \} $$ defined for all angles \(theta\) in \((0, 2\pi)\).

For any direction theta (in radians), \(h_W(\theta)\) is the signed distance from the origin to a line which is tangent to W and perpendicular to theta.

The result of SupportFun(W) is a function in the R language with one argument theta. This function can be applied to any vector of values of \(\theta\) to compute the values of the support function.

See Also

FeretDiamFun, polarbody

Examples

Run this code
  W <- letterR
  Frame(W) <- grow.rectangle(Frame(W), 0.2)
  plot(W, main="")

  f <- SupportFun(W)
  p <- f(pi/6)
  plot(infline(p=p, theta=pi/6), col="red", lwd=2)

  ## as a function
  curve(f, to=2*pi)

Run the code above in your browser using DataLab