inVT: Decide whether a point is inside of a given triangulation.

View source: R/inVT.R

inVTR Documentation

Decide whether a point is inside of a given triangulation.

Description

This function is used to decided whether a point is inside of a given triangulation.

Usage

inVT(V0, Tr0, xx, yy)

Arguments

V0

The N by two matrix of vertices of a triangulation, where N is the number of vertices. Each row is the coordinates for a vertex.

Tr0

The triangulation matrix of dimention nT by three, where nT is the number of triangles in the triangulation. Each row is the indices of vertices in V.

xx

The x-cooridinate of points of dimension n by one.

yy

The y-cooridinate of points of dimension n by one.

Details

This R program is modified based on the Matlab program written by Ming-Jun Lai from the University of Georgia and Li Wang from the Iowa State University.

Value

A list of vectors, including:

ind

A vector of dimension n by one matrix that lists whether the points are inside of a given triangulation. 0 – represents outside the triangulation, while 1 – represents inside the triangulation.

ind.inside

A vector contains the indexes of all the points which are inside the triangulation.

Examples

xx=c(-0.25,0.75,0.25,1.25)
yy=c(-0.25,0.25,0.75,1.25)
V0=rbind(c(0,0),c(1,0),c(1,1),c(0,1))
Tr0=rbind(c(1,2,3),c(1,3,4))
inVT(V0,Tr0,xx,yy)


FIRST-Data-Lab/BPST documentation built on Sept. 18, 2023, 7:31 a.m.