Copyright | (c) Antony Courtney and Henrik Nilsson Yale University 2003 |
---|---|
License | BSD-style (see the LICENSE file in the distribution) |
Maintainer | nilsson@cs.yale.edu |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe |
Language | Haskell98 |
2D vector abstraction (R^2).
- 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.
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.