module Data.Drasil.Quantities.Math where
import Language.Drasil
import Drasil.Database (mkUid)
import Language.Drasil.Display (Symbol(Atop), Decoration(Magnitude))
import Language.Drasil.ShortHands
import qualified Data.Drasil.Concepts.Math as CM (area, diameter, euclidN, gradient,
normalV, orient, perpV, surArea, surface, unitV)
import Data.Drasil.SI_Units (metre, m_2, radian)
mathquants :: [DefinedQuantityDict]
mathquants :: [DefinedQuantityDict]
mathquants = [DefinedQuantityDict
gradient, DefinedQuantityDict
normalVect, DefinedQuantityDict
unitVect, DefinedQuantityDict
perpVect,
DefinedQuantityDict
pi_, DefinedQuantityDict
posInf, DefinedQuantityDict
negInf, DefinedQuantityDict
euclidNorm]
mathunitals :: [DefinedQuantityDict]
mathunitals :: [DefinedQuantityDict]
mathunitals = [DefinedQuantityDict
area, DefinedQuantityDict
diameter, DefinedQuantityDict
surface, DefinedQuantityDict
surArea, DefinedQuantityDict
orientation]
gradient, normalVect, unitVect, unitVectj, euclidNorm, perpVect,
pi_, posInf, negInf, uNormalVect :: DefinedQuantityDict
gradient :: DefinedQuantityDict
gradient = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.gradient Symbol
lNabla Space
Real
normalVect :: DefinedQuantityDict
normalVect = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.normalV (Symbol -> Symbol
vec Symbol
lN) Space
Real
uNormalVect :: DefinedQuantityDict
uNormalVect = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.normalV (Symbol -> Symbol
vec (Symbol -> Symbol) -> Symbol -> Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> Symbol
hat Symbol
lN) Space
Real
unitVect :: DefinedQuantityDict
unitVect = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.unitV (Symbol -> Symbol
vec (Symbol -> Symbol) -> Symbol -> Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> Symbol
hat Symbol
lI) Space
Real
unitVectj :: DefinedQuantityDict
unitVectj = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.unitV (Symbol -> Symbol
vec (Symbol -> Symbol) -> Symbol -> Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> Symbol
hat Symbol
lJ) Space
Real
perpVect :: DefinedQuantityDict
perpVect = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.perpV (Symbol -> Symbol
vec Symbol
lN) Space
Real
pi_ :: DefinedQuantityDict
pi_ = UID
-> NP
-> Sentence
-> (Stage -> Symbol)
-> Space
-> DefinedQuantityDict
quantNoUnit' (String -> UID
mkUid String
"pi") (String -> NP
forall a. String -> NPG a
cn' String
"ratio of circumference to diameter for any circle")
(String -> Sentence
S String
"The ratio of a circle's circumference to its diameter")
(Symbol -> Symbol -> Stage -> Symbol
staged Symbol
lPi (String -> Symbol
variable String
"pi")) Space
Real
posInf :: DefinedQuantityDict
posInf = UID
-> NP
-> Sentence
-> (Stage -> Symbol)
-> Space
-> DefinedQuantityDict
quantNoUnit' (String -> UID
mkUid String
"PosInf") (String -> NP
forall a. String -> NPG a
cn' String
"Positive Infinity")
(String -> Sentence
S String
"the limit of a sequence or function that eventually exceeds any prescribed bound")
(Symbol -> Symbol -> Stage -> Symbol
staged Symbol
lPosInf (String -> Symbol
variable String
"posInf")) Space
Real
negInf :: DefinedQuantityDict
negInf = UID
-> NP
-> Sentence
-> (Stage -> Symbol)
-> Space
-> DefinedQuantityDict
quantNoUnit' (String -> UID
mkUid String
"NegInf") (String -> NP
forall a. String -> NPG a
cn' String
"Negative Infinity")
(String -> Sentence
S String
"Opposite of positive infinity")
(Symbol -> Symbol -> Stage -> Symbol
staged Symbol
lNegInf (String -> Symbol
variable String
"posInf")) Space
Real
euclidNorm :: DefinedQuantityDict
euclidNorm = ConceptChunk -> Symbol -> Space -> DefinedQuantityDict
dqdNoUnit ConceptChunk
CM.euclidN (Decoration -> Symbol -> Symbol
Atop Decoration
Magnitude (Symbol -> Symbol) -> Symbol -> Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> Symbol
vec Symbol
lD) Space
Real
area, diameter, surface, surArea, orientation :: DefinedQuantityDict
area :: DefinedQuantityDict
area = ConceptChunk -> Symbol -> Space -> UnitDefn -> DefinedQuantityDict
dqd ConceptChunk
CM.area Symbol
cA Space
Real UnitDefn
m_2
diameter :: DefinedQuantityDict
diameter = ConceptChunk -> Symbol -> Space -> UnitDefn -> DefinedQuantityDict
dqd ConceptChunk
CM.diameter Symbol
lD Space
Real UnitDefn
metre
surface :: DefinedQuantityDict
surface = ConceptChunk -> Symbol -> Space -> UnitDefn -> DefinedQuantityDict
dqd ConceptChunk
CM.surface Symbol
cS Space
Real UnitDefn
m_2
surArea :: DefinedQuantityDict
surArea = ConceptChunk -> Symbol -> Space -> UnitDefn -> DefinedQuantityDict
dqd ConceptChunk
CM.surArea Symbol
cA Space
Real UnitDefn
m_2
orientation :: DefinedQuantityDict
orientation = ConceptChunk -> Symbol -> Space -> UnitDefn -> DefinedQuantityDict
dqd ConceptChunk
CM.orient Symbol
lPhi Space
Real UnitDefn
radian
piConst :: ConstQDef
piConst :: ConstQDef
piConst = DefinedQuantityDict -> Literal -> ConstQDef
forall c e.
(Quantity c, MayHaveUnit c, Concept c) =>
c -> e -> QDefinition e
mkQuantDef DefinedQuantityDict
pi_ (Double -> Literal
forall r. LiteralC r => Double -> r
dbl Double
3.14159265)