vect-0.4.7: A low-dimensional linear algebra library, tailored to computer graphics.

Data.Vect.Double.Util.Dim2

Synopsis

Documentation

structVec2 :: [Double] -> [Vec2]Source

Example: structVec2 [1,2,3,4] = [ Vec2 1 2 , Vec2 3 4 ].

destructVec2 :: [Vec2] -> [Double]Source

The opposite of structVec2.

sinCos :: Double -> Vec2Source

unit vector with given angle relative to the positive X axis (in the positive direction, that is, CCW). A more precise name would be cosSin, but that sounds bad :)

sinCosRadiusSource

Arguments

:: Double

angle (in radians)

-> Double

radius

-> Vec2 

angle2 :: Vec2 -> DoubleSource

The angle relative to the positive X axis

rotMatrix2 :: Double -> Mat2Source

Rotation matrix by a given angle (in radians), counterclockwise.

rotateCCW :: Vec2 -> Vec2Source

Rotates counterclockwise by 90 degrees.

rotateCW :: Vec2 -> Vec2Source

Rotates clockwise by 90 degrees.