simple-affine-space-0.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.Vector3

Description

3D vector abstraction (R^3).

Synopsis

# Documentation

data Vector3 a #

3D Vector.

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

vector3 :: RealFloat a => a -> a -> a -> Vector3 a #

Creates a 3D vector from the cartesian coordinates.

vector3X :: RealFloat a => Vector3 a -> a #

X cartesian coordinate.

vector3Y :: RealFloat a => Vector3 a -> a #

Y cartesian coordinate.

vector3Z :: RealFloat a => Vector3 a -> a #

Z cartesian coordinate.

vector3XYZ :: RealFloat a => Vector3 a -> (a, a, a) #

Returns a vector's cartesian coordinates.

vector3Spherical :: RealFloat a => a -> a -> a -> Vector3 a #

Creates a 3D vector from the spherical coordinates.

vector3Rho :: RealFloat a => Vector3 a -> a #

vector3Theta :: RealFloat a => Vector3 a -> a #

Calculates the vector's azimuth.

vector3Phi :: RealFloat a => Vector3 a -> a #

Calculates the vector's inclination.

vector3RhoThetaPhi :: RealFloat a => Vector3 a -> (a, a, a) #

Spherical coordinate representation of a 3D vector.

vector3Rotate :: RealFloat a => a -> a -> Vector3 a -> Vector3 a #

Rotates a vector with a given polar and azimuthal angles.