From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library) git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/math/README | 38 ----- includes/js/dojox/math/_base.js | 122 ---------------- includes/js/dojox/math/curves.js | 193 ------------------------- includes/js/dojox/math/matrix.js | 294 --------------------------------------- 4 files changed, 647 deletions(-) delete mode 100644 includes/js/dojox/math/README delete mode 100644 includes/js/dojox/math/_base.js delete mode 100644 includes/js/dojox/math/curves.js delete mode 100644 includes/js/dojox/math/matrix.js (limited to 'includes/js/dojox/math') diff --git a/includes/js/dojox/math/README b/includes/js/dojox/math/README deleted file mode 100644 index f9f50ad..0000000 --- a/includes/js/dojox/math/README +++ /dev/null @@ -1,38 +0,0 @@ -------------------------------------------------------------------------------- -DojoX Math -------------------------------------------------------------------------------- -Version 0.9 -Release date: 10/20/2007 -------------------------------------------------------------------------------- -Project state: -experimental -------------------------------------------------------------------------------- -Credits - Cal Henderson - Dan Pupius - Tom Trenka (ttrenka AT gmail.com) -------------------------------------------------------------------------------- -Project description - -A port of the main functionality of dojo.math 0.4. Includes advanced math -functions, abstract curve definitions, and some point calculations. -------------------------------------------------------------------------------- -Dependencies: - -Depends on the Dojo Core, v1.0 -------------------------------------------------------------------------------- -Documentation - -See the API documentation. -------------------------------------------------------------------------------- -Installation instructions - -Grab the following from the Dojo SVN Repository: -http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/math.js -http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/math/* - -Install into the following directory structure: -/dojox/math/ - -...which should be at the same level as your Dojo checkout. -------------------------------------------------------------------------------- diff --git a/includes/js/dojox/math/_base.js b/includes/js/dojox/math/_base.js deleted file mode 100644 index ef2243c..0000000 --- a/includes/js/dojox/math/_base.js +++ /dev/null @@ -1,122 +0,0 @@ -if(!dojo._hasResource["dojox.math._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.math._base"] = true; -dojo.provide("dojox.math._base"); - -dojo.mixin(dojox.math, { - degreesToRadians: function(/* Number */n){ - // summary - // Convert the passed number to radians. - return (n*Math.PI)/180; // Number - }, - radiansToDegrees: function(/* Number */n){ - // summary - // Convert the passed number to degrees. - return (n*180)/Math.PI; // Number - }, - - factoral: function(/* Number */n){ - // summary - // Return the factoral of n. - if(n<1){ - return 0; // Number - } - var ret=1; - for(var i=1; i<=n; i++){ - ret*=i; - } - return ret; // Number - }, - permutations: function(/* Number */n, /* Number */k){ - // summary - // TODO - if(n==0 || k==0){ - return 1; // Number - } - return (this.factoral(n)/this.factoral(n-k)); - }, - combinations: function(/* Number */n, /* Number */r){ - // summary - // TODO - if(n==0 || r==0){ - return 1; // Number - } - return (this.factoral(n)/(this.factoral(n-r)*this.factoral(r))); // Number - }, - bernstein: function(/* Number */t, /* Number */n, /* Number */ i){ - // summary - // TODO - return (this.combinations(n, i)*Math.pow(t, i)*Math.pow(1-t, n-i)); // Number - }, - gaussian: function(){ - // summary - // Return a random number based on the Gaussian algo. - var k=2; - do{ - var i=2*Math.random()-1; - var j=2*Math.random()-1; - k = i*i+j*j; - }while(k>=1); - return (i * Math.sqrt((-2*Math.log(k))/k)); // Number - }, - - // basic statistics - sd: function(/* Array */a){ - // summary - // Returns the standard deviation of the passed arguments. - return Math.sqrt(this.variance(a)); // Number - }, - variance: function(/* Array */a){ - // summary - // Find the variance in the passed array of numbers. - var mean=0, squares=0; - dojo.forEach(a, function(item){ - mean+=item; - squares+=Math.pow(item,2); - }); - return (squares/a.length)-Math.pow(mean/a.length, 2); // Number - }, - - // create a range of numbers - range: function(/* Number */a, /* Number? */b, /* Number? */step){ - // summary - // Create a range of numbers based on the parameters. - if(arguments.length<2){ - b=a,a=0; - } - var s=step||1; - var range=[]; - if(s>0){ - for(var i=a; ib; i+=s){ - range.push(i); - } - }else{ - throw new Error("dojox.math.range: step must not be zero."); - } - } - return range; // Array - }, - distance: function(/* Array */a, /* Array */b){ - // summary - // Calculate the distance between point A and point B - return Math.sqrt(Math.pow(b[0]-a[0],2)+Math.pow(b[1]-a[1],2)); // Number - }, - midpoint: function(/* Array */a, /* Array */b){ - // summary - // Calculate the midpoint between points A and B. A and B may be multidimensional. - if(a.length!=b.length){ - console.error("dojox.math.midpoint: Points A and B are not the same dimensionally.", a, b); - } - var m=[]; - for(var i=0; i= 1) { - return this.p[this.p.length - 1]; - } - if (step <= 0) { - return this.p[0]; - } - var retVal = new Array(this.p[0].length); - for (var k = 0; j < this.p[0].length; k++) { - retVal[k] = 0; - } - for (var j = 0; j < this.p[0].length; j++) { - var C = 0; - var D = 0; - for (var i = 0; i < this.p.length; i++) { - C += this.p[i][j] * this.p[this.p.length - 1][0] * dojox.math.bernstein(step, this.p.length, i); - } - for (var l = 0; l < this.p.length; l++) { - D += this.p[this.p.length - 1][0] * dojox.math.bernstein(step, this.p.length, l); - } - retVal[j] = C / D; - } - return retVal; - }; - this.p = pnts; - return this; - }, - CatmullRom:function (pnts, c) { - this.getValue = function (step) { - var percent = step * (this.p.length - 1); - var node = Math.floor(percent); - var progress = percent - node; - var i0 = node - 1; - if (i0 < 0) { - i0 = 0; - } - var i = node; - var i1 = node + 1; - if (i1 >= this.p.length) { - i1 = this.p.length - 1; - } - var i2 = node + 2; - if (i2 >= this.p.length) { - i2 = this.p.length - 1; - } - var u = progress; - var u2 = progress * progress; - var u3 = progress * progress * progress; - var retVal = new Array(this.p[0].length); - for (var k = 0; k < this.p[0].length; k++) { - var x1 = (-this.c * this.p[i0][k]) + ((2 - this.c) * this.p[i][k]) + ((this.c - 2) * this.p[i1][k]) + (this.c * this.p[i2][k]); - var x2 = (2 * this.c * this.p[i0][k]) + ((this.c - 3) * this.p[i][k]) + ((3 - 2 * this.c) * this.p[i1][k]) + (-this.c * this.p[i2][k]); - var x3 = (-this.c * this.p[i0][k]) + (this.c * this.p[i1][k]); - var x4 = this.p[i][k]; - retVal[k] = x1 * u3 + x2 * u2 + x3 * u + x4; - } - return retVal; - }; - if (!c) { - this.c = 0.7; - } else { - this.c = c; - } - this.p = pnts; - return this; - }, - Arc:function (start, end, ccw){ - function translate(a,b){ - var c=new Array(a.length); - for(var i=0; i= r[0] && n < r[1]) { - var subN = (n - r[0]) / r[2]; - value = curves[i].getValue(subN); - found = true; - break; - } - } - if (!found) { - value = curves[curves.length - 1].getValue(1); - } - for (var j = 0; j < i; j++) { - value = dojox.math.points.translate(value, curves[j].getValue(1)); - } - return value; - }; - function computeRanges() { - var start = 0; - for (var i = 0; i < weights.length; i++) { - var end = start + weights[i] / totalWeight; - var len = end - start; - ranges[i] = [start, end, len]; - start = end; - } - } - return this; - } -}); - -} diff --git a/includes/js/dojox/math/matrix.js b/includes/js/dojox/math/matrix.js deleted file mode 100644 index 386bad3..0000000 --- a/includes/js/dojox/math/matrix.js +++ /dev/null @@ -1,294 +0,0 @@ -if(!dojo._hasResource["dojox.math.matrix"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.math.matrix"] = true; -dojo.provide("dojox.math.matrix"); - -dojo.mixin(dojox.math.matrix, { - iDF:0, - ALMOST_ZERO: 1e-10, - multiply: function(/* Array */a, /* Array */b){ - // summary - // Multiply matrix a by matrix b. - var ay=a.length, ax=a[0].length, by=b.length, bx=b[0].length; - if(ax!=by){ - console.warn("Can't multiply matricies of sizes " + ax + "," + ay + " and " + bx + "," + by); - return [[0]]; - } - var c=[]; - for (var k=0; k-1){ - b+="."; - } - while(b.length0?a[0].length:0; - var buffer=""; - for(var y=0; y