DIRECTORY SV2d, SVVector2d; SVMatrix2d: CEDAR DEFINITIONS = BEGIN Matrix3by3: TYPE = SV2d.Matrix3by3; Point2d: TYPE = SV2d.Point2d; Vector2d: TYPE = SVVector2d.Vector2d; Identity: PROC [] RETURNS [identityMat: Matrix3by3]; Update: PROC [mat: Matrix3by3, point: Point2d] RETURNS [newPoint: Point2d]; UpdateVector: PROC [mat: Matrix3by3, vec: Vector2d] RETURNS [newVec: Vector2d]; Scale: PROC [mat: Matrix3by3, sx, sy: REAL] RETURNS [transMat: Matrix3by3]; Translate: PROC [mat: Matrix3by3, dx, dy: REAL] RETURNS [transMat: Matrix3by3]; RotateCCW: PROC [mat: Matrix3by3, degrees: REAL] RETURNS [transMat: Matrix3by3]; LocalScale: PROC [mat: Matrix3by3, sx, sy: REAL] RETURNS [transMat: Matrix3by3]; LocalTranslate: PROC [mat: Matrix3by3, dx, dy: REAL] RETURNS [transMat: Matrix3by3]; LocalRotateCCW: PROC [mat: Matrix3by3, degrees: REAL] RETURNS [transMat: Matrix3by3]; MatMult: PROC [left, right: Matrix3by3] RETURNS [transMat: Matrix3by3]; MakeScaleMat: PROC [sx, sy: REAL] RETURNS [scale: Matrix3by3]; MakeTranslateMat: PROC [dx, dy: REAL] RETURNS [trans: Matrix3by3]; MakeRotateCCWMat: PROC [degrees: REAL] RETURNS [rot: Matrix3by3]; MakeMatFromXAxis: PROC [xAxis: Vector2d, origin: Point2d] RETURNS [mat: Matrix3by3]; MakeMatFromYAxis: PROC [yAxis: Vector2d, origin: Point2d] RETURNS [mat: Matrix3by3]; MakeMatFromAxes: PROC [xAxis, yAxis: Vector2d, origin: Point2d] RETURNS [mat: Matrix3by3]; ScaleFromMatrix: PROC [mat: Matrix3by3] RETURNS [sx, sy: REAL]; OriginOfMatrix: PROC [mat: Matrix3by3] RETURNS [origin: Point2d]; XAxisOfMatrix: PROC [mat: Matrix3by3] RETURNS [xAxis: Vector2d]; YAxisOfMatrix: PROC [mat: Matrix3by3] RETURNS [yAxis: Vector2d]; RotationOfMatrix: PROC [mat: Matrix3by3] RETURNS [degrees: REAL]; Cofactor: PROC [mat: Matrix3by3, row, col: NAT] RETURNS [cof: REAL]; Determinant: PROC [mat: Matrix3by3] RETURNS [det: REAL]; Transpose: PROC [mat: Matrix3by3] RETURNS [MatT: Matrix3by3]; Inverse: PROC [mat: Matrix3by3] RETURNS [inverse: Matrix3by3]; DegenerateInverse: SIGNAL; WorldToLocal: PROC [AinWorld,BinWorld: Matrix3by3] RETURNS [BinTermsOfA: Matrix3by3]; END. DFile: SVMatrix2d.mesa Last edited by Bier on June 1, 1984 4:38:07 pm PDT Author: Eric Bier on January 28, 1987 12:34:52 pm PST Contents: My own package for manipulating Homogenous 3 x 3 matrices. Parallels SVMatrix3d in many places vectors can be rotated and scaled, but not translated The next three procedures perform an efficient matrix multiplication as though mat were being multiplied to its left (a transform in reference coordinates) by a matrix which translates or rotates respectively (See Paul). The next three procedures perform an efficient matrix multiplication as though mat were being multiplied on its right (a transform in local coordinates) by a matrix which translates or rotates respectively (See Paul). MatMult is almost a general 3 by 3 matrix operation. However, it assumes that the last row of each matrix is [0 0 1]. not yet implemented not yet implemented uses the axes directly. Doesn't even check to see if they are orthogonal finds out how much this matrix will scale an object it is applied to inverts any matrix of the given form (even with scaling) Κ˜Iheadšœ™Jšœ2™2Jšœ5™5Jšœi™iJ˜šΟk ˜ Jšœ˜Jšœ ˜ —J˜Jšœ œ˜Jš˜˜Jšœ œœ ˜#Jšœ œ˜Jšœ œ˜%J˜—JšΟnœœœ˜4J˜Jšžœœ#œ˜Kšž œœ"œ˜OJšœ5™5—˜Jšœά™ά—Jšžœœœœ˜KJšž œœœœ˜OJšž œœœœ˜P˜JšœΩ™Ω—Jšž œœœœ˜PJšžœœœœ˜TJšžœœœœ˜UJ˜J˜šžœœœ˜GIprocšœv™v—L˜Lšž œœ œœ˜>Lšžœœ œœ˜BLšžœœ œœ˜AL˜šžœœ$œ˜TLšœ™—šžœœ$œ˜TLšœ™—šžœœ+œ˜ZLšœI™I—L˜šžœœœ œ˜?LšœD™D—Lšžœœœ˜ALšž œœœ˜@Lšž œœœ˜@Lšžœœœ œ˜AL˜Lš žœœœœœ˜DLšž œœœœ˜8Lšž œœœ˜=šžœœœ˜>Lšœ8™8—Lšœœ˜L˜šž œœ!œ˜UL˜—L˜Lšœ˜L˜L˜—…—@œ