Animas-0.2: Updated version of Yampa: a library for programming hybrid systems.

Portability non-portable (GHC extensions) provisional nilsson@cs.yale.edu

FRP.Animas.Vector2

Description

2D vector abstraction (R^2).

ToDo: Deriving Show, or provide dedicated show instance?

Synopsis

# Documentation

data RealFloat a => Vector2 a Source

2-dimensional vector type

Instances

 RealFloat a => Eq (Vector2 a) RealFloat a => Show (Vector2 a) RealFloat a => Forceable (Vector2 a) RealFloat a => VectorSpace (Vector2 a) a Rotate a vector by some angle theta RealFloat a => AffineSpace (Point2 a) (Vector2 a) a

Arguments

 :: RealFloat a => a X magnitude -> a Y magnitude -> Vector2 a Vector

Create a 2D vector

Obtain the X-magnitude of a vector

vector2X :: RealFloat a => Vector2 a -> aSource

Obtain the Y-magnitude of a vector

vector2Y :: RealFloat a => Vector2 a -> aSource

Obtain the X and Y magnitudes of a vector as an ordered pair

Arguments

 :: RealFloat a => Vector2 a -> (a, a) (X, Y)

Create a vector from polar coordinates (magnituderho, directiontheta (radians))

Arguments

 :: RealFloat a => a Rho -> a Theta -> Vector2 a Vector

Obtain the magnitude of a vector

vector2Rho :: RealFloat a => Vector2 a -> aSource

Obtain the direction of a vector

vector2Theta :: RealFloat a => Vector2 a -> aSource

Obtain the magnitude and direction of a vector as an ordered pair

Arguments

 :: RealFloat a => Vector2 a -> (a, a) (Rho, Theta)

Arguments

 :: RealFloat a => a Theta (radians) -> Vector2 a Initial vector -> Vector2 a Rotated vector