Learn R Programming

henna (version 0.3.4)

isPointOnSeg: Check if a point is on a segment

Description

This function checks if a point P is on a segment AB.

Usage

isPointOnSeg(xPoint, yPoint, xStart, yStart, xEnd, yEnd)

Value

Logical; whether the point is on the segment.

Arguments

xPoint

x coordinate of point P.

yPoint

y coordinate of point P.

xStart

x coordinate of point A.

yStart

y coordinate of point A.

xEnd

x coordinate of point B.

yEnd

y coordinate of point B.

Examples

Run this code
isPointOnSeg(2, 3, 1, 2, 3, 4)
isPointOnSeg(2, 3, 1, 2, 3, 8)
isPointOnSeg(4, 5, 1, 2, 3, 4)

Run the code above in your browser using DataLab