Difference between revisions of "Proposals/Matrix"

From SVG
Jump to: navigation, search
Line 35: Line 35:
 
         // immutable transform functions
 
         // immutable transform functions
 
         [Immutable] Matrix translate(double x, double y, double z);
 
         [Immutable] Matrix translate(double x, double y, double z);
         [Immutable] Matrix scale(double scaleX, double scaleY, double scaleZ);
+
         [Immutable] Matrix scale(double scaleX, optional double x, optional double y, optional double z);
         [Immutable] Matrix scaleNonUniform(double scaleX, double scaleY, double scaleZ);
+
         [Immutable] Matrix scaleNonUniform(double scaleX, optional double scaleY, optional double scaleZ, optional double x, optional double y, optional, z);
        [Immutable] Matrix rotate(double angleZ);
+
         [Immutable] Matrix rotate(double angleZ, optional double x, optional double y, optional double z);
         [Immutable] Matrix rotate(double angleZ);
+
         [Immutable] Matrix rotateFromVector(double x, double y, optional double z)
         [Immutable] Matrix rotateFromVector(double x, double y)
+
 
         [Immutable] Matrix rotateAxisAngle(double x, double y, double z, double angle);
 
         [Immutable] Matrix rotateAxisAngle(double x, double y, double z, double angle);
 
         [Immutable] Matrix skewX(double sx);
 
         [Immutable] Matrix skewX(double sx);
 
         [Immutable] Matrix skewY(double sy);
 
         [Immutable] Matrix skewY(double sy);
 +
        [Immutable] Matrix skewY(double sz);
 
         [Immutable] Matrix skew(double sx, double sy);
 
         [Immutable] Matrix skew(double sx, double sy);
 
      
 
      

Revision as of 02:38, 8 February 2013

   [
       Constructor(),
       Constructor(DOMString string),
       Constructor(Float32array array),
       Constructor(Matrix matrix),
       Constructor(sequence<float> array)
   ]
   interface Matrix {
   
       // These attributes are simple aliases for certaelements of the  matrix
       attribute double a; // alias for m11
       attribute double b; // alias for m12
       attribute double c; // alias for m21
       attribute double d; // alias for m22
       attribute double e; // alias for m41
       attribute double f; // alias for m42
   
       attribute double m11;
       attribute double m12;
       attribute double m13;
       attribute double m14;
       attribute double m21;
       attribute double m22;
       attribute double m23;
       attribute double m24;
       attribute double m31;
       attribute double m32;
       attribute double m33;
       attribute double m34;
       attribute double m41;
       attribute double m42;
       attribute double m43;
       attribute double m44;
   
       // immutable transform functions
       [Immutable] Matrix translate(double x, double y, double z);
       [Immutable] Matrix scale(double scaleX, optional double x, optional double y, optional double z);
       [Immutable] Matrix scaleNonUniform(double scaleX, optional double scaleY, optional double scaleZ, optional double x, optional double y, optional, z);
       [Immutable] Matrix rotate(double angleZ, optional double x, optional double y, optional double z);
       [Immutable] Matrix rotateFromVector(double x, double y, optional double z)
       [Immutable] Matrix rotateAxisAngle(double x, double y, double z, double angle);
       [Immutable] Matrix skewX(double sx);
       [Immutable] Matrix skewY(double sy);
       [Immutable] Matrix skewY(double sz);
       [Immutable] Matrix skew(double sx, double sy);
   
       // immutable basic functions
       [Immutable] Matrix multiply(Matrix otherMatrix);
       [Immutable] Matrix flipX();
       [Immutable] Matrix flipY();
       [Immutable] Matrix flipZ();
       [Immutable] Matrix inverse();
       [Immutable] Matrix determinant();
   
       // mutable transform functions
       void multiplyBy(Matrix otherMatrix);
       void leftMultiplyBy(Matrix otherMatrix);
       void translateBy(double x, double y, double z);
       void scaleBy(double scaleX, double scaleY, double scaleZ);
       void rotateBy(double rotX, double rotY, double rotZ);
       void rotateAxisAngleBy(double x, double y, double z, double angle);
       void invert();
   
       // information functions
       boolean is2dMatrix();
   
       // conversion functions
       void copyIntoFloat32Array(inout Float32Array array);
       Float32Array toFloat32Array();
   
       DOMString toString();
   };