1 Clazz.declarePackage ("JU");
2 Clazz.load (["JU.T3"], "JU.V3", null, function () {
3 c$ = Clazz.declareType (JU, "V3", JU.T3);
4 Clazz.makeConstructor (c$,
7 c$.newV = Clazz.defineMethod (c$, "newV",
9 return JU.V3.new3 (t.x, t.y, t.z);
11 c$.newVsub = Clazz.defineMethod (c$, "newVsub",
13 return JU.V3.new3 (t1.x - t2.x, t1.y - t2.y, t1.z - t2.z);
15 c$.new3 = Clazz.defineMethod (c$, "new3",
23 Clazz.defineMethod (c$, "angle",
25 var xx = this.y * v1.z - this.z * v1.y;
26 var yy = this.z * v1.x - this.x * v1.z;
27 var zz = this.x * v1.y - this.y * v1.x;
28 var cross = Math.sqrt (xx * xx + yy * yy + zz * zz);
29 return Math.abs (Math.atan2 (cross, this.dot (v1)));