diff --git a/Algebra/Vector.hs b/Algebra/Vector.hs index cf752fb..7ba5b52 100644 --- a/Algebra/Vector.hs +++ b/Algebra/Vector.hs @@ -2,7 +2,6 @@ module Algebra.Vector where -import Algebra.VectorTypes import Control.Applicative import Data.List (sortBy) import Diagrams.TwoD.Types @@ -11,6 +10,19 @@ import GHC.Float import MyPrelude +type Vec = R2 +type PT = P2 +type Coord = (Double, Double) +type Segment = (PT, PT) +type Square = (Coord, Coord) + + +data Alignment = CW + | CCW + | CL + deriving (Eq) + + -- |Checks whether the Point is in a given dimension. inRange :: Square -- ^ the square: ((xmin, xmax), (ymin, ymax)) -> PT -- ^ Coordinate diff --git a/Algebra/VectorTypes.hs b/Algebra/VectorTypes.hs deleted file mode 100644 index 0f64f4b..0000000 --- a/Algebra/VectorTypes.hs +++ /dev/null @@ -1,18 +0,0 @@ -{-# OPTIONS_HADDOCK ignore-exports #-} - -module Algebra.VectorTypes where - -import Diagrams.TwoD.Types - - -type Vec = R2 -type PT = P2 -type Coord = (Double, Double) -type Segment = (PT, PT) -type Square = (Coord, Coord) - - -data Alignment = CW - | CCW - | CL - deriving (Eq) diff --git a/Algorithms/GrahamScan.hs b/Algorithms/GrahamScan.hs index 4aa8d93..1cd4ac9 100644 --- a/Algorithms/GrahamScan.hs +++ b/Algorithms/GrahamScan.hs @@ -3,7 +3,6 @@ module Algorithms.GrahamScan where import Algebra.Vector -import Algebra.VectorTypes import MyPrelude diff --git a/Algorithms/KDTree.hs b/Algorithms/KDTree.hs index 7e03a42..2a885f0 100644 --- a/Algorithms/KDTree.hs +++ b/Algorithms/KDTree.hs @@ -16,7 +16,6 @@ module Algorithms.KDTree (kdTree where -import Algebra.VectorTypes import Algebra.Vector import Data.Maybe (fromJust, catMaybes) import Data.Tree diff --git a/Algorithms/PolygonIntersection.hs b/Algorithms/PolygonIntersection.hs index 592fc5f..b5fa253 100644 --- a/Algorithms/PolygonIntersection.hs +++ b/Algorithms/PolygonIntersection.hs @@ -2,7 +2,6 @@ module Algorithms.PolygonIntersection where import Algebra.Vector -import Algebra.VectorTypes import Control.Applicative import Data.Dequeue (BankersDequeue) import qualified Data.Dequeue as Q diff --git a/Algorithms/QuadTree.hs b/Algorithms/QuadTree.hs index 3bfa037..081158d 100644 --- a/Algorithms/QuadTree.hs +++ b/Algorithms/QuadTree.hs @@ -16,7 +16,6 @@ module Algorithms.QuadTree QTZipper) where -import Algebra.VectorTypes import Algebra.Vector import Data.Foldable (foldlM) import Data.List (partition) diff --git a/Graphics/Diagram/Gif.hs b/Graphics/Diagram/Gif.hs index 5bd955e..08d5416 100644 --- a/Graphics/Diagram/Gif.hs +++ b/Graphics/Diagram/Gif.hs @@ -2,7 +2,6 @@ module Graphics.Diagram.Gif where -import Algebra.VectorTypes import Algorithms.GrahamScan import Codec.Picture.Gif import qualified Data.ByteString.Char8 as B diff --git a/Graphics/Diagram/Plotter.hs b/Graphics/Diagram/Plotter.hs index f580c8b..e6dad7f 100644 --- a/Graphics/Diagram/Plotter.hs +++ b/Graphics/Diagram/Plotter.hs @@ -2,7 +2,7 @@ module Graphics.Diagram.Plotter where -import Algebra.VectorTypes +import Algebra.Vector(PT,Square) import Algorithms.GrahamScan import Algorithms.QuadTree import Algorithms.KDTree diff --git a/Graphics/Diagram/Types.hs b/Graphics/Diagram/Types.hs index 1880e2b..78808a4 100644 --- a/Graphics/Diagram/Types.hs +++ b/Graphics/Diagram/Types.hs @@ -3,7 +3,6 @@ module Graphics.Diagram.Types where import Algebra.Vector -import Algebra.VectorTypes import Diagrams.Backend.Cairo import Diagrams.Prelude import MyPrelude diff --git a/Parser/Meshparser.hs b/Parser/Meshparser.hs index 52431c1..06d51d4 100644 --- a/Parser/Meshparser.hs +++ b/Parser/Meshparser.hs @@ -2,7 +2,7 @@ module Parser.Meshparser (meshToArr, facesToArr) where -import Algebra.VectorTypes +import Algebra.Vector(PT) import Control.Applicative import Data.Attoparsec.ByteString.Char8 import Data.Either