Learn R Programming

LearnGeom (version 1.5)

MidPoint: Computes the middle point of the segment that connects two points

Description

MidPoint computes the middle point of the segment that connects two points

Usage

MidPoint(P1, P2)

Arguments

P1

Vector containing the xy-coordinates of point 1

P2

Vector containing the xy-coordinates of point 2

Value

Returns a vector containing the xy-coordinates of the middle point of the segment that connects P1 and P2

Examples

Run this code
# NOT RUN {
P1 <- c(0,0)
P2 <- c(1,1)
mid <- MidPoint(P1, P2)
# }

Run the code above in your browser using DataLab