Learn R Programming

spatstat.geom (version 3.7-3)

SupportFun: Support Function

Description

Create the support function of a two-dimensional domain.

Usage

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

Value

A function in the R language with one argument theta.

Arguments

W

Window (object of class "owin") representing the domain.

origin

The location of the origin for the support function. Either a numeric vector of length 2 giving the location, or a point pattern containing only one point, or a list with two entries named x and y, or one of the character strings "centroid", "midpoint", "left", "right", "top", "bottom", "topleft", "bottomleft", "topright" or "bottomright" (partially matched).

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

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