SupportFun: Support Function

View source: R/sptfun.R

SupportFunR Documentation

Support Function

Description

Create the support function of a two-dimensional domain.

Usage

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

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

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.

Value

A function in the R language with one argument theta.

Author(s)

\adrian

.

See Also

FeretDiamFun, polarbody

Examples

  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)

spatstat.geom documentation built on March 21, 2026, 9:06 a.m.