y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]^_`abcdefghijklmnopqrstuvwxyz{|}~LProjective matrices, encoding affine transformations in dimension one less. Orthogonal matrices.  Note: the Random< instances generates orthogonal matrices with determinant 1 ? (that is, orientation-preserving orthogonal transformations)! OThe assumption when dealing with these is always that they are of unit length. ( Also, interpolation works differently. The components are row vectors " Projective"7 matrices have the following form: the top left corner C is an any matrix, the bottom right corner is 1, and the top-right H column is zero. These describe the affine orthogonal transformation of  the space one dimension less. 0Outer product (could be unified with Diagonal?) ,&makes a diagonal matrix from a vector .Bconversion between vectors (and matrices) of different dimensions 7Pointwise multiplication :Cross product athe angle between two vectors b#the angle between two unit vectors cIProjects the first vector onto the direction of the second (unit) vector d/Direction (second argument) is assumed to be a unit vector! fASince unit vectors are not a group, we need a separate function. gHouseholder matrix, see  7http://en.wikipedia.org/wiki/Householder_transformation. X In plain words, it is the reflection to the hyperplane orthogonal to the input vector. l  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklXYZ[\]UVWT^QRSNOPIJKLMBCDEFGH:;<_`ab=>?@A789./0123456()*+ ,-%&'!"#$  ijkecdfghl    !"#$"#$%&'&'()*+)*+,--./01/0123456345678989:;<;<=>?@A>?@ABCDEFGHCDEFGHIJKLMJKLMNOPOPQRSRSTUVWVWXYZ[\YZ[\]^_`abcdefghijklproduces orthogonal/.orthonormal vectors from a set of vectors lmnlmnlmnmno Example: structVec2 [1,2,3,4] = [ Vec2 1 2 , Vec2 3 4 ]. pThe opposite of  structVec2. vhunit 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 :) y*The angle relative to the positive X axis {ARotation matrix by a given angle (in radians), counterclockwise. ~(Rotates counterclockwise by 90 degrees. !Rotates clockwise by 90 degrees. opqrstuvwxyz{|}~opqrstuvwxyz{|}~opqrstuvwxyz{|}~ Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]. The opposite of  structVec3. gRotation around an arbitrary 3D vector. The resulting 3x3 matrix is intended for multiplication on the right.  Rotation around an arbitrary 3D unitH vector. The resulting 3x3 matrix is intended for multiplication on the right. 5Reflects a vector to an axis: that is, the result of  reflect n v is  2<n,v>n - v  Refraction.  First parameter (eta$) is the relative refraction index   refl_inside  eta = --------------  refl_outside where "inside"* is the direction of the second argument 7 (to vector normal to plane which models the boundary @ between the two materials). That is, total internal reflection  can occur when eta>1. ?The convention is that the origin is the point of intersection 1 of the ray and the surface, and all the vectors " point away"  from here (unlike, say, GLSL's refract, where the incident  vector "points towards" the material) 6When total internal reflection would occur, we return Nothing. If  (x,y,u,v)9 is an orthonormal system, then (written in pseudo-code)  7biVector4 (x,y) = plusMinus (reverse $ biVector4 (u,v)). @ This is a helper function for the 4 dimensional rotation code.  If (x,y,z,p,q,r) = biVector4 a b1, then the corresponding antisymmetric tensor is  [ 0 r q p ]  [ -r 0 z -y ]  [ -q -z 0 x ]  [ -p y -x 0 ] 'the corresponding antisymmetric tensor +We assume that the axes are normalized and  orthogonal to each other! 6We assume only that the axes are independent vectors. ?Rotation matrix around a plane specified by two normalized and  orthogonal vectors. $ Intended for multiplication on the right! 6We assume only that the axes are independent vectors.  synonym for rotateAfterProj4  Synonym for m# -> m .*. rotMatrixProj4 angle axis.  Synonym for m# -> rotMatrixProj4 angle axis .*. m. Equivalent to m -> scaling v .*. m. Equivalent to m -> m .*. scaling v.  Synonym for translateAfter4 Equivalent to m -> m .*. translation v. Equivalent to m -> translation v .*. m. LProjective matrices, encoding affine transformations in dimension one less. Orthogonal matrices.  Note: the Random< instances generates orthogonal matrices with determinant 1 ? (that is, orientation-preserving orthogonal transformations)! OThe assumption when dealing with these is always that they are of unit length. ( Also, interpolation works differently. The components are row vectors " Projective"7 matrices have the following form: the top left corner C is an any matrix, the bottom right corner is 1, and the top-right H column is zero. These describe the affine orthogonal transformation of  the space one dimension less. 0Outer product (could be unified with Diagonal?) &makes a diagonal matrix from a vector Bconversion between vectors (and matrices) of different dimensions Pointwise multiplication Cross product the angle between two vectors #the angle between two unit vectors IProjects the first vector onto the direction of the second (unit) vector /Direction (second argument) is assumed to be a unit vector! ASince unit vectors are not a group, we need a separate function. Householder matrix, see  7http://en.wikipedia.org/wiki/Householder_transformation. X In plain words, it is the reflection to the hyperplane orthogonal to the input vector. l     l     l          produces orthogonal/.orthonormal vectors from a set of vectors  !" !" !"!" # Example: structVec2 [1,2,3,4] = [ Vec2 1 2 , Vec2 3 4 ]. $The opposite of  structVec2. *hunit 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 :) -*The angle relative to the positive X axis /ARotation matrix by a given angle (in radians), counterclockwise. 2(Rotates counterclockwise by 90 degrees. 3!Rotates clockwise by 90 degrees. #$%&'()*+,-./0123#$%&'()*+,-./0123#$%&'()*+,-./0123 4 Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]. 5The opposite of  structVec3. BgRotation around an arbitrary 3D vector. The resulting 3x3 matrix is intended for multiplication on the right. D Rotation around an arbitrary 3D unitH vector. The resulting 3x3 matrix is intended for multiplication on the right. F5Reflects a vector to an axis: that is, the result of  reflect n v is  2<n,v>n - v I Refraction.  First parameter (eta$) is the relative refraction index   refl_inside  eta = --------------  refl_outside where "inside"* is the direction of the second argument 7 (to vector normal to plane which models the boundary @ between the two materials). That is, total internal reflection  can occur when eta>1. ?The convention is that the origin is the point of intersection 1 of the ray and the surface, and all the vectors " point away"  from here (unlike, say, GLSL's refract, where the incident  vector "points towards" the material) J6When total internal reflection would occur, we return Nothing. 456789:;<=>?@ABCDEFGHIJ456789:;<=>?@ABCDEFGHIJ456789:;<=>?@ABCDEFGHIJ KLKLKLL WIf  (x,y,u,v)9 is an orthonormal system, then (written in pseudo-code)  7biVector4 (x,y) = plusMinus (reverse $ biVector4 (u,v)). @ This is a helper function for the 4 dimensional rotation code.  If (x,y,z,p,q,r) = biVector4 a b1, then the corresponding antisymmetric tensor is  [ 0 r q p ]  [ -r 0 z -y ]  [ -q -z 0 x ]  [ -p y -x 0 ] X'the corresponding antisymmetric tensor Y+We assume that the axes are normalized and  orthogonal to each other! Z6We assume only that the axes are independent vectors. [?Rotation matrix around a plane specified by two normalized and  orthogonal vectors. $ Intended for multiplication on the right! \6We assume only that the axes are independent vectors. MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\_ synonym for rotateAfterProj4 ` Synonym for m# -> m .*. rotMatrixProj4 angle axis. a Synonym for m# -> rotMatrixProj4 angle axis .*. m. cEquivalent to m -> scaling v .*. m. dEquivalent to m -> m .*. scaling v. e Synonym for translateAfter4 fEquivalent to m -> m .*. translation v. gEquivalent to m -> translation v .*. m. ]^_`abcdefg ]^_`abcdefg ]^_`abcdefglEThere should be a big warning here about the different conventions, L hidden transpositions, and all the confusion this will inevitably cause... As it stands,  = glRotate t1 axis1 >> glRotate t2 axis2 >> glRotate t3 axis3 has the same result as  ^ multMatrix (rotMatrixProj4 t3 axis3 .*. rotMatrixProj4 t2 axis2 .*. rotMatrixProj4 t1 axis1) Mbecause at the interface of OpenGL and this library there is a transposition N to compensate for the different conventions. (This transposition is implicit L in the code, because the way the matrices are stored in the memory is also K different: OpenGL stores them column-major, and we store them row-major). u9The angle is in radians. (WARNING: OpenGL uses degrees!) y"Orthogonal projecton" matrix, a la OpenGL < (the corresponding functionality is removed in OpenGL 3.1) z The same as  orthoMatrix(, but with a different parametrization. {"Perspective projecton" matrix, a la OpenGL = (the corresponding functionality is removed in OpenGL 3.1). | The same as  frustumMatrix(, but with a different parametrization. hijklmnopqrstuvwxyz{|lmjknopqrstuvwxyz{|hihiijkklmmnopqrstuvwxyz{|  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkopqrstuvwxyz{|}~hijklmnopqrstuvwxyz{|EThere should be a big warning here about the different conventions, L hidden transpositions, and all the confusion this will inevitably cause... As it stands,  = glRotate t1 axis1 >> glRotate t2 axis2 >> glRotate t3 axis3 has the same result as  ^ multMatrix (rotMatrixProj4 t3 axis3 .*. rotMatrixProj4 t2 axis2 .*. rotMatrixProj4 t1 axis1) Mbecause at the interface of OpenGL and this library there is a transposition N to compensate for the different conventions. (This transposition is implicit L in the code, because the way the matrices are stored in the memory is also K different: OpenGL stores them column-major, and we store them row-major). 9The angle is in radians. (WARNING: OpenGL uses degrees!) "Orthogonal projecton" matrix, a la OpenGL < (the corresponding functionality is removed in OpenGL 3.1)  The same as  orthoMatrix(, but with a different parametrization. "Perspective projecton" matrix, a la OpenGL = (the corresponding functionality is removed in OpenGL 3.1).  The same as  frustumMatrix(, but with a different parametrization. }~}~}~~     #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL]^_`abcdefg}~     #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL]^_`abcdefg}~  !!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy z { | } ~    vect-0.4.5Data.Vect.Double.BaseData.Vect.Double.GramSchmidtData.Vect.Double.Util.Dim2Data.Vect.Double.Util.Dim3Data.Vect.Double.InterpolateData.Vect.Double.Util.Dim4 Data.Vect.Double.Util.ProjectiveData.Vect.Float.BaseData.Vect.Float.GramSchmidtData.Vect.Float.Util.Dim2Data.Vect.Float.Util.Dim3Data.Vect.Float.InterpolateData.Vect.Float.Util.Dim4Data.Vect.Float.Util.ProjectiveData.Vect.Double.OpenGLData.Vect.Float.OpenGLData.Vect.DoubleData.Vect.Float Data.VectProj4Proj3Ortho4Ortho3Ortho2Normal4Normal3Normal2Mat4Mat3Mat2Vec4Vec3Vec2 ProjectivefromProjectivetoProjectiveUnsafe orthogonallinear translationscaling Dimensiondim DeterminantdetTensorouter MatrixNorms frobeniusNormmatrixDistance operatorNorm Orthogonal fromOrtho toOrthoUnsafeMatrix transposeinverseidmtxDiagonaldiagExtend extendZero extendWithtrimHasCoordinates_1_2_3_4 Pointwise pointwise&! CrossProd crossprod&^ UnitVectormkNormaltoNormalUnsafe fromNormalfromNormalRadiusDotProd&.normnormsqrlenlensqrdotprodVectormapVec scalarMul*&&* RightModulermul.* LeftModulelmul*.Ring MultSemiGroup.*.one AbelianGroup&+&-negzerovecSumsemigroupProduct normalizedistanceangleangle'project' projectUnsafeproject flipNormal householderhouseholderOrthomkVec2mkVec3mkVec4 GramSchmidt gramSchmidtgramSchmidtNormalize structVec2 destructVec2det2vec2Xvec2Y translate2X translate2YsinCossinCos' sinCosRadiusangle2angle2' rotMatrix2rotMatrixOrtho2rotate2 rotateCCWrotateCW structVec3 destructVec3det3 translate3X translate3Y translate3Zvec3Xvec3Yvec3Z rotMatrixZ rotMatrixY rotMatrixXrotate3'rotate3 rotMatrix3rotMatrixOrtho3 rotMatrix3'rotMatrixOrtho3'reflectreflect'refractrefract' refractOnly' Interpolate interpolate structVec4 destructVec4 translate4X translate4Y translate4Z translate4Wvec4Xvec4Yvec4Zvec4W biVector4biVector4AsTensorrotate4'rotate4 rotMatrix4' rotMatrix4rotMatrixProj4'rotMatrixProj4 rotateProj4rotateAfterProj4rotateBeforeProj4scalingUniformProj4scaleBeforeProj4scaleAfterProj4 translate4translateAfter4translateBefore4 VertexAttrib' vertexAttribFromOpenGLMatrix peekGLMatrixToOpenGLMatrix makeGLMatrix setMatrix getMatrixmatrix currentMatrix multMatrixradianToDegreesdegreesToRadianglRotate glTranslateglScale3glScale orthoMatrix orthoMatrix2 frustumMatrixfrustumMatrix2