learn-physics-0.6.3: Haskell code for learning physics

Copyright(c) Scott N. Walck 2012-2014
LicenseBSD3 (see LICENSE)
MaintainerScott N. Walck <walck@lvc.edu>
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell98

Physics.Learn.CommonVec

Description

This module defines some common vector operations. It is intended that this module not be imported directly, but that its functionality be gained by importing either SimpleVec or CarrotVec, but not both. Choose SimpleVec for vector operations (such as vector addition) with simple concrete types, which work only with the type Vec of three-dimensional vectors. Choose CarrotVec for vector operations that work with any type in the appropriate type class.

Synopsis

Documentation

data Vec Source #

A type for vectors.

Constructors

Vec 

Fields

Instances
Eq Vec Source # 
Instance details

Defined in Physics.Learn.CommonVec

Methods

(==) :: Vec -> Vec -> Bool #

(/=) :: Vec -> Vec -> Bool #

Show Vec Source # 
Instance details

Defined in Physics.Learn.CommonVec

Methods

showsPrec :: Int -> Vec -> ShowS #

show :: Vec -> String #

showList :: [Vec] -> ShowS #

VectorSpace Vec # 
Instance details

Defined in Physics.Learn.CarrotVec

Associated Types

type Scalar Vec :: * #

Methods

(*^) :: Scalar Vec -> Vec -> Vec #

InnerSpace Vec # 
Instance details

Defined in Physics.Learn.CarrotVec

Methods

(<.>) :: Vec -> Vec -> Scalar Vec #

AdditiveGroup Vec # 
Instance details

Defined in Physics.Learn.CarrotVec

Methods

zeroV :: Vec #

(^+^) :: Vec -> Vec -> Vec #

negateV :: Vec -> Vec #

(^-^) :: Vec -> Vec -> Vec #

StateSpace Vec Source # 
Instance details

Defined in Physics.Learn.StateSpace

Associated Types

type Diff Vec :: * Source #

Methods

(.-.) :: Vec -> Vec -> Diff Vec Source #

(.+^) :: Vec -> Diff Vec -> Vec Source #

type Scalar Vec # 
Instance details

Defined in Physics.Learn.CarrotVec

type Diff Vec Source # 
Instance details

Defined in Physics.Learn.StateSpace

type Diff Vec = Vec

vec Source #

Arguments

:: Double

x component

-> Double

y component

-> Double

z component

-> Vec 

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

(><) :: Vec -> Vec -> Vec infixl 7 Source #

Cross product.

iHat :: Vec Source #

Unit vector in the x direction.

jHat :: Vec Source #

Unit vector in the y direction.

kHat :: Vec Source #

Unit vector in the z direction.