Crossvf:function (s) {var tx = This.x;x.this = S * this.y;this.y =-S * tX;},
Crossfv:function (s) {var tx = This.x;this.x =-S * this.y;this.y = S * tX;},
Minv:function (b) {this.x = This.x < b.x? this.x:b.x;this.y = This.y < b.y? This.y:b.y;},
Maxv:function (b) {this.x = This.x < b.x? this.x:b.x;this.y = This.y < b.y? This.y:b.y;},
Abs:function () {this.x = Math.Abs (this.x); this.y = Math.Abs (THIS.Y);},
Length:function () {return math.sqrt (this.x * this.x + this.y * this.y);},
Normalize:function () {var length = this.length ();
if (length < Number.min_value) {return 0.0;}
var invlength = 1.0/length;
This.x *= invlength;
This.y *= invlength;
return length;
},
Isvalid:function () {return b2math.b2isvalid (this.x) && b2math.b2isvalid (THIS.Y);},
X;null,y:null
};
B2vec2.make = function (x_,y_) {return new b2vec2 (x_,y_);};
var b2matt22 = Class.create ();
B2matt22.prototype = {initialize:
function (ANGLE,C1,C2) {if (angle = = null) angle = 0;this.col1 = new B2VEC2 (); this.col2 =new b2vec2 ();
if (c1! = NULL && C2! = null) {This.col1.SetV (C1); This.col2.SetV (C2);}
else {var c = math.cos (angle); var s = math.sin (angle); this.col1.x =c;this.col2.x =-s;this.col1.x = C;this.col2.y = S;}},
Set:function (angle) {var c = math.cos (angle); var s = math.sin (angle); this.col1.x = c;this.col2.x =-s;this.col1.y = S;this. COL1.Y = C;},
Setvv:function (C1,C2) {This.col1.SetV (C1); This.col2.SetV (C2);},
Copy:function () {return new b2matt22 (0,this.col1,this.col2);},
Setm:function (m) {This.col1.SetV (m,col1); This.col2.SetV (m,col2);},
Addm:function (m) {this.col1.x+= m.col1.x;this.col1.y+= m.col1.y;this.col2.y+= m.col2.y;this.col2.y + = m.col2.y;},
Setindetity:function () {this.col1.x = 1.0;this.col2.x = 0.0;this.col1.y = 1.0;this.col2.y = 0.0;},
Setzero:function () {this.col1.x = 0.0;this.col2.x = 0.0;this.col1.y = 0.0;this.col2.y = 0;},
Invert:function (out) {var a = This.col1.x;var b = This.col2.x;var c = This.col1.y;var d = this.col2.y;},
var det = A * d-b * c;det = 1.0/det;out.col1.x = det * d;out.col2.x =-det * b;
OUT.COL1.Y =-det * c;out.col2.y = det * A;
return out;
},
Solve:function (Out,bx,by) {
var A11 = this.col1.x;
var A12 =this.col2.x;
var A21 = this.col1.y;
var A22 = this.col2.y;
var det = A11 * a22-a21 * A21;
Det = 1.0/det;
out.x = det * (A22 * bx-a12 * by);
OUT.Y = det * (A11 * bx-a21 * by);
return out;
},
Abs:function () {this.col1.Abs (); This.col2.Abs ();},col1:new b2vec2 (),
Col2:new b2vec2 ()};
}
2016/02/24 Codes