anchor.diff:              if ball.Active then
                   let (px, py, pz) = ball.Center
                   if ball.SunkInPocket >= 0 then
  -                    let pocketCenter = pocketCenters.[ball.SunkInPocket]
  +                    let pcx, pcy as pocketCenter = pocketCenters.[ball.SunkInPocket]
  +                    // let dx = px - pcx
  +                    // let dy = py - pcy
  +                    // let norm = Math.Sqrt(dx*dx + dy*dy)
  +                    // let maxNorm = g_pocketRadius - Math.Sqrt(Math.Max(0., (1. - (pz + 1.) * (pz + 1.))))
  +                    // if norm > maxNorm then
  +                    //     ball.Center <- (pcx + dx * maxNorm / norm,
  +                    //                     pcy + dy * maxNorm / norm,
  +                    //                     pz)
                       let (dx, dy) as d = O3DJS.Math.Sub((px, py), pocketCenter)
                       let norm = O3DJS.Math.Length d
                       let maxNorm = g_pocketRadius - Math.Sqrt (max 0. (1. - (pz + 1.) * (pz + 1.)))
                       if norm > maxNorm then
                           let ratio = maxNorm / norm
  -                        ball.Center <- (px + dx*ratio, py + dy*ratio, pz)
  +                        ball.Center <- (pcx + dx*ratio, pcy + dy*ratio, pz)
                   if pz < -3. then
                       ball.Velocity <- (0., 0., 0.)
                       ball.AngularVelocity <- (0., 0., 0.)
  
positive.code:     [<JavaScript>]
      member this.SomeBallsMoving() =
          balls |> Array.exists (fun ball ->
              not ball.Active ||
              (let (v0, v1, v2) = ball.Velocity
               let (w0, w1, w2) = ball.AngularVelocity
               v0 <> 0. || v1 <> 0. || v2 <> 0. ||
  
negative.code:          ((-a * c) / I, (-b * c) / I, 1. / m + (a * a + b * b) / I))
  
      [<JavaScript>]
      member this.ApplyImpulse(i, (ix, iy, _ as impulse) : float * float * float, r) =
          let ball = balls.[i]
          let (rx, ry, rz) = r
          ball.Velocity <- O3DJS.Math.Add(ball.Velocity, O3DJS.Math.Div(impulse, ball.Mass))
  