check_point_side_of_line: Check point is in bounds

Description Usage Arguments Value Examples

View source: R/anem_geoprocessing.R

Description

Check point is in bounds

Usage

1

Arguments

line

list containing m and m

x

x coordinates

y

y coordinates

Value

Returns +1 for any point above the line, -1 for any point below the line, and 0 for a point on the line. If the line is vertical (m=Inf), returns +1 for points to the right of the line and -1 for points to the left of the line.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
x <- 100
y <- 100
line <- list(m=Inf,b=2)
check_point_side_of_line(list(m=Inf,b=2),0,0)
check_point_side_of_line(list(m=Inf,b=2),2,0)
check_point_side_of_line(list(m=Inf,b=2),3,0)
check_point_side_of_line(list(m=1,b=2),0,0)
check_point_side_of_line(list(m=1,b=2),0,2)
check_point_side_of_line(list(m=1,b=2),0,3)

## End(Not run)

gopalpenny/anem documentation built on Dec. 20, 2020, 5:27 a.m.