Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

boundingcircle

Smallest Enclosing Circle


Description

Find the smallest circle enclosing a spatial window or other object. Return its radius, or the location of its centre, or the circle itself.

Usage

boundingradius(x, ...)

boundingcentre(x, ...)

boundingcircle(x, ...)

## S3 method for class 'owin'
boundingradius(x, ...)

## S3 method for class 'owin'
boundingcentre(x, ...)

## S3 method for class 'owin'
boundingcircle(x, ...)

## S3 method for class 'ppp'
boundingradius(x, ...)

## S3 method for class 'ppp'
boundingcentre(x, ...)

## S3 method for class 'ppp'
boundingcircle(x, ...)

Arguments

x

A window (object of class "owin"), or another spatial object.

...

Arguments passed to as.mask to determine the pixel resolution for the calculation.

Details

The boundingcircle of a spatial region W is the smallest circle that contains W. The boundingradius is the radius of this circle, and the boundingcentre is the centre of the circle.

The functions boundingcircle, boundingcentre and boundingradius are generic. There are methods for objects of class "owin", "ppp" and "linnet".

Value

The result of boundingradius is a single numeric value.

The result of boundingcentre is a point pattern containing a single point.

The result of boundingcircle is a window representing the boundingcircle.

Author(s)

See Also

Examples

boundingradius(letterR)

  plot(grow.rectangle(Frame(letterR), 0.2), main="", type="n")
  plot(letterR, add=TRUE, col="grey")
  plot(boundingcircle(letterR), add=TRUE, border="green", lwd=2)
  plot(boundingcentre(letterR), pch="+", cex=2, col="blue", add=TRUE)

  X <- runifrect(5)
  plot(X)
  plot(boundingcircle(X), add=TRUE)
  plot(boundingcentre(X), pch="+", cex=2, col="blue", add=TRUE)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.