polyiamonds
    
    
    
      polyiamonds,
      a MATLAB code which
      considers polyiamonds, simple connected shapes constructed from 
      equilateral triangles connected edgewise.
    
    
      Licensing:
    
    
      The information on this web page is distributed under the MIT license.
    
    
      Languages:
    
    
      polyiamonds is available in
      a MATLAB version and
      an Octave version.
    
    
      Related Data and Programs:
    
    
      
      polyiamonds_test
    
    
      
      boundary_word_square,
      a MATLAB code which
      describes the outline of an object on a grid of squares,
      using a string of symbols that represent the sequence of steps
      tracing out the boundary.
    
    
      
      eternity,
      a MATLAB code which
      considers the eternity puzzle, which considers an irregular dodecagon 
      shape that is to be tiled by 209 distinct pieces, each formed by 36 
      contiguous 30-60-90 triangles, known as polydrafters.
    
    
      
      pariomino,
      a MATLAB code which
      considers pariominoes, which are polyominoes with a checkerboard parity,
      and the determination of tilings of a region using a specific set of
      pariominoes.
    
    
      
      polyominoes,
      a MATLAB code which
      defines, solves, and plots a variety of polyomino tiling problems,
      which are solved by a direct algebraic approach involving the
      reduced row echelon form (RREF) of a specific matrix, instead of the
      more typical brute-force or backtracking methods.
    
    
      Reference:
    
    
      
        - 
          Martin Gardner,
 
          Mathematical Games: 
          On Polyiamonds: Shapes That are Made Out of Equilateral Triangles,
          Scientific American,
          Volume 211, December 1964.
         
        - 
          Marcus Garvie, John Burkardt,
          A new mathematical model for tiling finite regions of the plane
          with polyominoes,
          Contributions to Discrete Mathematics,
          Volume 15, Number 2, July 2020.
         
        - 
          Solomon Golomb,
          Polyominoes: Puzzles, Patterns, Problems, and Packings,
          Princeton University Press, 1996,
          ISBN: 9780691024448
         
        - 
          T H O'Beirne,
          Pentominoes and Hexiamonds,
          New Scientist,
          Volume 12, pages 379-380, 1961.
         
        - 
          Torbijn,
          Polyiamonds,
          Journal of Recreational Mathematics,
          Volume 2, pages 216-227, 1969.
         
      
    
    
      Source code:
    
    
      
        - 
          
          boolean_to_string.m,
          given a boolean value,
          returns the character vector 'True' or 'False'.
        
 
        - 
          
          gort_boundary.m,
          returns the boundary word 
          of the Gort polyiamond.
        
 
        - 
          
          boundary_hexiamond.m,
          returns the boundary word 
          for a given hexiamond.
        
 
        - 
          
          boundary_is_legal.m,
          given the boundary word of a polyiamond,
          determines if it is legal.
        
 
        - 
          
          boundary_plot.m,
          given the boundary word of a polyiamond,
          creates a plot.
        
 
        - 
          
          boundary_print.m,
          given the boundary word of a polyiamond,
          prints it.
        
 
        - 
          
          boundary_range.m,
          given the boundary word of a polyiamond, 
          returns its range in the I and J directions.
        
 
        - 
          
          boundary_reflect.m,
          given the boundary word of a polyiamond, 
          returns the boundary word of the reflected polyiamond.
        
 
        - 
          
          boundary_representative.m,
          returns the representative for a boundary word, 
          the lexically first member of the equivalence class.
        
 
        - 
          
          boundary_rotate.m,
          given the boundary word of a polyiamond,
          rotates it through a multiple of 60 degrees.
        
 
        - 
          
          boundary_snap.m,
          given the boundary word of a polyiamond,
          "snaps" it so its minimum I and J node coordinates are 0.
        
 
        - 
          
          boundary_sort.m,
          given the boundary word of a polyiamond,
          returns a sorted version of the boundary word.
        
 
        - 
          
          boundary_tiny.m,
          returns the boundary word
          of the tiny polyiamond.
        
 
        - 
          
          boundary_to_edge.m,
          given the boundary word of a polyiamond,
          converts it to a sequence of nodes that bound
          the polyiamond.
        
 
        - 
          
          boundary_to_triangle.m,
          given the boundary word of a polyiamond,
          converts it to a triangle list.
        
 
        - 
          
          boundary_to_vertex.m,
          given the boundary word of a polyiamond,
          converts it to a vertex list.
        
 
        - 
          
          boundary_translate.m,
          given the boundary word of a polyiamond, 
          returns the boundary word of the translated polyiamond.
        
 
        - 
          
          chvec_lt.m,
          is TRUE if c1
        
