Yampa-0.11.1: Library for programming hybrid systems.

Copyright(c) Antony Courtney and Henrik Nilsson Yale University 2003
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainernilsson@cs.yale.edu
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe
LanguageHaskell98

FRP.Yampa.Vector2

Description

2D vector abstraction (R^2).

Synopsis

Documentation

data Vector2 a Source #

2D Vector.

Instances
Eq a => Eq (Vector2 a) Source # 
Instance details

Defined in FRP.Yampa.Vector2

Methods

(==) :: Vector2 a -> Vector2 a -> Bool #

(/=) :: Vector2 a -> Vector2 a -> Bool #

Show a => Show (Vector2 a) Source # 
Instance details

Defined in FRP.Yampa.Vector2

Methods

showsPrec :: Int -> Vector2 a -> ShowS #

show :: Vector2 a -> String #

showList :: [Vector2 a] -> ShowS #

RealFloat a => Forceable (Vector2 a) Source # 
Instance details

Defined in FRP.Yampa.Vector2

Methods

force :: Vector2 a -> Vector2 a Source #

RealFloat a => VectorSpace (Vector2 a) a Source # 
Instance details

Defined in FRP.Yampa.Vector2

RealFloat a => AffineSpace (Point2 a) (Vector2 a) a Source # 
Instance details

Defined in FRP.Yampa.Point2

Methods

origin :: Point2 a Source #

(.+^) :: Point2 a -> Vector2 a -> Point2 a Source #

(.-^) :: Point2 a -> Vector2 a -> Point2 a Source #

(.-.) :: Point2 a -> Point2 a -> Vector2 a Source #

distance :: Point2 a -> Point2 a -> a Source #

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

Creates a 2D vector from the cartesian coordinates.

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

X cartesian coordinate.

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

Y cartesian coordinate.

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

Returns a vector's cartesian coordinates.

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

Creates a 2D vector from the polar coordinates.

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

Calculates the vector's radial distance (magnitude).

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

Calculates the vector's azimuth (angle).

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

Polar coordinate representation of a 2D vector.

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

Rotates a vector with a given angle.