Difference between revisions of "Proposals/Matrix"

From SVG
Jump to: navigation, search
Line 48: Line 48:
 
         [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 angle, 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);
Line 69: Line 69:
 
         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 rotateBy(double angleZ, optional double x, optional double y, optional double z);
+
         void rotateBy(double angle, optional double x, optional double y, optional double z);
 
         void rotateFromVectorBy(double x, 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);

Revision as of 03:58, 8 February 2013

   dictionary Point {
       double x;
       double y;
       double z;
       double w;
   }
   
   dictionary DecomposedMatrix {
       ...
   }
   
   [
       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 angle, 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 rotateBy(double angle, 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();
   
       // helper functions
       boolean is2D();
       Point transform(Point p);
   
       // conversion functions
       void copyIntoFloat32Array(inout Float32Array array);
       Float32Array toFloat32Array();
       DecomposedMatrix decompose();
   
       DOMString toString();
   };