         lon (/ x (* rho (cos lat)))]
     (map #(Math/toDegrees %) [lat lon])))
 
-(def
-  ^{:doc "Returns the latitude and longitude for the centroid of the
-  supplied MODIS tile coordinate at the specified resolution."}
-  modis->latlon
-  (comp (partial apply sinu-xy->latlon)
-        modis->sinu-xy))
-
+(defmacro conversion-comp
+  [& conversions]
+  `(fn [& args#]
+     (reduce (fn [val-seq# f#]
+               (apply f# val-seq#))
+             args#
+             [~@conversions])))
+
+;; Returns the map position in meters of the supplied MODIS tile
+;;  coordinate at the specified resolution
+
+(def modis->latlon
+  (conversion-comp modis->global-mags
+                   global-mags->sinu-xy
+                    sinu-xy->latlon))
+
+;; TODO -- get the damned global pixel

                 (dir start magnitude))]
    (map travel [+ -] [min-x max-y] [mag-x mag-y])))

(defn pixel-length
  "The length, in meters, of the edge of a MODIS pixel at the supplied
  resolution."
  [res]
  (let [pixel-span (/ (- max-y min-y) v-tiles)
        total-pixels (pixels-at-res res)]
    (/ pixel-span total-pixels)))

(defn pixel-coords
  "Returns the (sample, line) of a pixel on the global MODIS grid,
  measured in pixels from (0,0) at the top left."
  [mod-h mod-v sample line res]
  (let [edge-pixels (pixels-at-res res)]
    (map + [sample line] (scale edge-pixels [mod-h mod-v]))))

(defn modis->sinu-xy
  "Returns the map position in meters of the supplied MODIS tile
  coordinate at the specified resolution."
  [res mod-h mod-v sample line]
  (let [edge-length (pixel-length res)
        half-edge (/ edge-length 2)
        pix-pos (pixel-coords mod-h mod-v sample line res)
        magnitudes (map #(+ half-edge %) (scale edge-length pix-pos))]
    (apply sinu-position magnitudes)))

;; ### Inverse Sinusoidal Projection
;;
;; We'll stay in degrees, here. To convert from MODIS to (lat, lon),

(defn scale
  "Scales each element in a collection of numbers by the supplied
  factor."
  ([fact sequence]
     (scale fact 0 sequence))
  ([fact offset sequence]
     (for [x sequence] (-> x (* fact) (+ offset)))))

;; From [Wikipedia](http://goo.gl/qG7Hi), "the sinusoidal projection
;; is a pseudocylindrical equal-area map projection, sometimes called
