spacefill

Generators for space-filling curves. https://github.com/knz/spacefill

Latest on Hackage:0.1

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

PublicDomain licensed by Raphael 'kena' Poss
Maintained by knz@thaumogen.net
===============================
Algorithms.SpaceFillingCurves
===============================

How to use
----------

> import Data.SpaceFillingCurves
>
> -- An example Hilbert curve
> h :: [(Float, Float)]
> h = hilbert 2 0 0 4 0 0 4
>
> -- An example Moore curve
> m :: [(Float, Float)]
> m = moore 2 0 0 4 0 0 4

Printing the two curves:

> showCoords :: [(Float, Float)] -> String
> showCoords xs = concatMap format xs
> where
> format (a, b) = (show a) ++ " " ++ (show b) ++ "\n"
>
> main :: IO ()
> main = do
> putStrLn "Hilbert:"
> putStr (showCoords $ h)
> putStrLn "Moore:"
> putStr (showCoords $ m)
Depends on:
Used by 1 package:
comments powered byDisqus