Learn R Programming

LearnGeom (version 1.5)

CreateSegmentPoints: Creates a matrix that represents the segment that connects two points

Description

DrawSegment plots the segment that connects two points in a previously generated coordinate plane

Usage

CreateSegmentPoints(P1, P2)

Arguments

P1

Vector containing the xy-coordinates of point 1

P2

Vector containing the xy-coordinates of point 2

Value

Returns a matrix which contains the points that determine the extremes of the segment

Examples

Run this code
# NOT RUN {
x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
P1 <- c(0,0)
P2 <- c(1,1)
Segment <- CreateSegmentPoints(P1, P2)
Draw(Segment, "black")
# }

Run the code above in your browser using DataLab