{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Geometry.Box
( module Data.Geometry.Box.Internal
, module Data.Geometry.Box.Corners
, module Data.Geometry.Box.Sides
, inBox'
) where
import Control.DeepSeq
import Data.Geometry.Box.Corners
import Data.Geometry.Box.Internal
import Data.Geometry.Box.Sides
import Data.Geometry.Vector
import Data.Geometry.Point
import Data.Geometry.Boundary
deriving instance (NFData p, NFData r, Arity d) => NFData (Box d p r)
inBox' :: (Arity d, Ord r) => Point d r -> Box d p r -> PointLocationResult
Point d r
q inBox' :: Point d r -> Box d p r -> PointLocationResult
`inBox'` Box d p r
b | Point d r
q Point d r -> Box d p r -> Bool
forall (d :: Nat) r p.
(Arity d, Ord r) =>
Point d r -> Box d p r -> Bool
`insideBox` Box d p r
b = PointLocationResult
Inside
| Point d r
q Point d r -> Box d p r -> Bool
forall (d :: Nat) r p.
(Arity d, Ord r) =>
Point d r -> Box d p r -> Bool
`inBox` Box d p r
b = PointLocationResult
OnBoundary
| Bool
otherwise = PointLocationResult
Outside