 
     ctx.restore()
 
+class Contact
+  constructor: (@position, @normal, @depth) ->
+
 window.Rotation =
   fromAngle: (angle) -> [Math.cos(angle), Math.sin(angle)]
   add: ([a,b],[c,d]) -> [a*c - b*d, a*d + c*b]

      Utils.debugLine ctx, inc.from, inc.to, "#66F"
    if clipped = @debug.clipped
      Utils.debugLine ctx, clipped[0], clipped[1], "#FF0"
    if trimmed = @debug.trimmed
      Utils.debugPoints ctx, "#000", trimmed...

  # Calculate contact points against another polygon.
  # from http://www.codezealot.org/archives/394 &c


    # find the largest depth
    maxDepth = Vec.dotProduct refNorm, reference.deepest
    contacts = []

    # Calculate depth for each clipped point and return only those which are
    # nonzero (that is, aren't on the other side of the reference edge)
    for point in clipped
      depth = Vec.dotProduct(refNorm, point) - maxDepth
      if depth >= 0
        contacts.push new Contact(point, minAxis, depth)

    @debug.contacts = contacts

    contacts

  # clip the line segment from v1 to v2 if they are beyond offset along normal
  clip: (v1, v2, normal, offset) ->
