!"#$%&'()*+,-./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 [ \ ] ^ _ ` a b c d e f g h i j k l m nopqrstuvwxyz{|}~}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?) !"?the frobenius norm (= euclidean norm in the space of matrices) #,euclidean distance in the space of matrices $0(euclidean) operator norm (not implemented yet) %&'()*+,&makes a diagonal matrix from a vector -.Bconversion between vectors (and matrices) of different dimensions / example: $extendZero (Vec2 5 6) = Vec4 5 6 0 0 0 example: &extendWith 1 (Vec2 5 6) = Vec4 5 6 1 1 1 example: trim (Vec4 5 6 7 8) = Vec2 5 6 234567Pointwise multiplication 89:Cross product ;<=>normalizes the input ?does not normalize the input! @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`athe angle between two vectors b#the angle between two unit vectors cXProjects the first vector down to the hyperplane orthogonal to the second (unit) vector d/Direction (second argument) is assumed to be a unit vector! efASince 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. hijkl  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklXYZ[\]UVWT^QRSNOPIJKLMBCDEFGH:;<_`ab=>?@A789./0123456()*+ ,-%&'!"#$  ijkecdfghl    !"#$"#$%&'&'()*+)*+,--./01/0123456345678989:;<;<=>?@A>?@ABCDEFGHCDEFGHIJKLMJKLMNOPOPQRSRSTUVWVWXYZ[\YZ[\]^_`abcdefghijkl Example: structVec2 [1,2,3,4] = [ Vec2 1 2 , Vec2 3 4 ]. mThe opposite of  structVec2. nopqrshunit 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 :) tuangle (in radians) radius v*The angle relative to the positive X axis wxARotation matrix by a given angle (in radians), counterclockwise. yz{(Rotates counterclockwise by 90 degrees. |!Rotates clockwise by 90 degrees. lmnopqrstuvwxyz{|lmnopqrstuvwxyz{|lmnopqrstuvwxyz{|} Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]. ~The opposite of  structVec3. angle (in radians) axis (should be a unit vector!) vector result angle (in radians)  axis (arbitrary nonzero vector) vector result 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. }~}~}~ Spherical linear interpolation.  See  "http://en.wikipedia.org/wiki/Slerp  produces orthogonal/.orthonormal vectors from a set of vectors  does not normalize the vectors! normalizes the vectors. 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. 1An abbreviated type synonym for unit quaternions ,An abbreviated type synonym for quaternions  The type for unit quaternions. The type for quaternions. The inverse quaternion :The opposite quaternion (which encodes the same rotation) ,This is no-op, up to numerical imprecision. H However, if you multiply together a large number of unit quaternions, 4 it may be a good idea to normalize the end result. !The inverse of a unit quaternion The left+ action of unit quaternions on 3D vectors.  That is, 2 actU q1 $ actU q2 v == actU (q1 `multU` q2) v >The quaternion to encode rotation around an axis. Please note  that quaternions act on the left , that is ^ rotU axis1 angl1 *. rotU axis2 angl2 *. v == (rotU axis1 angl1 .*. rotU axis2 angl2) *. v HInterpolation of unit quaternions. Note that when applied to rotations, L this may be not what you want, since it is possible that the shortest path K in the space of unit quaternions is not the shortest path in the space of  rotations; see ! GThis is shortest path interpolation in the space of rotations; however J this is achieved by possibly flipping the first endpoint in the space of  quaternions. Thus slerpU 0.001 q1 q2 may be very far from q1 (and very  close to negU q17) in the space of quaternions (but they are very close  in the space of rotations). 6Makes a rotation matrix (to be multiplied with on the right) out of a unit quaternion:  B v .* rightOrthoU (rotU axis angl) == v .* rotMatrix3 axis angl 1Please note that while these matrices act on the right, quaternions act on the left; thus @ rightOrthoU q1 .*. rightOrthoU q2 == rightOrthoU (q2 .*. q1) 6Makes a rotation matrix (to be multiplied with on the left) out of a unit quaternion. A leftOrthoU (rotU axis angl) *. v == v .* rotMatrix3 axis angl   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`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?) ?the frobenius norm (= euclidean norm in the space of matrices) ,euclidean distance in the space of matrices 0(euclidean) operator norm (not implemented yet) &makes a diagonal matrix from a vector Bconversion between vectors (and matrices) of different dimensions  example: $extendZero (Vec2 5 6) = Vec4 5 6 0 0  example: &extendWith 1 (Vec2 5 6) = Vec4 5 6 1 1  example: trim (Vec4 5 6 7 8) = Vec2 5 6    Pointwise multiplication   Cross product normalizes the input does not normalize the input!  !"#$%&'()*+,-./012345the angle between two vectors 6#the angle between two unit vectors 7XProjects the first vector down to the hyperplane orthogonal to the second (unit) vector 8/Direction (second argument) is assumed to be a unit vector! 9: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      !"#$%&'()*+,-./0123456789:;<=>?l,-./01)*+(2%&'"#$ !3456     =>?978:;<l          ! !"#$#$%&'&'()*+*+,-./0-./0123456789:;<=>? @ Example: structVec2 [1,2,3,4] = [ Vec2 1 2 , Vec2 3 4 ]. AThe opposite of  structVec2. BCDEFGhunit 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 :) HIangle (in radians) radius J*The angle relative to the positive X axis KLARotation matrix by a given angle (in radians), counterclockwise. MNO(Rotates counterclockwise by 90 degrees. P!Rotates clockwise by 90 degrees. @ABCDEFGHIJKLMNOP@ABCDEFGHIJKLMNOP@ABCDEFGHIJKLMNOP Q Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]. RThe opposite of  structVec3. STUVWXYZ[\]angle (in radians) axis (should be a unit vector!) vector result ^angle (in radians)  axis (arbitrary nonzero vector) vector result _gRotation around an arbitrary 3D vector. The resulting 3x3 matrix is intended for multiplication on the right. `a Rotation around an arbitrary 3D unitH vector. The resulting 3x3 matrix is intended for multiplication on the right. bc5Reflects a vector to an axis: that is, the result of  reflect n v is  2<n,v>n - v def 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) g6When total internal reflection would occur, we return Nothing. QRSTUVWXYZ[\]^_`abcdefgQRSTUVWXYZ[\]^_`abcdefgQRSTUVWXYZ[\]^_`abcdefg hij Spherical linear interpolation.  See  "http://en.wikipedia.org/wiki/Slerp hijhijhiij kproduces orthogonal/.orthonormal vectors from a set of vectors l does not normalize the vectors! mnormalizes the vectors. klmklmklmlmnopqrstuvwxIf  (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 ] y'the corresponding antisymmetric tensor z+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. nopqrstuvwxyz{|}nopqrstuvwxyz{|}nopqrstuvwxyz{|} ~ 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. ~ ~ ~1An abbreviated type synonym for unit quaternions ,An abbreviated type synonym for quaternions  The type for unit quaternions. The type for quaternions. The inverse quaternion :The opposite quaternion (which encodes the same rotation) ,This is no-op, up to numerical imprecision. H However, if you multiply together a large number of unit quaternions, 4 it may be a good idea to normalize the end result. !The inverse of a unit quaternion The left+ action of unit quaternions on 3D vectors.  That is, 2 actU q1 $ actU q2 v == actU (q1 `multU` q2) v >The quaternion to encode rotation around an axis. Please note  that quaternions act on the left , that is ^ rotU axis1 angl1 *. rotU axis2 angl2 *. v == (rotU axis1 angl1 .*. rotU axis2 angl2) *. v HInterpolation of unit quaternions. Note that when applied to rotations, L this may be not what you want, since it is possible that the shortest path K in the space of unit quaternions is not the shortest path in the space of  rotations; see ! GThis is shortest path interpolation in the space of rotations; however J this is achieved by possibly flipping the first endpoint in the space of  quaternions. Thus slerpU 0.001 q1 q2 may be very far from q1 (and very  close to negU q17) in the space of quaternions (but they are very close  in the space of rotations). 6Makes a rotation matrix (to be multiplied with on the right) out of a unit quaternion:  B v .* rightOrthoU (rotU axis angl) == v .* rotMatrix3 axis angl 1Please note that while these matrices act on the right, quaternions act on the left; thus @ rightOrthoU q1 .*. rightOrthoU q2 == rightOrthoU (q2 .*. q1) 6Makes a rotation matrix (to be multiplied with on the left) out of a unit quaternion. A leftOrthoU (rotU axis angl) *. v == v .* rotMatrix3 axis angl       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij~  !!""##$%&'()*+,-./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 [ \ ] ^ _ ` 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 { | } ~             vect-0.4.7Data.Vect.Double.BaseData.Vect.Double.Util.Dim2Data.Vect.Double.Util.Dim3Data.Vect.Double.InterpolateData.Vect.Double.GramSchmidtData.Vect.Double.Util.Dim4 Data.Vect.Double.Util.Projective Data.Vect.Double.Util.QuaternionData.Vect.Float.BaseData.Vect.Float.Util.Dim2Data.Vect.Float.Util.Dim3Data.Vect.Float.InterpolateData.Vect.Float.GramSchmidtData.Vect.Float.Util.Dim4Data.Vect.Float.Util.ProjectiveData.Vect.Float.Util.QuaternionData.Vect.Double.InstancesData.Vect.DoubleData.Vect.Float.InstancesData.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 structVec2 destructVec2det2vec2Xvec2Y translate2X translate2YsinCossinCos' sinCosRadiusangle2angle2' rotMatrix2rotMatrixOrtho2rotate2 rotateCCWrotateCW structVec3 destructVec3det3 translate3X translate3Y translate3Zvec3Xvec3Yvec3Z rotMatrixZ rotMatrixY rotMatrixXrotate3'rotate3 rotMatrix3rotMatrixOrtho3 rotMatrix3'rotMatrixOrtho3'reflectreflect'refractrefract' refractOnly' Interpolate interpolateslerp GramSchmidt gramSchmidtgramSchmidtNormalize structVec4 destructVec4 translate4X translate4Y translate4Z translate4Wvec4Xvec4Yvec4Zvec4W biVector4biVector4AsTensorrotate4'rotate4 rotMatrix4' rotMatrix4rotMatrixProj4'rotMatrixProj4 rotateProj4rotateAfterProj4rotateBeforeProj4scalingUniformProj4scaleBeforeProj4scaleAfterProj4 translate4translateAfter4translateBefore4UQUnitQuaternion QuaternionunitQzeroQmultQnegQ normalizeQinvQfromQtoQunitUmultUnegU normalizeUinvUfromUfromU'mkUtoU unsafeToUactUrotUrotU' longSlerpUslerpU rightOrthoU leftOrthoU_rndUnit _rndOrtho2 _rndOrtho3 _rndOrtho4 _flip1stRow2 _flip1stRow3 _flip1stRow4 _invertProj3 _invertProj4liftPair liftTriple liftQuadruplegramSchmidtPairgramSchmidtNormalizePairgramSchmidtTriplegramSchmidtNormalizeTriplegramSchmidtQuadruplegramSchmidtNormalizeQuadruple