Owning Class: geometry
Requires: MathScript RT Module
triangsearch(a, b, c, x, y)
k = triangsearch(a, b, c, x, y)
Legacy Name: tsearch
Determines inside which triangle the points you specify are located. Before you call this function, use the delaunay function to generate the Delaunay triangulation.
| Name | Description |
|---|---|
| a | Specifies a vector of x-coordinates that represent points in a plane. |
| b | Specifies a vector of y-coordinates that represent points in a plane. length(b) must equal length(a). |
| c | Specifies an n-by-3 matrix of integers, where n equals length(a). Each row of c represents a triangle of the Delaunay triangulation. Use the delaunay function to calculate matrix c. |
| x | Specifies a vector of x-coordinates. This function determines whether the points you specify in x and y are inside a triangle of the Delaunay triangulation. |
| y | Specifies a vector of y-coordinates. This function determines whether the points you specify in x and y are inside a triangle of the Delaunay triangulation. |
| Name | Description |
|---|---|
| k | Indicates whether the points you specify in x and y are inside a triangle of the Delaunay triangulation. If the points are inside one of the triangles, this function returns the row number in c that represents that triangle. Otherwise, this function returns NaN. |
a = [1, 2, 3, 4, 5, 6, 7, 8];
b = [2, 4, 1, 6, 4, 5, 6, 2];
c = delaunay(a, b);
k = triangsearch(a, b, c, [4, 0], [3.5, 0])