simple-affine-space-0.1.1: A simple library for affine and vector spaces.

Copyright (c) Antony Courtney and Henrik Nilsson Yale University 2003 BSD-style (see the LICENSE file in the distribution) ivan.perez@keera.co.uk provisional non-portable (GHC extensions) Safe Haskell98

Data.Vector2

Description

2D vector abstraction (R^2).

Synopsis

Documentation

data Vector2 a #

2D Vector.

Instances
 Eq a => Eq (Vector2 a) # Instance detailsDefined in Data.Vector2 Methods(==) :: Vector2 a -> Vector2 a -> Bool #(/=) :: Vector2 a -> Vector2 a -> Bool # Show a => Show (Vector2 a) # Instance detailsDefined in Data.Vector2 MethodsshowsPrec :: Int -> Vector2 a -> ShowS #show :: Vector2 a -> String #showList :: [Vector2 a] -> ShowS # NFData a => NFData (Vector2 a) # Instance detailsDefined in Data.Vector2 Methodsrnf :: Vector2 a -> () # RealFloat a => VectorSpace (Vector2 a) a # Instance detailsDefined in Data.Vector2 Methods(*^) :: a -> Vector2 a -> Vector2 a #(^/) :: Vector2 a -> a -> Vector2 a #(^+^) :: Vector2 a -> Vector2 a -> Vector2 a #(^-^) :: Vector2 a -> Vector2 a -> Vector2 a #negateVector :: Vector2 a -> Vector2 a #dot :: Vector2 a -> Vector2 a -> a #norm :: Vector2 a -> a #normalize :: Vector2 a -> Vector2 a # RealFloat a => AffineSpace (Point2 a) (Vector2 a) a # Instance detailsDefined in Data.Point2 Methods(.+^) :: Point2 a -> Vector2 a -> Point2 a #(.-^) :: Point2 a -> Vector2 a -> Point2 a #(.-.) :: Point2 a -> Point2 a -> Vector2 a #distance :: Point2 a -> Point2 a -> a #

vector2 :: RealFloat a => a -> a -> Vector2 a #

Creates a 2D vector from the cartesian coordinates.

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

X cartesian coordinate.

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

Y cartesian coordinate.

vector2XY :: RealFloat a => Vector2 a -> (a, a) #

Returns a vector's cartesian coordinates.

vector2Polar :: RealFloat a => a -> a -> Vector2 a #

Creates a 2D vector from the polar coordinates.

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

Calculates the vector's radial distance (magnitude).

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

Calculates the vector's azimuth (angle).

vector2RhoTheta :: RealFloat a => Vector2 a -> (a, a) #

Polar coordinate representation of a 2D vector.

vector2Rotate :: RealFloat a => a -> Vector2 a -> Vector2 a #

Rotates a vector with a given angle.