...

/

Implementing a Triangle Grid

Implementing a Triangle Grid

Learn to implement a triangle grid in Ruby.

Introduction to triangle grids

A grid of triangles has a very lattice-like look:

As with the hexagons, there are going to be lots of ways to implement a grid like this, and each will have different strengths and weaknesses. For simplicity’s sake, we’ll look at one that most closely approximates the regular grid, with horizontal rows and vertical columns. We’ll use equilateral triangles (mostly because it makes ...