Best JavaScript code snippet using wpt
M4.js
Source:M4.js
1Clazz.declarePackage ("JU");2Clazz.load (["JU.M34"], "JU.M4", ["JU.T3"], function () {3c$ = Clazz.decorateAsClass (function () {4this.m03 = 0;5this.m13 = 0;6this.m23 = 0;7this.m30 = 0;8this.m31 = 0;9this.m32 = 0;10this.m33 = 0;11Clazz.instantialize (this, arguments);12}, JU, "M4", JU.M34);13c$.newA16 = Clazz.defineMethod (c$, "newA16", 14function (v) {15var m = new JU.M4 ();16m.m00 = v[0];17m.m01 = v[1];18m.m02 = v[2];19m.m03 = v[3];20m.m10 = v[4];21m.m11 = v[5];22m.m12 = v[6];23m.m13 = v[7];24m.m20 = v[8];25m.m21 = v[9];26m.m22 = v[10];27m.m23 = v[11];28m.m30 = v[12];29m.m31 = v[13];30m.m32 = v[14];31m.m33 = v[15];32return m;33}, "~A");34c$.newM4 = Clazz.defineMethod (c$, "newM4", 35function (m1) {36var m = new JU.M4 ();37if (m1 == null) {38m.setIdentity ();39return m;40}m.setToM3 (m1);41m.m03 = m1.m03;42m.m13 = m1.m13;43m.m23 = m1.m23;44m.m30 = m1.m30;45m.m31 = m1.m31;46m.m32 = m1.m32;47m.m33 = m1.m33;48return m;49}, "JU.M4");50c$.newMV = Clazz.defineMethod (c$, "newMV", 51function (m1, t) {52var m = new JU.M4 ();53m.setMV (m1, t);54return m;55}, "JU.M3,JU.T3");56Clazz.defineMethod (c$, "setZero", 57function () {58this.clear33 ();59this.m03 = this.m13 = this.m23 = this.m30 = this.m31 = this.m32 = this.m33 = 0.0;60});61Clazz.defineMethod (c$, "setIdentity", 62function () {63this.setZero ();64this.m00 = this.m11 = this.m22 = this.m33 = 1.0;65});66Clazz.defineMethod (c$, "setM4", 67function (m1) {68this.setM33 (m1);69this.m03 = m1.m03;70this.m13 = m1.m13;71this.m23 = m1.m23;72this.m30 = m1.m30;73this.m31 = m1.m31;74this.m32 = m1.m32;75this.m33 = m1.m33;76return this;77}, "JU.M4");78Clazz.defineMethod (c$, "setMV", 79function (m1, t) {80this.setM33 (m1);81this.setTranslation (t);82this.m33 = 1;83}, "JU.M3,JU.T3");84Clazz.defineMethod (c$, "setToM3", 85function (m1) {86this.setM33 (m1);87this.m03 = this.m13 = this.m23 = this.m30 = this.m31 = this.m32 = 0.0;88this.m33 = 1.0;89}, "JU.M34");90Clazz.defineMethod (c$, "setToAA", 91function (a) {92this.setIdentity ();93this.setAA33 (a);94}, "JU.A4");95Clazz.defineMethod (c$, "setA", 96function (m) {97this.m00 = m[0];98this.m01 = m[1];99this.m02 = m[2];100this.m03 = m[3];101this.m10 = m[4];102this.m11 = m[5];103this.m12 = m[6];104this.m13 = m[7];105this.m20 = m[8];106this.m21 = m[9];107this.m22 = m[10];108this.m23 = m[11];109this.m30 = m[12];110this.m31 = m[13];111this.m32 = m[14];112this.m33 = m[15];113}, "~A");114Clazz.defineMethod (c$, "setTranslation", 115function (trans) {116this.m03 = trans.x;117this.m13 = trans.y;118this.m23 = trans.z;119}, "JU.T3");120Clazz.defineMethod (c$, "setElement", 121function (row, col, v) {122if (row < 3 && col < 3) {123this.set33 (row, col, v);124return;125}if (row > 3 || col > 3) this.err ();126switch (row) {127case 0:128this.m03 = v;129return;130case 1:131this.m13 = v;132return;133case 2:134this.m23 = v;135return;136}137switch (col) {138case 0:139this.m30 = v;140return;141case 1:142this.m31 = v;143return;144case 2:145this.m32 = v;146return;147case 3:148this.m33 = v;149return;150}151}, "~N,~N,~N");152Clazz.defineMethod (c$, "getElement", 153function (row, col) {154if (row < 3 && col < 3) return this.get33 (row, col);155if (row > 3 || col > 3) {156this.err ();157return 0;158}switch (row) {159case 0:160return this.m03;161case 1:162return this.m13;163case 2:164return this.m23;165default:166switch (col) {167case 0:168return this.m30;169case 1:170return this.m31;171case 2:172return this.m32;173default:174return this.m33;175}176}177}, "~N,~N");178Clazz.defineMethod (c$, "getTranslation", 179function (trans) {180trans.x = this.m03;181trans.y = this.m13;182trans.z = this.m23;183}, "JU.T3");184Clazz.defineMethod (c$, "getRotationScale", 185function (m1) {186m1.m00 = this.m00;187m1.m01 = this.m01;188m1.m02 = this.m02;189m1.m10 = this.m10;190m1.m11 = this.m11;191m1.m12 = this.m12;192m1.m20 = this.m20;193m1.m21 = this.m21;194m1.m22 = this.m22;195}, "JU.M3");196Clazz.defineMethod (c$, "setRotationScale", 197function (m1) {198this.m00 = m1.m00;199this.m01 = m1.m01;200this.m02 = m1.m02;201this.m10 = m1.m10;202this.m11 = m1.m11;203this.m12 = m1.m12;204this.m20 = m1.m20;205this.m21 = m1.m21;206this.m22 = m1.m22;207}, "JU.M3");208Clazz.defineMethod (c$, "setRowA", 209function (row, v) {210if (row < 3) this.setRow33 (row, v);211switch (row) {212case 0:213this.m03 = v[3];214return;215case 1:216this.m13 = v[3];217return;218case 2:219this.m23 = v[3];220return;221case 3:222this.m30 = v[0];223this.m31 = v[1];224this.m32 = v[2];225this.m33 = v[3];226return;227}228this.err ();229}, "~N,~A");230Clazz.overrideMethod (c$, "getRow", 231function (row, v) {232if (row < 3) this.getRow33 (row, v);233switch (row) {234case 0:235v[3] = this.m03;236return;237case 1:238v[3] = this.m13;239return;240case 2:241v[3] = this.m23;242return;243case 3:244v[0] = this.m30;245v[1] = this.m31;246v[2] = this.m32;247v[3] = this.m33;248return;249}250this.err ();251}, "~N,~A");252Clazz.defineMethod (c$, "setColumn4", 253function (column, x, y, z, w) {254if (column == 0) {255this.m00 = x;256this.m10 = y;257this.m20 = z;258this.m30 = w;259} else if (column == 1) {260this.m01 = x;261this.m11 = y;262this.m21 = z;263this.m31 = w;264} else if (column == 2) {265this.m02 = x;266this.m12 = y;267this.m22 = z;268this.m32 = w;269} else if (column == 3) {270this.m03 = x;271this.m13 = y;272this.m23 = z;273this.m33 = w;274} else {275this.err ();276}}, "~N,~N,~N,~N,~N");277Clazz.defineMethod (c$, "setColumnA", 278function (column, v) {279if (column < 3) this.setColumn33 (column, v);280switch (column) {281case 0:282this.m30 = v[3];283return;284case 1:285this.m31 = v[3];286return;287case 2:288this.m32 = v[3];289return;290case 3:291this.m03 = v[0];292this.m13 = v[1];293this.m23 = v[2];294this.m33 = v[3];295return;296default:297this.err ();298}299}, "~N,~A");300Clazz.defineMethod (c$, "getColumn", 301function (column, v) {302if (column < 3) this.getColumn33 (column, v);303switch (column) {304case 0:305v[3] = this.m30;306return;307case 1:308v[3] = this.m31;309return;310case 2:311v[3] = this.m32;312return;313case 3:314v[0] = this.m03;315v[1] = this.m13;316v[2] = this.m23;317v[3] = this.m33;318return;319default:320this.err ();321}322}, "~N,~A");323Clazz.defineMethod (c$, "sub", 324function (m1) {325this.sub33 (m1);326this.m03 -= m1.m03;327this.m13 -= m1.m13;328this.m23 -= m1.m23;329this.m30 -= m1.m30;330this.m31 -= m1.m31;331this.m32 -= m1.m32;332this.m33 -= m1.m33;333}, "JU.M4");334Clazz.defineMethod (c$, "transpose", 335function () {336this.transpose33 ();337var tmp = this.m03;338this.m03 = this.m30;339this.m30 = tmp;340tmp = this.m13;341this.m13 = this.m31;342this.m31 = tmp;343tmp = this.m23;344this.m23 = this.m32;345this.m32 = tmp;346});347Clazz.defineMethod (c$, "invert", 348function () {349var s = this.determinant4 ();350if (s == 0.0) return this;351s = 1 / s;352this.set (this.m11 * (this.m22 * this.m33 - this.m23 * this.m32) + this.m12 * (this.m23 * this.m31 - this.m21 * this.m33) + this.m13 * (this.m21 * this.m32 - this.m22 * this.m31), this.m21 * (this.m02 * this.m33 - this.m03 * this.m32) + this.m22 * (this.m03 * this.m31 - this.m01 * this.m33) + this.m23 * (this.m01 * this.m32 - this.m02 * this.m31), this.m31 * (this.m02 * this.m13 - this.m03 * this.m12) + this.m32 * (this.m03 * this.m11 - this.m01 * this.m13) + this.m33 * (this.m01 * this.m12 - this.m02 * this.m11), this.m01 * (this.m13 * this.m22 - this.m12 * this.m23) + this.m02 * (this.m11 * this.m23 - this.m13 * this.m21) + this.m03 * (this.m12 * this.m21 - this.m11 * this.m22), this.m12 * (this.m20 * this.m33 - this.m23 * this.m30) + this.m13 * (this.m22 * this.m30 - this.m20 * this.m32) + this.m10 * (this.m23 * this.m32 - this.m22 * this.m33), this.m22 * (this.m00 * this.m33 - this.m03 * this.m30) + this.m23 * (this.m02 * this.m30 - this.m00 * this.m32) + this.m20 * (this.m03 * this.m32 - this.m02 * this.m33), this.m32 * (this.m00 * this.m13 - this.m03 * this.m10) + this.m33 * (this.m02 * this.m10 - this.m00 * this.m12) + this.m30 * (this.m03 * this.m12 - this.m02 * this.m13), this.m02 * (this.m13 * this.m20 - this.m10 * this.m23) + this.m03 * (this.m10 * this.m22 - this.m12 * this.m20) + this.m00 * (this.m12 * this.m23 - this.m13 * this.m22), this.m13 * (this.m20 * this.m31 - this.m21 * this.m30) + this.m10 * (this.m21 * this.m33 - this.m23 * this.m31) + this.m11 * (this.m23 * this.m30 - this.m20 * this.m33), this.m23 * (this.m00 * this.m31 - this.m01 * this.m30) + this.m20 * (this.m01 * this.m33 - this.m03 * this.m31) + this.m21 * (this.m03 * this.m30 - this.m00 * this.m33), this.m33 * (this.m00 * this.m11 - this.m01 * this.m10) + this.m30 * (this.m01 * this.m13 - this.m03 * this.m11) + this.m31 * (this.m03 * this.m10 - this.m00 * this.m13), this.m03 * (this.m11 * this.m20 - this.m10 * this.m21) + this.m00 * (this.m13 * this.m21 - this.m11 * this.m23) + this.m01 * (this.m10 * this.m23 - this.m13 * this.m20), this.m10 * (this.m22 * this.m31 - this.m21 * this.m32) + this.m11 * (this.m20 * this.m32 - this.m22 * this.m30) + this.m12 * (this.m21 * this.m30 - this.m20 * this.m31), this.m20 * (this.m02 * this.m31 - this.m01 * this.m32) + this.m21 * (this.m00 * this.m32 - this.m02 * this.m30) + this.m22 * (this.m01 * this.m30 - this.m00 * this.m31), this.m30 * (this.m02 * this.m11 - this.m01 * this.m12) + this.m31 * (this.m00 * this.m12 - this.m02 * this.m10) + this.m32 * (this.m01 * this.m10 - this.m00 * this.m11), this.m00 * (this.m11 * this.m22 - this.m12 * this.m21) + this.m01 * (this.m12 * this.m20 - this.m10 * this.m22) + this.m02 * (this.m10 * this.m21 - this.m11 * this.m20));353this.scale (s);354return this;355});356Clazz.defineMethod (c$, "set", 357 function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {358this.m00 = m00;359this.m01 = m01;360this.m02 = m02;361this.m03 = m03;362this.m10 = m10;363this.m11 = m11;364this.m12 = m12;365this.m13 = m13;366this.m20 = m20;367this.m21 = m21;368this.m22 = m22;369this.m23 = m23;370this.m30 = m30;371this.m31 = m31;372this.m32 = m32;373this.m33 = m33;374}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N");375Clazz.defineMethod (c$, "determinant4", 376function () {377return (this.m00 * this.m11 - this.m01 * this.m10) * (this.m22 * this.m33 - this.m23 * this.m32) - (this.m00 * this.m12 - this.m02 * this.m10) * (this.m21 * this.m33 - this.m23 * this.m31) + (this.m00 * this.m13 - this.m03 * this.m10) * (this.m21 * this.m32 - this.m22 * this.m31) + (this.m01 * this.m12 - this.m02 * this.m11) * (this.m20 * this.m33 - this.m23 * this.m30) - (this.m01 * this.m13 - this.m03 * this.m11) * (this.m20 * this.m32 - this.m22 * this.m30) + (this.m02 * this.m13 - this.m03 * this.m12) * (this.m20 * this.m31 - this.m21 * this.m30);378});379Clazz.defineMethod (c$, "scale", 380function (scalar) {381this.mul33 (scalar);382this.m03 *= scalar;383this.m13 *= scalar;384this.m23 *= scalar;385this.m30 *= scalar;386this.m31 *= scalar;387this.m32 *= scalar;388this.m33 *= scalar;389}, "~N");390Clazz.defineMethod (c$, "mul", 391function (m1) {392this.mul2 (this, m1);393}, "JU.M4");394Clazz.defineMethod (c$, "mul2", 395function (m1, m2) {396this.set (m1.m00 * m2.m00 + m1.m01 * m2.m10 + m1.m02 * m2.m20 + m1.m03 * m2.m30, m1.m00 * m2.m01 + m1.m01 * m2.m11 + m1.m02 * m2.m21 + m1.m03 * m2.m31, m1.m00 * m2.m02 + m1.m01 * m2.m12 + m1.m02 * m2.m22 + m1.m03 * m2.m32, m1.m00 * m2.m03 + m1.m01 * m2.m13 + m1.m02 * m2.m23 + m1.m03 * m2.m33, m1.m10 * m2.m00 + m1.m11 * m2.m10 + m1.m12 * m2.m20 + m1.m13 * m2.m30, m1.m10 * m2.m01 + m1.m11 * m2.m11 + m1.m12 * m2.m21 + m1.m13 * m2.m31, m1.m10 * m2.m02 + m1.m11 * m2.m12 + m1.m12 * m2.m22 + m1.m13 * m2.m32, m1.m10 * m2.m03 + m1.m11 * m2.m13 + m1.m12 * m2.m23 + m1.m13 * m2.m33, m1.m20 * m2.m00 + m1.m21 * m2.m10 + m1.m22 * m2.m20 + m1.m23 * m2.m30, m1.m20 * m2.m01 + m1.m21 * m2.m11 + m1.m22 * m2.m21 + m1.m23 * m2.m31, m1.m20 * m2.m02 + m1.m21 * m2.m12 + m1.m22 * m2.m22 + m1.m23 * m2.m32, m1.m20 * m2.m03 + m1.m21 * m2.m13 + m1.m22 * m2.m23 + m1.m23 * m2.m33, m1.m30 * m2.m00 + m1.m31 * m2.m10 + m1.m32 * m2.m20 + m1.m33 * m2.m30, m1.m30 * m2.m01 + m1.m31 * m2.m11 + m1.m32 * m2.m21 + m1.m33 * m2.m31, m1.m30 * m2.m02 + m1.m31 * m2.m12 + m1.m32 * m2.m22 + m1.m33 * m2.m32, m1.m30 * m2.m03 + m1.m31 * m2.m13 + m1.m32 * m2.m23 + m1.m33 * m2.m33);397}, "JU.M4,JU.M4");398Clazz.defineMethod (c$, "transform", 399function (vec) {400this.transform2 (vec, vec);401}, "JU.T4");402Clazz.defineMethod (c$, "transform2", 403function (vec, vecOut) {404vecOut.set4 (this.m00 * vec.x + this.m01 * vec.y + this.m02 * vec.z + this.m03 * vec.w, this.m10 * vec.x + this.m11 * vec.y + this.m12 * vec.z + this.m13 * vec.w, this.m20 * vec.x + this.m21 * vec.y + this.m22 * vec.z + this.m23 * vec.w, this.m30 * vec.x + this.m31 * vec.y + this.m32 * vec.z + this.m33 * vec.w);405}, "JU.T4,JU.T4");406Clazz.defineMethod (c$, "rotTrans", 407function (point) {408this.rotTrans2 (point, point);409}, "JU.T3");410Clazz.defineMethod (c$, "rotTrans2", 411function (point, pointOut) {412pointOut.set (this.m00 * point.x + this.m01 * point.y + this.m02 * point.z + this.m03, this.m10 * point.x + this.m11 * point.y + this.m12 * point.z + this.m13, this.m20 * point.x + this.m21 * point.y + this.m22 * point.z + this.m23);413return pointOut;414}, "JU.T3,JU.T3");415Clazz.defineMethod (c$, "setAsXYRotation", 416function (angle) {417this.setIdentity ();418var c = Math.cos (angle);419var s = Math.sin (angle);420this.m22 = c;421this.m23 = -s;422this.m32 = s;423this.m33 = c;424return this;425}, "~N");426Clazz.defineMethod (c$, "setAsYZRotation", 427function (angle) {428this.setIdentity ();429var c = Math.cos (angle);430var s = Math.sin (angle);431this.m00 = c;432this.m03 = -s;433this.m30 = s;434this.m33 = c;435return this;436}, "~N");437Clazz.defineMethod (c$, "setAsXZRotation", 438function (angle) {439this.setIdentity ();440var c = Math.cos (angle);441var s = Math.sin (angle);442this.m11 = c;443this.m13 = -s;444this.m31 = s;445this.m33 = c;446return this;447}, "~N");448Clazz.overrideMethod (c$, "equals", 449function (o) {450if (!(Clazz.instanceOf (o, JU.M4))) return false;451var m = o;452return (this.m00 == m.m00 && this.m01 == m.m01 && this.m02 == m.m02 && this.m03 == m.m03 && this.m10 == m.m10 && this.m11 == m.m11 && this.m12 == m.m12 && this.m13 == m.m13 && this.m20 == m.m20 && this.m21 == m.m21 && this.m22 == m.m22 && this.m23 == m.m23 && this.m30 == m.m30 && this.m31 == m.m31 && this.m32 == m.m32 && this.m33 == m.m33);453}, "~O");454Clazz.overrideMethod (c$, "hashCode", 455function () {456return JU.T3.floatToIntBits (this.m00) ^ JU.T3.floatToIntBits (this.m01) ^ JU.T3.floatToIntBits (this.m02) ^ JU.T3.floatToIntBits (this.m03) ^ JU.T3.floatToIntBits (this.m10) ^ JU.T3.floatToIntBits (this.m11) ^ JU.T3.floatToIntBits (this.m12) ^ JU.T3.floatToIntBits (this.m13) ^ JU.T3.floatToIntBits (this.m20) ^ JU.T3.floatToIntBits (this.m21) ^ JU.T3.floatToIntBits (this.m22) ^ JU.T3.floatToIntBits (this.m23) ^ JU.T3.floatToIntBits (this.m30) ^ JU.T3.floatToIntBits (this.m31) ^ JU.T3.floatToIntBits (this.m32) ^ JU.T3.floatToIntBits (this.m33);457});458Clazz.overrideMethod (c$, "toString", 459function () {460return "[\n [" + this.m00 + "\t" + this.m01 + "\t" + this.m02 + "\t" + this.m03 + "]" + "\n [" + this.m10 + "\t" + this.m11 + "\t" + this.m12 + "\t" + this.m13 + "]" + "\n [" + this.m20 + "\t" + this.m21 + "\t" + this.m22 + "\t" + this.m23 + "]" + "\n [" + this.m30 + "\t" + this.m31 + "\t" + this.m32 + "\t" + this.m33 + "] ]";461});462Clazz.defineMethod (c$, "round", 463function (f) {464this.m00 = this.rnd (this.m00, f);465this.m01 = this.rnd (this.m01, f);466this.m02 = this.rnd (this.m02, f);467this.m03 = this.rnd (this.m03, f);468this.m10 = this.rnd (this.m10, f);469this.m11 = this.rnd (this.m11, f);470this.m12 = this.rnd (this.m12, f);471this.m13 = this.rnd (this.m13, f);472this.m20 = this.rnd (this.m20, f);473this.m21 = this.rnd (this.m21, f);474this.m22 = this.rnd (this.m22, f);475this.m23 = this.rnd (this.m23, f);476this.m30 = this.rnd (this.m30, f);477this.m31 = this.rnd (this.m31, f);478this.m32 = this.rnd (this.m32, f);479this.m33 = this.rnd (this.m33, f);480return this;481}, "~N");482Clazz.defineMethod (c$, "rnd", 483 function (n, f) {484return (Math.abs (n) < f ? 0 : n);485}, "~N,~N");
...
project2.js
Source:project2.js
1// Returns a 3x3 transformation matrix as an array of 9 values in column-major order.2// The transformation first applies scale, then rotation, and finally translation.3// The given rotation value is in degrees.4function GetTransform( positionX, positionY, rotation, scale )5{ 67 // ç©éµä¹ç顺åºä¸ºï¼ T * R * S8 // T = [1, 0, positionX,9 // 0, 1, positionY,10 // 0, 0, 1]1112 // R = [ cos(rotation), -sin(rotation), 0,13 // sin(rotation), cos(rotation), 0,14 // 0, 0, 1]1516 // S = [scale, 0, 0,17 // 0, scale, 0,18 // 0, 0, 1] å 为è¿éåªæxï¼y两个维度ï¼ææzç缩æ¾ä¸º1ï¼å¦æä¹è®¾ä¸ºscaleåä¼åºç°åå·®1920 // æåç计ç®é¡ºåºä¸å®æ¯21 // T * R * S22 var angle = rotation * Math.PI / 180.023 var m11 = scale * Math.cos(angle);24 var m12 = - scale * Math.sin(angle);25 var m13 = positionX;26 // var m13 = scale * Math.cos(angle) * positionX - scale * Math.sin(angle) * positionY;2728 var m21 = scale * Math.sin(angle);29 var m22 = scale * Math.cos(angle);30 var m23 = positionY;31 // var m23 = scale * Math.sin(angle) * positionX + scale * Math.cos(angle) * positionY;32 33 var m31 = 0;34 var m32 = 0;35 var m33 = 1;3637 // return Array( m11, m12, m13, m21, m22, m23, m31, m32, m33);38 return Array( m11, m21, m31, m12, m22, m32, m13, m23, m33);39 // return Array( 1, 0, 0, 0, 1, 0, 0, 0, 1 );40}4142// Returns a 3x3 transformation matrix as an array of 9 values in column-major order.43// The arguments are transformation matrices in the same format.44// The returned transformation first applies trans1 and then trans2.45function ApplyTransform( trans1, trans2 )46{4748 var m11 = trans1[0];49 var m12 = trans1[3];50 var m13 = trans1[6];5152 var m21 = trans1[1];53 var m22 = trans1[4];54 var m23 = trans1[7];5556 var m31 = trans1[2];57 var m32 = trans1[5];58 var m33 = trans1[8];5960 var _m11 = trans2[0];61 var _m12 = trans2[3];62 var _m13 = trans2[6];6364 var _m21 = trans2[1];65 var _m22 = trans2[4];66 var _m23 = trans2[7];6768 var _m31 = trans2[2];69 var _m32 = trans2[5];70 var _m33 = trans2[8];7172 // var t_m11 = m11 * _m11 + m12 * _m21 + m13 * _m31;73 // var t_m12 = m11 * _m12 + m12 * _m22 + m13 * _m32;74 // var t_m13 = m11 * _m13 + m12 * _m23 + m13 * _m33;7576 // var t_m21 = m21 * _m11 + m22 * _m21 + m23 * _m31;77 // var t_m22 = m21 * _m12 + m22 * _m22 + m23 * _m32;78 // var t_m23 = m21 * _m13 + m22 * _m23 + m23 * _m33;7980 // var t_m31 = m31 * _m11 + m32 * _m21 + m33 * _m31;81 // var t_m32 = m31 * _m12 + m32 * _m22 + m33 * _m32;82 // var t_m33 = m31 * _m13 + m32 * _m23 + m33 * _m33;8384 var t_m11 = _m11 * m11 + _m12 * m21 + _m13 * m31;85 var t_m12 = _m11 * m12 + _m12 * m22 + _m13 * m32;86 var t_m13 = _m11 * m13 + _m12 * m23 + _m13 * m33;8788 var t_m21 = _m21 * m11 + _m22 * m21 + _m23 * m31;89 var t_m22 = _m21 * m12 + _m22 * m22 + _m23 * m32;90 var t_m23 = _m21 * m13 + _m22 * m23 + _m23 * m33;9192 var t_m31 = _m31 * m11 + _m32 * m21 + _m33 * m31;93 var t_m32 = _m31 * m12 + _m32 * m22 + _m33 * m32;94 var t_m33 = _m31 * m13 + _m32 * m23 + _m33 * m33;9596 return Array( t_m11, t_m21, t_m31, t_m12, t_m22, t_m32, t_m13, t_m23, t_m33 );97 // return Array( 1, 0, 0, 0, 1, 0, 0, 0, 1 );
...
Using AI Code Generation
1var wpt = require('wpt');2wpt.m23(function(err, result) {3 if (err) {4 console.log('Error: ' + err);5 } else {6 console.log('Result: ' + result);7 }8});9var wpt = require('wpt');10wpt.m23(function(err, result) {11 if (err) {12 console.log('Error: ' + err);13 } else {14 console.log('Result: ' + result);15 }16});17var wpt = require('wpt');18wpt.m23(function(err, result) {19 if (err) {20 console.log('Error: ' + err);21 } else {22 console.log('Result: ' + result);23 }24});25var wpt = require('wpt');26wpt.m23(function(err, result) {27 if (err) {28 console.log('Error: ' + err);29 } else {30 console.log('Result: ' + result);31 }32});33var wpt = require('wpt');34wpt.m23(function(err, result) {35 if (err) {36 console.log('Error: ' + err);37 } else {38 console.log('Result: ' + result);39 }40});41var wpt = require('wpt');42wpt.m23(function(err, result) {43 if (err) {44 console.log('Error: ' + err);45 } else {46 console.log('Result: ' + result);47 }48});49var wpt = require('wpt');50wpt.m23(function(err, result) {51 if (err) {52 console.log('Error: ' + err);53 } else {54 console.log('Result: ' + result);55 }56});57var wpt = require('w
Using AI Code Generation
1wpt.m23(1,2,3,4,5,6,7,8,9);2wpt.m23(1,2,3,4,5,6,7,8,9);3wpt.m23(1,2,3,4,5,6,7,8,9);4wpt.m23(1,2,3,4,5,6,7,8,9);5wpt.m23(1,2,3,4,5,6,7,8,9);6wpt.m23(1,2,3,4,5,6,7,8,9);7wpt.m23(1,2,3,4,5,6,7,8,9);8wpt.m23(1,2,3,4,5,6,7,8,9);9wpt.m23(1,2,3,4,5,6,7,8,9);10wpt.m23(1,2,3,4,5,6,7,8,9);11wpt.m23(1,2,3,4,5,6,7,8,9);12wpt.m23(1,2,3,4,5,6,7,8,9);13wpt.m23(
Using AI Code Generation
1var wpt = require('webpagetest')('www.webpagetest.org');2}, function(err, data) {3 if (err) {4 console.log('Error: ' + err);5 } else {6 console.log('Test status: ' + data.statusCode);7 console.log('Test status text: ' + data.statusText);8 console.log('Test ID: ' + data.data.testId);9 console.log('Test URL: ' + data.data.summary);10 console.log('Test results: ' + data.data.userUrl);11 }12});13var wpt = require('webpagetest')('www.webpagetest.org');14}, function(err, data) {15 if (err) {16 console.log('Error: ' + err);17 } else {18 console.log('Test status: ' + data.statusCode);19 console.log('Test status text: ' + data.statusText);20 console.log('Test ID: ' + data.data.testId);21 console.log('Test URL: ' + data.data.summary);22 console.log('Test results: ' + data.data.userUrl);23 }24});25var wpt = require('webpagetest')('www.webpagetest.org');26}, function
Using AI Code Generation
1var wpt = new WebPageTest('www.webpagetest.org');2 console.log(data);3});4var wpt = new WebPageTest('www.webpagetest.org');5 console.log(data);6});
Using AI Code Generation
1var wpt = require('wpt');2wpt.m23(function(err, data) {3 if (err) {4 console.log(err);5 } else {6 console.log(data);7 }8});9The module is also available on Github (
Using AI Code Generation
1var wpt = require('wpt');2wpt.m23(function(err, data) {3 console.log(data);4});5{"statusCode":200,"statusText":"OK","data":{"statusCode":200,"statusText":"Ok","data":{"m23":"Hello World"}}}6var wpt = require('wpt');7wpt.m23(function(err, data) {8 console.log(data);9 wpt.m22(function(err, data) {10 console.log(data);11 });12});13{"statusCode":200,"statusText":"OK","data":{"statusCode":200,"statusText":"Ok","data":{"m23":"Hello World"}}}14{"statusCode":200,"statusText":"OK","data":{"statusCode":200,"statusText":"Ok","data":{"m22":"Hello World"}}}15var wpt = require('wpt');16wpt.m23(function(err, data) {17 console.log(data);18 wpt.m22(function(err, data) {19 console.log(data);20 });21});22{"statusCode":200,"statusText":"OK","data":{"statusCode":200,"statusText":"Ok","data":{"m23":"Hello World"}}}23{"statusCode":200,"statusText":"OK","data":{"statusCode":200,"statusText":"Ok","data":{"m22":"Hello World"}}}24var wpt = require('wpt');25wpt.m23(function(err, data) {26 console.log(data);27 wpt.m22(function(err, data) {28 console.log(data);29 });30});31{"statusCode":200,"statusText":"OK","data":{"statusCode":200,"statusText":"Ok","data":{"m23":"Hello World"}}}32{"statusCode":200,"statusText":"OK","data":{"statusCode
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!