module Math.Manifold.Core.Types where
import Data.VectorSpace
import Math.Manifold.VectorSpace.ZeroDimensional
import Data.AffineSpace
import Data.Basis
import Data.Void
import Data.Monoid
import Control.Applicative (Const(..), Alternative(..))
data S⁰ = PositiveHalfSphere | NegativeHalfSphere deriving(Eq, Show)
otherHalfSphere :: S⁰ -> S⁰
otherHalfSphere PositiveHalfSphere = NegativeHalfSphere
otherHalfSphere NegativeHalfSphere = PositiveHalfSphere
newtype S¹ = S¹ { φParamS¹ :: Double
} deriving (Show)
type ℝP¹ = S¹
newtype D¹ = D¹ { xParamD¹ :: Double
} deriving (Show)
fromIntv0to1 :: ℝ -> D¹
fromIntv0to1 x | x<0 = D¹ (1)
| x>1 = D¹ 1
| otherwise = D¹ $ x*2 1
type ℝ = Double
type ℝ⁰ = ZeroDim ℝ
instance VectorSpace () where
type Scalar () = ℝ
_ *^ () = ()
instance HasBasis () where
type Basis () = Void
basisValue = absurd
decompose () = []
decompose' () = absurd
instance InnerSpace () where
() <.> () = 0