   constructor: (@triangleSize=10) ->
     @halfSize = @triangleSize / 2
     @rowHeight = Math.sqrt(3) / 2 * @triangleSize
+    @trianglesCache = {}
 
   gridSizeForScreen: (width, height) ->
     width: Math.ceil(width / @triangleSize)

  compareCoordinates: (a,b) -> a.x is b.x and a.y is b.y

  triangleAtPosition: (pos) ->
    [a,b,c] = []
    yStep = pos.y % 4
    yStep = 3 + yStep if yStep < 0
    
    switch yStep
      when 0
        xRef = pos.x * @triangleSize

        b = new agt.geom.Point(xRef + @halfSize, yRef + @rowHeight)
        c = new agt.geom.Point(xRef - @halfSize, yRef + @rowHeight)

    @trianglesCache[key] = new agt.geom.Triangle(a,b,c)
