CreateLinePoints: Creates a vector that represents the line that connects two...

Description Usage Arguments Value Examples

View source: R/CreateLinePoints.R

Description

CreateLinePoints creates a vector that represents the line that connects two points

Usage

1

Arguments

P1

Vector containing the xy-coordinates of point 1

P2

Vector containing the xy-coordinates of point 2

Value

Returns a vector which contains the slope and intercept of the defined line. If the points have the same x-coordinate, the slope is set to Inf and the intercept is replaced by the x-value for the line (which is a vertical line in this situation)

Examples

1
2
3
P1 <- c(0,0)
P2 <- c(1,1)
Line <- CreateLinePoints(P1, P2)

Example output



LearnGeom documentation built on July 14, 2020, 5:06 p.m.