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

infline

Infinite Straight Lines


Description

Define the coordinates of one or more straight lines in the plane

Usage

infline(a = NULL, b = NULL, h = NULL, v = NULL, p = NULL, theta = NULL)

## S3 method for class 'infline'
print(x, ...)

## S3 method for class 'infline'
plot(x, ...)

Arguments

a,b

Numeric vectors of equal length giving the intercepts a and slopes b of the lines. Incompatible with h,v,p,theta

h

Numeric vector giving the positions of horizontal lines when they cross the y axis. Incompatible with a,b,v,p,theta

v

Numeric vector giving the positions of vertical lines when they cross the x axis. Incompatible with a,b,h,p,theta

p,theta

Numeric vectors of equal length giving the polar coordinates of the line. Incompatible with a,b,h,v

x

An object of class "infline"

...

Extra arguments passed to print for printing or abline for plotting

Details

The class infline is a convenient way to handle infinite straight lines in the plane.

The position of a line can be specified in several ways:

  • its intercept a and slope b in the equation y = a + b * x can be used unless the line is vertical.

  • for vertical lines we can use the position v where the line crosses the y axis

  • for horizontal lines we can use the position h where the line crosses the x axis

  • the polar coordinates p and theta can be used for any line. The line equation is

    x * cos(theta) + y * sin(theta) = p

The command infline will accept line coordinates in any of these formats. The arguments a,b,h,v have the same interpretation as they do in the line-plotting function abline.

The command infline converts between different coordinate systems (e.g. from a,b to p,theta) and returns an object of class "infline" that contains a representation of the lines in each appropriate coordinate system. This object can be printed and plotted.

Value

The value of infline is an object of class "infline" which is basically a data frame with columns a,b,h,v,p,theta. Each row of the data frame represents one line. Entries may be NA if a coordinate is not applicable to a particular line.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Rolf Turner r.turner@auckland.ac.nz.

See Also

Examples

infline(a=10:13,b=1)
  infline(p=1:3, theta=pi/4)
  plot(c(-1,1),c(-1,1),type="n",xlab="",ylab="", asp=1)
  plot(infline(p=0.4, theta=seq(0,pi,length=20)))

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.