         if result.found
           result.transform = tfm
           break
+    #reverse-transform position
+    [[result.x0, result.y0]] = Cells.transform [[result.x, result.y]], inverseTfm(result.transform)
     return result
 
   _classifyNormalizedPattern: (pattern, time, dx, dy, period) ->

  if params.dist > collisionTreshold
    #console.log "#### Too far, nearest approach #{params.dist} > #{collisionTreshold}"
    return
  #console.log "#### colliding with offset #{JSON.stringify offset}"
  #console.log "#### CP: #{JSON.stringify params}"
  #console.log "#### AP: #{JSON.stringify ap}"
  

# Make collision table

fs = require "fs"
{Cells, inverseTfm, evaluateCellList, getDualTransform, splitPattern} = require "../scripts-src/cells"
{Rule, from_list_elem} = require "../scripts-src/rules"
stdio = require "stdio"
{mod,mod2} = require "../scripts-src/math_util"
