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

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.

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

# Documentation

A type for vectors.

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

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

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