{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Math.Manifold.Core.Types
( EmptyMfd(..), ℝ⁰, ℝ
, S⁰, S⁰_(..), otherHalfSphere, S¹, S¹_(..), pattern S¹, S², S²_(..), pattern S²
, D¹, D¹_(..), fromIntv0to1, D², D²_(..), pattern D²
, ℝP⁰, ℝP⁰_(..), ℝP¹, ℝP¹_(..), pattern ℝP¹, ℝP², ℝP²_(..), pattern ℝP²
, Cℝay(..), CD¹(..)
) where
import Math.Manifold.Core.Types.Internal
import Math.Manifold.Core.PseudoAffine
import Data.VectorSpace
import Math.Manifold.VectorSpace.ZeroDimensional
import Data.AffineSpace
import Data.Basis
import Data.Void
import Data.Monoid
otherHalfSphere :: S⁰ -> S⁰
otherHalfSphere :: S⁰ -> S⁰
otherHalfSphere S⁰
PositiveHalfSphere = S⁰
forall r. S⁰_ r
NegativeHalfSphere
otherHalfSphere S⁰
NegativeHalfSphere = S⁰
forall r. S⁰_ r
PositiveHalfSphere
{-# DEPRECATED S¹ "Use Math.Manifold.Core.Types.S¹Polar" #-}
pattern S¹ :: Double -> S¹
pattern $bS¹ :: Double -> S¹
$mS¹ :: forall r. S¹ -> (Double -> r) -> (Void# -> r) -> r
S¹ φ = S¹Polar φ
{-# DEPRECATED ℝP¹ "Use Math.Manifold.Core.Types.HemisphereℝP¹Polar (notice: different range)" #-}
pattern ℝP¹ :: Double -> ℝP¹
pattern $bℝP¹ :: Double -> ℝP¹
$mℝP¹ :: forall r. ℝP¹ -> (Double -> r) -> (Void# -> r) -> r
ℝP¹ r <- (HemisphereℝP¹Polar ((2/pi*)->r))
where ℝP¹ Double
r = Double -> ℝP¹
forall r. r -> ℝP¹_ r
HemisphereℝP¹Polar (Double -> ℝP¹) -> Double -> ℝP¹
forall a b. (a -> b) -> a -> b
$ Double
r Double -> Double -> Double
forall a. Num a => a -> a -> a
* Double
forall a. Floating a => a
piDouble -> Double -> Double
forall a. Fractional a => a -> a -> a
/Double
2
{-# DEPRECATED S² "Use Math.Manifold.Core.Types.S²Polar" #-}
pattern S² :: Double -> Double -> S²
pattern $bS² :: Double -> Double -> S²
$mS² :: forall r. S² -> (Double -> Double -> r) -> (Void# -> r) -> r
S² ϑ φ = S²Polar ϑ φ
{-# DEPRECATED ℝP² "Use Math.Manifold.Core.Types.HemisphereℝP²Polar (notice: different range)" #-}
pattern ℝP² :: Double -> Double -> ℝP²
pattern $bℝP² :: Double -> Double -> ℝP²
$mℝP² :: forall r. ℝP² -> (Double -> Double -> r) -> (Void# -> r) -> r
ℝP² r φ <- (HemisphereℝP²Polar ((2/pi*)->r) φ)
where ℝP² Double
r Double
φ = Double -> Double -> ℝP²
forall r. r -> r -> ℝP²_ r
HemisphereℝP²Polar (Double
r Double -> Double -> Double
forall a. Num a => a -> a -> a
* Double
forall a. Floating a => a
piDouble -> Double -> Double
forall a. Fractional a => a -> a -> a
/Double
2) Double
φ
{-# DEPRECATED D² "Use Math.Manifold.Core.Types.D²Polar" #-}
pattern D² :: Double -> Double -> D²
pattern $bD² :: Double -> Double -> D²
$mD² :: forall r. D² -> (Double -> Double -> r) -> (Void# -> r) -> r
D² r φ = D²Polar r φ
fromIntv0to1 :: ℝ -> D¹
fromIntv0to1 :: Double -> D¹
fromIntv0to1 Double
x | Double
xDouble -> Double -> Bool
forall a. Ord a => a -> a -> Bool
<Double
0 = Double -> D¹
forall r. r -> D¹_ r
D¹ (-Double
1)
| Double
xDouble -> Double -> Bool
forall a. Ord a => a -> a -> Bool
>Double
1 = Double -> D¹
forall r. r -> D¹_ r
D¹ Double
1
| Bool
otherwise = Double -> D¹
forall r. r -> D¹_ r
D¹ (Double -> D¹) -> Double -> D¹
forall a b. (a -> b) -> a -> b
$ Double
xDouble -> Double -> Double
forall a. Num a => a -> a -> a
*Double
2 Double -> Double -> Double
forall a. Num a => a -> a -> a
- Double
1
instance VectorSpace () where
type Scalar () = ℝ
Scalar ()
_ *^ :: Scalar () -> () -> ()
*^ () = ()
instance HasBasis () where
type Basis () = Void
basisValue :: Basis () -> ()
basisValue = Basis () -> ()
forall a. Void -> a
absurd
decompose :: () -> [(Basis (), Scalar ())]
decompose () = []
decompose' :: () -> Basis () -> Scalar ()
decompose' () = Basis () -> Scalar ()
forall a. Void -> a
absurd
instance InnerSpace () where
() <.> :: () -> () -> Scalar ()
<.> () = Scalar ()
0