       newArray[j].push array[i][j]
   newArray
 
- identity = [[1,0,0],[0,1,0],[0,0,1]]
+identity = [[1,0,0],[0,1,0],[0,0,1]]
 
 norm = (d)->
   # L2 norm (hypotenuse)

    if not upperHemisphere
      z *= -1

    return [
      c*Math.atan2(y,x),
      c*Math.asin z/r]

  return ell.map(stepFunc)

normalErrors = (axesCovariance, axes, opts={})->
  # Get a single level of planar errors (or the

  angles = (i*step for i in [0...n])
  ([Math.cos(a),Math.sin(a)] for a in angles)

cart2sph = (opts)->
  opts.degrees ?= true
  c = if opts.degrees then 180/Math.PI else 1
  (d)->
    r = norm(d)
    [x,y,z] = d
    # Converts xyz to lat lon
    [c*Math.atan2(y,x),c*Math.asin z/r]

planeErrors = (axesCovariance, axes, opts={})->
  # Get a single level of planar errors (or the
