Copyright | (c) Scott N. Walck 2012-2018 |
---|---|

License | BSD3 (see LICENSE) |

Maintainer | Scott N. Walck <walck@lvc.edu> |

Stability | experimental |

Safe Haskell | Safe |

Language | Haskell98 |

Basic operations on the vector type `Vec`

, such as vector addition
and scalar multiplication.
This module is simple in the sense that the operations
on vectors all have simple, concrete types,
without the need for type classes.
This makes using and reasoning about vector operations
easier for a person just learning Haskell.

## Synopsis

- data Vec
- type R = Double
- xComp :: Vec -> Double
- yComp :: Vec -> Double
- zComp :: Vec -> Double
- vec :: Double -> Double -> Double -> Vec
- (^+^) :: Vec -> Vec -> Vec
- (^-^) :: Vec -> Vec -> Vec
- (*^) :: R -> Vec -> Vec
- (^*) :: Vec -> R -> Vec
- (^/) :: Vec -> R -> Vec
- (<.>) :: Vec -> Vec -> R
- (><) :: Vec -> Vec -> Vec
- magnitude :: Vec -> R
- zeroV :: Vec
- negateV :: Vec -> Vec
- sumV :: [Vec] -> Vec
- iHat :: Vec
- jHat :: Vec
- kHat :: Vec

# Documentation

A type for vectors.

## Instances

Eq Vec Source # | |

Show Vec Source # | |

VectorSpace Vec # | |

InnerSpace Vec # | |

AdditiveGroup Vec # | |

StateSpace Vec Source # | |

type Scalar Vec # | |

Defined in Physics.Learn.CarrotVec | |

type Diff Vec Source # | |

Defined in Physics.Learn.StateSpace |

Form a vector by giving its x, y, and z components.

(*^) :: R -> Vec -> Vec infixl 7 Source #

Scalar multiplication, where the scalar is on the left and the vector is on the right.