   (and (> (impact-force mass velocity) min-impact-force-for-splatter)
        (> (rand) 0.8)))
 
-;; if an impact splatters then we will need to bounce its velocity
-;; vector as this is the direction it will exit its current position
-
-;; the equation to bounce a vector, V, off a plane with normal, N, is:
-;; needs rewriting http://mathworld.wolfram.com/Reflection.html
+;; If an impact splatters then we will need to bounce its velocity
+;; vector as this is the direction it will leave its current position.
+
+;; The equation to bounce a vector, $V$, off a plane with normal, $N$, is:
+;; **needs rewriting http://mathworld.wolfram.com/Reflection.html**
 ;; 
-;;  N is the normal vector of the plane
-;;  R is the reflected vector
+;;    - $N$ is the normal vector of the plane
+;;    - $V$ = the incoming vector
+;;    - $B$ is the outgoing, bounced, vector
 ;; 
-;;  R = V - (2 * (V.N) * N)
-
-;; dot product is he sum of the multiples of the dimensions
+;;  $B = V - (2 * (V.N) * N)$
+
+;; We are missing a few of the required vector operations used in this
+;; equation so we should define some more functions before trying to
+;; implement it. The first is the vector dot product, this is defined
+;; as the sum of the multiples of each dimension. Otherwise we need
+;; substraction of two vectors and a function to multiply a vector by
+;; a constant.
 
 (defn dot-product [vector1 vector2]
   (reduce + (map * vector1 vector2)))

(defn starting-point [] (map rand space))


;; To start off with lets assume that the paint is falling and has 0
;; velocity of its own when it starts from the brush


;; we need to know the amount of time it is going to take the paint to
;; fall, which we can work out based on the y dimension alone

;; we know the initial position and velocity, final position and
;; acceleration and we need to find the time. We cant use the equation
;; r = r0 + v0 * t + at^2/2
;; we need to use the quadratic equation to solve for t
;;
;; rearranged we get
;;   at^2 + 2v0t + 2r0 - 2r = 0
;; in quad equation:
;;   a = a
;;   b = 2v0
;;   c = 2r0 - 2r
;;     r (final position) is always going to be 0 so,
;;   c = 2r0

(defn time-to-canvas [position velocity acceleration]
  (let [a acceleration

  (map #(* % constant) vector))


;; Using the above functions we can now implement the vector bouncing
;; equation. I have pulled $(2 * (V.N) * N)$ out into a variable
;; called extreme for clarity. **I don't think extreme is a much
;; better name than blah**

(defn bounce-vector [vector normal]
  (let [vector-dot-normal (dot-product vector normal)
        extreme (vector-multiply-by-constant normal (* 2 vector-dot-normal))]
    (vector-subtraction vector extreme)))


;; When an impact splatters it will only take a fraction of the
;; velocity, otherwise know as being elastic rather than inelastic
;; **check these definitions**. We can define a constant that will be
;; used to reduce the total velocity of the bounced vector to reflect
;; this elasticity.

;; **should this splatter vector be randomised a little bit?**

(def splatter-dampening-constant 0.7)

