Modeling triangular networks using matrices?

110 Views Asked by At

The matrix is a rectangular construct and therefore intuitively suited for modeling things arranged rectangularly.

However, for other than rectangular shapes. E.g. triangular networks.

How to use the matrix?

1

There are 1 best solutions below

1
On

This depends on what size and shape your triangular of hexagonal grid is.
First fix some vertex in it and call it the origin.

Use matrices, but the $(i, j)$ - entry in the matrix corresponds to the vertex that is gotten by moving $i$ horizontal arrows and $j$ upward (it's not vertical as it would be in the square lattice case) (see the arrows in your picture:)

enter image description here

If you don't have the origin in a suitable corner, you will also need negative indices (you need to include zero as an index anyhow). And depending on the shape of your region some of your indices might not correspond to a vertex. These they can be left empty in the matrix.

Here is good site for hexagonal stuff: https://www.redblobgames.com/grids/hexagons/ (look at coordinate systems).