1 Clazz.declarePackage ("JU");
\r
2 Clazz.load (["JU.T3d"], "JU.V3d", null, function () {
\r
3 c$ = Clazz.declareType (JU, "V3d", JU.T3d);
\r
4 Clazz.defineMethod (c$, "cross",
\r
6 this.set (v1.y * v2.z - v1.z * v2.y, v1.z * v2.x - v1.x * v2.z, v1.x * v2.y - v1.y * v2.x);
\r
8 Clazz.defineMethod (c$, "normalize",
\r
10 var d = this.length ();
\r
15 Clazz.defineMethod (c$, "dot",
\r
17 return this.x * v.x + this.y * v.y + this.z * v.z;
\r
19 Clazz.defineMethod (c$, "lengthSquared",
\r
21 return this.x * this.x + this.y * this.y + this.z * this.z;
\r
23 Clazz.defineMethod (c$, "length",
\r
25 return Math.sqrt (this.lengthSquared ());
\r