triangle_grid: Triangle grid

Description Usage Arguments Details Value Examples

View source: R/triangle_grid.R

Description

Create a grid of points within a triangle

Usage

1
triangle_grid(N, vertices)

Arguments

N

The number of subintervals each side should be divided into i.e. there are (N+1) points on a side.

vertices

A vector of length six giving the (x,y) coordinates of each vertex of the triangle or a matrix with two rows and three columns of vertex coordinates.

Details

Code taken from https://people.sc.fsu.edu/~jburkardt/cpp_src/triangle_grid/triangle_grid.html.

Value

Returns a matrix with the x and y positions of each point in the grid.

Examples

1
2
3
v = cbind(c(0,0), c(1,1), c(2,0))
p = shapegrid::triangle_grid(10, v)
plot(p)

daffp/shapegrid documentation built on Aug. 2, 2020, 12:49 a.m.