addRays: Add all points on the bounding box hit by the rays.

View source: R/hull.R

addRaysR Documentation

Add all points on the bounding box hit by the rays.

Description

Add all points on the bounding box hit by the rays.

Usage

addRays(
  pts,
  m = apply(pts, 2, min) - 5,
  M = apply(pts, 2, max) + 5,
  direction = 1
)

Arguments

pts

A data frame with all points

m

Minimum values of the bounding box.

M

Maximum values of the bounding box.

direction

Ray direction. If i'th entry is positive, consider the i'th column of the pts plus a value greater than on equal zero. If negative, consider the i'th column of the pts minus a value greater than on equal zero.

Value

The points merged with the points on the bounding box. The column pt equals 1 if points from pts and zero otherwise.

Note

Assume that pts has been checked using .checkPts().

Examples

pts <- genNDSet(3,10)[,1:3]
addRays(pts)
addRays(pts, dir = c(1,-1,1))
addRays(pts, dir = c(-1,-1,1), m = c(0,0,0), M = c(100,100,100))
pts <- genSample(5,20)[,1:5]
addRays(pts)

relund/gMOIP documentation built on Feb. 23, 2024, 12:11 p.m.