Learn R Programming

affiner (version 0.1.3)

as_line2d: Cast to Line2D object

Description

as_line2d() casts to a Line2D object.

Usage

as_line2d(...)

# S3 method for numeric as_line2d(a, b, c, ...)

# S3 method for angle as_line2d(theta, p1 = as_coord2d("origin"), ...)

# S3 method for character as_line2d(x, ...)

# S3 method for Coord2D as_line2d(normal, p1 = as_coord3d("origin"), p2, ...)

# S3 method for Line2D as_line2d(line, ...)

# S3 method for Point1D as_line2d(point, b = 0, ...)

Arguments

...

Passed to other function such as as_coord2d().

a, b, c

Numeric vectors that parameterize the line via the equation a * x + b * y + c = 0. Note if y = m * x + b then m * x + 1 * y + -b = 0.

theta

Angle of the line represented by an angle() vector.

p1

Point on the line represented by a Coord2D class object.

x

A (character) vector to be cast to a Line2D object

normal

Normal vector to the line represented by a Coord2D class object. p2 should be missing.

p2

Another point on the line represented by a Coord2D class object.

line

A Line2D object

point

A Point1D object

Examples

Run this code
p1 <- as_coord2d(x = 5, y = 10)
p2 <- as_coord2d(x = 7, y = 12)
theta <- degrees(45)
as_line2d(theta, p1)
as_line2d(p1, p2)

Run the code above in your browser using DataLab