       (.render renderer scene camera))))
 
 (defn magnitude
+  "Calculates the magnitude (length) of a vector."
   [v]
   (Math/sqrt (apply + (map #(* % %) v))))
 

    mesh))

(defn init-particles!
  [ps]
  (reset! particles ps)
  (reset! particle-meshes (map mesh-from-particle ps)))

(defn make-renderer!
  [meshes]
  (let [camera (THREE.PerspectiveCamera.
                50 (/ scene-width

             assoc i {:pos p :vel v}))))

(defn generate-particles
  "Creates the given number of particles, and arranges them in the universe
randomly."
  [n]
  (vec
   (for [i (range n)]
