TRIANGLE_GRID
Triangular Grid of Points


TRIANGLE_GRID is a MATLAB library which generates a triangular grid of points.

Starting with any 3 points A, B, and C that define a triangle, we can divide each side of the triangle into N subintervals, and create a triangular grid. This defines ((N+1)*(N+2))/2 points that lie on the intersections of grid lines. The arrangement is suggested by this diagram:

              X
             9 X
            8 9 X
           7 8 9 X
          6 7 8 9 X
         5 6 7 8 9 X
        4 5 6 7 8 9 X
       3 4 5 6 7 8 9 X
      2 3 4 5 6 7 8 9 X
     1 2 3 4 5 6 7 8 9 X
    0 1 2 3 4 5 6 7 8 9 X
      

The library includes a routine which allows the user to pick an arbitrary triangle and an arbitrary number of subdivisions. It then returns the triangular gridpoints defined by that choice.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

TRIANGLE_GRID is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

BALL_GRID, a MATLAB library which computes grid points that lie inside a 3D ball.

CIRCLE_ARC_GRID, a MATLAB program which computes points equally spaced along a circular arc;

CIRCLE_GRID, a MATLAB library which computes grid points that lie inside a circle.

ELLIPSE_GRID, a MATLAB library which computes grid points that lie inside an ellipse.

ELLIPSOID_GRID, a MATLAB library which computes grid points that lie inside a 3D ellipsoid.

TETRAHEDRON_GRID, a MATLAB library which computes a tetrahedral grid of points.

Source Code:

Examples and Tests:

You can go up one level to the MATLAB source codes.


Last revised on 02 September 2010.