learn-physics-0.2: Haskell code for learning physics

Stabilityexperimental
MaintainerScott N. Walck <walck@lvc.edu>
Safe HaskellTrustworthy

Physics.Learn.StateSpace

Description

A StateSpace is an affine space where the associated vector space has scalars that are instances of Fractional. If p is an instance of StateSpace, then the associated vectorspace Diff p is intended to represent the space of time derivatives of paths in p.

StateSpace is very similar to Conal Elliott's AffineSpace.

Synopsis

Documentation

class (VectorSpace (Diff p), Fractional (Scalar (Diff p))) => StateSpace p whereSource

A StateSpace has an associated vector space, the vectors of which can be multiplied or divided by scalars. An example would be the set of positions of a particle. Position is not a vector, but displacement (difference in position) is a vector.

Associated Types

type Diff p Source

Associated vector space

Methods

(.-.) :: p -> p -> Diff pSource

Subtract points

(.+^) :: p -> Diff p -> pSource

Point plus vector

Instances

StateSpace Double 
StateSpace Vec 
StateSpace Position 
(StateSpace p, StateSpace q, ~ * (Time p) (Time q)) => StateSpace (p, q) 
(StateSpace p, StateSpace q, StateSpace r, ~ * (Time p) (Time q), ~ * (Time q) (Time r)) => StateSpace (p, q, r) 

(.-^) :: StateSpace p => p -> Diff p -> pSource

Point minus vector

type Time p = Scalar (Diff p)Source

The scalars of the associated vector space can be thought of as time intervals.