Difference between revisions of "Proposals/Matrix"

From SVG
Jump to: navigation, search
Line 34: Line 34:
 
      
 
      
 
         // immutable transform functions
 
         // immutable transform functions
         [Immutable] Matrix translate(double x, double y, double z);
+
         [Immutable] Matrix translate(double x, double y, optional double z);
 
         [Immutable] Matrix scale(double scaleX, optional double x, optional double y, optional 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 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 rotate(double angleZ, optional double x, optional double y, optional double z);
         [Immutable] Matrix rotateFromVector(double x, 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 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 skewZ(double sz);
        [Immutable] Matrix skew(double sx, double sy);
+
 
      
 
      
 
         // immutable basic functions
 
         // immutable basic functions
Line 51: Line 50:
 
         [Immutable] Matrix flipZ();
 
         [Immutable] Matrix flipZ();
 
         [Immutable] Matrix inverse();
 
         [Immutable] Matrix inverse();
         [Immutable] Matrix determinant();
+
         double determinant();
 
      
 
      
 
         // mutable transform functions
 
         // mutable transform functions
Line 59: Line 58:
 
         void scaleBy(double scale, optional double x, optional double y, optional double z);
 
         void scaleBy(double scale, optional double x, optional double y, optional double z);
 
         void scaleNonUniformBy(double scaleX, double scaleY, optional double scaleZ, optional double x, optional double y, optional double z);
 
         void scaleNonUniformBy(double scaleX, double scaleY, optional double scaleZ, optional double x, optional double y, optional double z);
 +
        void scaleNonUniform(double scaleX, optional double scaleY, optional double scaleZ, optional double x, optional double y, optional, z);
 +
        void rotateBy(double angleZ, optional double x, optional double y, optional double z);
 +
        void rotateFromVectorBy(double x, double y, optional double z);
 
         void rotateAxisAngleBy(double x, double y, double z, double angle);
 
         void rotateAxisAngleBy(double x, double y, double z, double angle);
 
         void skewXBy(double sx);
 
         void skewXBy(double sx);

Revision as of 02:42, 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, optional 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 skewZ(double sz);
   
       // immutable basic functions
       [Immutable] Matrix multiply(Matrix otherMatrix);
       [Immutable] Matrix flipX();
       [Immutable] Matrix flipY();
       [Immutable] Matrix flipZ();
       [Immutable] Matrix inverse();
       double determinant();
   
       // mutable transform functions
       void multiplyBy(Matrix otherMatrix);
       void leftMultiplyBy(Matrix otherMatrix);
       void translateBy(double x, double y, double z);
       void scaleBy(double scale, optional double x, optional double y, optional double z);
       void scaleNonUniformBy(double scaleX, double scaleY, optional double scaleZ, optional double x, optional double y, optional double z);
       void scaleNonUniform(double scaleX, optional double scaleY, optional double scaleZ, optional double x, optional double y, optional, z);
       void rotateBy(double angleZ, optional double x, optional double y, optional double z);
       void rotateFromVectorBy(double x, double y, optional double z);
       void rotateAxisAngleBy(double x, double y, double z, double angle);
       void skewXBy(double sx);
       void skewYBy(double sy);
       void skewZBy(double sz);
       void invert();
   
       // information functions
       boolean is2D();
   
       // conversion functions
       void copyIntoFloat32Array(inout Float32Array array);
       Float32Array toFloat32Array();
   
       DOMString toString();
   };