 
 #Calculate parameters of the collision:
 # collision time, nearest node points, collision distance.
+#  pos : position [x, y, t]
+#  delta : velocity and period [dx, dy, dt]
 collisionParameters = (pos0, delta0, pos1, delta1) ->
   #pos and delta are 3-vectors: (x,y,t)
   #

  npos1 = vecSum pos1, vecScale(delta1, ib)
  return {
    approach: true
    npos0 : npos0
    npos1 : npos1
    tapp : tapp
  }

isValidOffset = ([dx, dy, dt]) -> ((dx+dt)%2 is 0) and ((dy+dt)%2 is 0)
############################

#single rotate - for test
rule = from_list_elem [0,2,8,3,1,5,6,7,4,9,10,11,12,13,14,15]

#2-block
pattern2 = Cells.from_rle "$2o2$2o"
pattern1 = Cells.from_rle "o"

v2 = (determinePeriod rule, pattern2, 0).delta
v1 = (determinePeriod rule, pattern1, 0).delta

library = new Library rule
library.addRle "$2o2$2o"
