Copyright | (c) Antony Courtney and Henrik Nilsson Yale University 2003 |
---|---|
License | BSD-style (see the LICENSE file in the distribution) |
Maintainer | ivan.perez@keera.co.uk |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
2D vector abstraction (R^2).
Synopsis
- data Vector2 a
- vector2 :: RealFloat a => a -> a -> Vector2 a
- vector2X :: RealFloat a => Vector2 a -> a
- vector2Y :: RealFloat a => Vector2 a -> a
- vector2XY :: RealFloat a => Vector2 a -> (a, a)
- vector2Polar :: RealFloat a => a -> a -> Vector2 a
- vector2Rho :: RealFloat a => Vector2 a -> a
- vector2Theta :: RealFloat a => Vector2 a -> a
- vector2RhoTheta :: RealFloat a => Vector2 a -> (a, a)
- vector2Rotate :: RealFloat a => a -> Vector2 a -> Vector2 a
Documentation
2D Vector.
Instances
Show a => Show (Vector2 a) Source # | |
NFData a => NFData (Vector2 a) Source # | |
Defined in Data.Vector2 | |
Eq a => Eq (Vector2 a) Source # | |
RealFloat a => VectorSpace (Vector2 a) a Source # | |
Defined in Data.Vector2 zeroVector :: Vector2 a Source # (*^) :: a -> Vector2 a -> Vector2 a Source # (^/) :: Vector2 a -> a -> Vector2 a Source # (^+^) :: Vector2 a -> Vector2 a -> Vector2 a Source # (^-^) :: Vector2 a -> Vector2 a -> Vector2 a Source # negateVector :: Vector2 a -> Vector2 a Source # dot :: Vector2 a -> Vector2 a -> a Source # | |
RealFloat a => AffineSpace (Point2 a) (Vector2 a) a Source # | |
vector2 :: RealFloat a => a -> a -> Vector2 a Source #
Creates a 2D vector from the 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.