- 
          
          edge_gort.m,
          returns the edge list of the Gort polyiamond.
        
 
        - 
          
          edge_hexiamond.m,
          returns the edge list of a given hexiamond.
        
 
        - 
          
          edge_plot.m,
          given the edge list of a polyiamond,
          plots the polyiamond.
        
 
        - 
          
          edge_print.m,
          given the edge list of a polyiamond, 
          prints it.
        
 
        - 
          
          edge_range.m,
          given the edge list of a polyiamond, 
          returns its range in the I and J directions.
        
 
        - 
          
          edge_reflect.m,
          given the edge list of a polyiamond,
          returns the edge list of a reflected polyiamond.
        
 
        - 
          
          edge_snap.m,
          given the edge list of a polyiamond,
          "snaps" it so its minimum I and J node coordinates are 0.
        
 
        - 
          
          edge_sort.m,
          given the edge list of a polyiamond,
          returns a sorted version of the edge list.
        
 
        - 
          
          edge_tiny.m,
          returns the edge list
          of the tiny polyiamond.
        
 
        - 
          
          edge_to_boundary.m,
          given the edge list of a polyiamond, 
          returns the corresponding boundary word.
        
 
        - 
          
          edge_to_triangle.m,
          given the edge list of a polyiamond, 
          returns the corresponding triangle list.
        
 
        - 
          
          edge_to_vertex.m,
          given the edge list of a polyiamond, 
          returns the corresponding vertex list.
        
 
        - 
          
          edge_translate.m,
          given the edge list of a polyiamond, 
          returns the edge list of a translation of the polyiamond.
        
 
        - 
          
          grid_plot.m,
          plots a parallelogram grid divided into equilateral triangles.
        
 
        - 
          
          i4_wrap.m,
          forces an I4 to lie between given limits, using wrapping.
        
 
        - 
          
          i4vec_lt.m,
          returns TRUE if vector 1 is less than vector 2, 
          using the lexical ordering.
        
 
        - 
          
          ij_neighbors.m,
          given the (i,j) parallelogram coordinates of a node,
          returns the (i,j) coordinates of the six neighboring nodes.
        
 
        - 
          
          ij_reflect.m,
          given the (i,j) parallelogram coordinates of a node,
          returns the (i,j) coordinates after reflection.
        
 
        - 
          
          ij_rotate.m,
          given the (i,j) parallelogram coordinates of a node,
          returns the (i,j) coordinates after R 60 degree rotations.
        
 
        - 
          
          ij_to_xy.m,
          given the (i,j) parallelogram coordinates of a node,
          returns the (x,y) Cartesian coordinates.
        
 
        - 
          
          ij_translate.m,
          given the (i,j) parallelogram coordinates of a node,
          returns the (i,j) coordinates after displacement by a vector D.
        
 
        - 
          
          ijk_fill.m,
          given (i,j,k) parallelogram triangle coordinates,
          plots a filled triangle on the current figure.
        
 
        - 
          
          ijk_neighbors.m,
          given (i,j,k) parallelogram triangle coordinates,
          returns the IJK coordinates of 3 neighbor triangles.
        
 
        - 
          
          ijk_to_ij.m,
          given (i,j,k) parallelogram triangle coordinates,
          returns the (i,j) parallelogram coordinates of the nodes that are vertices.
        
 
        - 
          
          ijk_to_xy.m,
          given (i,j,k) parallelogram triangle coordinates,
          returns the (x,y) Cartesian point coordinates of the nodes 
          that are vertices.
        
 
        - 
          
          is_octave.m,
          is TRUE if Octave is executing.
        
 
        - 
          
          name_hexiamond.m,
          given an index between 1 and 12 of a hexiamond, 
          returns the corresponding name.
        
 
        - 
          
          polyiamond_free_enumerate.m,
          enumerates the free polyiamonds.
        
 
        - 
          
          s_escape_tex.m,
          de-escapes TeX escape sequences.
        
 
        - 
          
          triangle_contains_ijk.m,
          given the triangle list of a polyiamond, 
          determines if an IJK triangle is inside the polyiamond.
        
 
        - 
          
          triangle_gort.m,
          returns the triangle list
          of the Gort polyiamond.
        
 
        - 
          
          triangle_hexiamond.m,
          returns the triangle list of a given hexiamond.
        
 
        - 
          
          triangle_ijk_order.m,
          given the triangle list of a polyiamond,
          returns the row in which a given IJK triangle occurs.
        
 
        - 
          
          triangle_parity.m,
          given the triangle list of a polyiamond, 
          computes the parity (k=1 minus k=0).
        
 
        - 
          
          triangle_plot.m,
          given the triangle list of a polyiamond, 
          plots the corresponding polyiamond.
        
 
        - 
          
          triangle_print.m,
          given the triangle list of a polyiamond, 
          prints it.
        
 
        - 
          
          triangle_range.m,
          given the triangle list of a polyiamond, 
          returns its range in the I and J directions.
        
 
        - 
          
          triangle_reflect.m,
          given the triangle list of a polyiamond,
          returns the triangle list of the reflected polyiamond.
        
 
        - 
          
          triangle_snap.m,
          given the triangle list of a polyiamond,
          "snaps" it so its minimum I and J node coordinates are 0.
        
 
        - 
          
          triangle_sort.m,
          given the triangle list of a polyiamond,
          sorts the triangle list.
        
 
        - 
          
          triangle_tiny.m,
          returns the triangle list
          of the tiny polyiamond.
        
 
        - 
          
          triangle_to_boundary.m,
          given the triangle list of a polyiamond, 
          and returns the boundary word of the polyiamond.
        
 
        - 
          
          triangle_to_edge.m,
          given the triangle list of a polyiamond, 
          returns the boundary node list of the polyiamond.
        
 
        - 
          
          triangle_to_vertex.m,
          given the triangle list of a polyiamond, 
          returns the vertex list of the polyiamond.
        
 
        - 
          
          triangle_translate.m,
          given the triangle list of a polyiamond, 
          returns the triangle list of a translation of the polyiamond.
        
 
        - 
          
          vertex_contains_ijk.m,
          given the vertex list of a polyiamond,
          determines if an IJK triangle is contained inside the polyiamond.
        
 
        - 
          
          vertex_contains_point.m,
          given the vertex list of a polyiamond,
          determines if a point is contained inside the polyiamond.
        
 
        - 
          
          vertex_gort.m,
          returns the vertex list of the Gort polyiamond.
        
 
        - 
          
          vertex_hexiamond.m,
          returns the vertex list of a given hexiamond.
        
 
        - 
          
          vertex_plot.m,
          given the vertex list of a polyiamond,
          plots the polyiamond.
        
 
        - 
          
          vertex_print.m,
          given the vertex list of a polyiamond,
          prints it.
        
 
        - 
          
          vertex_range.m,
          given the vertex list of a polyiamond,
          returns its range in the I and J directions.
        
 
        - 
          
          vertex_reflect.m,
          given the vertex list of a polyiamond,
          returns the vertex list of the reflected polyiamond.
        
 
        - 
          
          vertex_snap.m,
          given the vertex list of a polyiamond,
          "snaps" it so its minimum I and J node coordinates are 0.
        
 
        - 
          
          vertex_sort.m,
          given the vertex list of a polyiamond,
          returns a sorted version of the vertex list.
        
 
        - 
          
          vertex_tiny.m,
          returns the vertex list
          of the tiny polyiamond.
        
 
        - 
          
          vertex_to_boundary.m,
          given the vertex list of a polyiamond,
          produces the corresponding boundary word.
        
 
        - 
          
          vertex_to_edge.m,
          given the vertex list of a polyiamond,
          produces the corresponding edge list.
        
 
        - 
          
          vertex_to_triangle.m,
          given the vertex list of a polyiamond,
          produces the corresponding triangle list.
        
 
        - 
          
          vertex_translate.m,
          given the vertex list of a polyiamond, 
          returns the vertex list of a translation of the polyiamond.
        
 
        - 
          
          xy_to_ij.m,
          given the (x,y) Cartesian coordinates of a point,
          returns the corresponding (i,j) parallelogram coordinates.
        
 
       
    
    
    
      Last revised on 11 November 2020.