egttools.plotting.helpers.simplex_iterator

simplex_iterator(scale, boundary=True)[source]

Systematically iterates through a lattice of points on the 2-simplex.

Parameters
  • scale (int) – The normalized scale of the simplex, i.e. N such that points (x,y,z) satisify x + y + z == N

  • boundary (bool) – Include the boundary points (tuples where at least one coordinate is zero)

Yields
  • Tuple[int, int, int] – 3-tuples, There are binom(n+2, 2) points (the triangular number for scale + 1, less 3*(scale+1) if boundary=False

  • Citing

  • ——

  • This function has been copied from (https://github.com/marcharper/python-ternary/blob/master/ternary/helpers.py)

Return type

Tuple[int, int, int]