///////////////////////////////////////////////// // global variable predeclarations //////////////////////////////////////////////// var pi = Math.PI; // convenience operator for pi var form = window.document.MScalc ; // define specific form on web page var maxEdges = 46 ; // number of pulse edges listable on screen var Angles = new Array (maxEdges) ; // array to hold all edges var dAngles = new Array (maxEdges) ; // special delta array to hold all edges var maxHarms =88 ; // number of harmonics listable on screen var Harms = new Array (maxHarms ); // array to hold all harmonics var a01= 0.53 ; // fundamental amplitude stash var zDist = 100 ; // zeroable distortion placeholder in percent var zHarms = 14 ; // count of zeroable harmonics var numPoints = 11 ; // decimal points of precision to screen ( from float conversion ) var maxQuantdeg = 20 ; // number of degreesof quantized "full scale" delay. maxQuantrad = maxQuantdeg*pi/180 ; // and quantized for radian use var zHarms = 13 ; // set zeroable harmonics 3-5-7-...-27 for selected ms global placeholder var msEdges = 14 ; // pulse edges for selected magic sinewave global placeholder var msPulses = 7 ; // number of pulses for selected magic sinewve global placeholder var msPhase = 12.000*pi/180 ; // radian carrier phase for selected magic sinewave placeholder var msOffset = 6.000*pi/180; // radian carrier zero offset for selected magic sinewave placeholder var sinSum = 1.2345 ; // sum of sine fractions for selected magic sinewave placeholder var nxnOrder = 14 ; // nxn equation to be solved for magic sinewave placeholder var guessPow = 4 ; // placemarker for second guessing var guessFract = 0.1 ; var eqns = [[2,2],[2,2],[2,2]] ; // placemarker for later redefined eqns array var eq0 = [2,2,2,2] ; // placemaker for later redefined eqn terms used for debug var eq1 = [2,2,2,2] ; var eq2 = [2,2,2,2] ; var eqd = [2,2,2,2] ; ///////////////////////////////////////////////////////// // screen to array transfer functions //////////////////////////////////////////////////////// // obscure loops are used to try and maximize "n" independence. // loadAngles fills the angles array from the screen values. Array angles are converted TO radians FROM degrees. function loadAngles (form) { for (jj = 0; jj= 0){signStr = ""} else { str = str.slice (1) ; signStr = "-"} while (str.length <= decPlaces ) {str = "0" + str} var decpoint = str.length - decPlaces ; return signStr + str.substring(0,decpoint) + "." + str.substring (decpoint,str.length) ; } ; //////////////////////////////////////// // angle export functions //////////////////////////////////////// // Export Data creates a text are pair with pulses as widths. // exportDataA gives absolute angle values. exportDataB gives individual pulse and delay widths. //Amplitude name is currently rounded to four decimal places. function exportDataA (form) { // by angle values currently rounds to ten decimal places to eliminate .9999 effect glotz1 = eval ( ( Math.round ( 100*10000* form.fa01.value) ) /10000 ) ; // 100 gets from .53 to 53 expas = "\n /angs" + glotz1.toFixed(4) + " [ % angle-position pairs \n " for (ii=0; ii Angles[12] = 120d - Angles[22] // p7e = p15e - 60 ---> Angles[13] = Angles[29] - 60d // p7s = 60 - p8s --> Angles[12] = 60d - Angles[14] // p6e = 60 - p8e --> Angles[11] = 60d - Angles[15] // p6s = p15s - 60 ---> Angles[10] = Angles[28] - 60d // p5e = p14e - 60 ---> Angles[9] = Angles[27] - 60d // p5s = 60 - p9s --> Angles[8] = 60d - Angles[16] // p4e = 60 - p9e --> Angles[7] = 60d - Angles[17] // p4s = p14s - 60 ---> Angles[6] = Angles[26] - 60d // p3e = p13e - 60 ---> Angles[5] = Angles[25] - 60d // p3s = 60 - p10s --> Angles[4] = 60d - Angles[18] // p2e = 60 - p10e --> Angles[3] = 60d - Angles[19] // p2s = p13s - 60 ---> Angles[2] = Angles[24] - 60d // p1e = p12e - 60 ---> Angles[1] = Angles[23] - 60d // p1s = 60 - p11s --> Angles[0] = 60d - Angles[20] function guessDf15 ( ) { sinSum = Math.sin ( ( 3.75 * pi/180)* ( 3.75 * pi/180) ) + // find total sin squared energy Math.sin ( ( 11.25 * pi/180)* ( 11.25 * pi/180) ) + Math.sin ( ( 18.75 * pi/180)* ( 18.75 * pi/180) ) + Math.sin ( ( 26.25 * pi/180)* ( 26.25 * pi/180) ) + Math.sin ( ( 33.75 * pi/180)* ( 33.75 * pi/180) ) + Math.sin ( ( 41.25 * pi/180)* ( 41.25 * pi/180) ) + Math.sin ( ( 48.75 * pi/180)* ( 48.75 * pi/180) ) + Math.sin ( ( 56.25 * pi/180)* ( 56.25 * pi/180) ) + Math.sin ( ( 63.75 * pi/180)* ( 63.75 * pi/180) ) + Math.sin ( ( 71.25 * pi/180)* ( 71.25 * pi/180) ) + Math.sin ( ( 78.75 * pi/180)* ( 78.75 * pi/180) ) + Math.sin ( ( 86.25 * pi/180)* ( 86.25 * pi/180) ) ; nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (86.25 * pi/180)* (86.25 * pi/180) ) )/sinSum ) ; Angles[29] = Math.acos ( Math.cos ( ( 86.25*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[28] = Math.acos ( Math.cos ( ( 86.25*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (78.75 * pi/180)* (78.75 * pi/180) ) )/sinSum ) ; Angles[27] = Math.acos ( Math.cos ( ( 78.75*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[26] = Math.acos ( Math.cos ( ( 78.75*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (71.25 * pi/180)* (71.25 * pi/180) ) )/sinSum ) ; Angles[25] = Math.acos ( Math.cos ( ( 71.25*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[24] = Math.acos ( Math.cos ( ( 71.25*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (63.75 * pi/180)* (53.75 * pi/180) ) )/sinSum ) ; Angles[23] = Math.acos ( Math.cos ( ( 63.75*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[22] = Math.acos ( Math.cos ( ( 63.75*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (56.25 * pi/180)* (56.25 * pi/180) ) )/sinSum ) ; Angles[21] = (120*pi/180) - Angles [22] ; // p11e is dependent on p12s Angles[20] = Math.acos ( Math.cos ( Angles[21] ) + nrgFract ) ; // pulse start angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (48.75 * pi/180)* (48.75 * pi/180) ) )/sinSum ) ; Angles[19] = Math.acos ( Math.cos ( (48.75*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[18] = Math.acos ( Math.cos ( ( 48.75*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (41.35 * pi/180)* (41.25 * pi/180) ) )/sinSum ) ; Angles[17] = Math.acos ( Math.cos ( ( 41.25*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[16] = Math.acos ( Math.cos ( ( 41.25*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (33.75 * pi/180)* (33.75 * pi/180) ) )/sinSum ) ; Angles[15] = Math.acos ( Math.cos ( (33.75*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[14] = Math.acos ( Math.cos ( ( 33.75*pi/180)) + nrgFract/2 ) ; // pulse end angle Angles[13] = Angles[29] - ( 60*pi/180) ; // dependent p3e Angles[12] = 60*(pi/180) - Angles[14] ; // dependent p3s Angles [11] = 60*(pi/180) - Angles[15] ; // dependent p4e Angles [10] = Angles[28] - (60*pi/180) ; // dependent p4s Angles[9] = Angles[27] - ( 60*pi/180) ; // dependent p3e Angles[8] = 60*(pi/180) - Angles[16] ; // dependent p3s Angles [7] = 60*(pi/180) - Angles[17] ; // dependent p4e Angles [6] = Angles[26] - (60*pi/180) ; // dependent p4s Angles[5] = Angles[25] - ( 60*pi/180) ; // dependent p3e Angles[4] = 60*(pi/180) - Angles[18] ; // dependent p3s Angles [3] = 60*(pi/180) - Angles[19] ; // dependent p2e Angles [2] = Angles[24] - (60*pi/180) ; // dependent p2s Angles[1] = Angles[23] - ( 60*pi/180) ; // dependent p1e Angles[0] = 60*(pi/180) - Angles[20] ; // dependent p1s // no second guessing yet storeAngles (this.form) ; // store revised angle array to form findHarms (this.form) ; // calculate revised amplitude and harmonics storeHarms (this.form) ; // store amplitude and harmonics to form findDist (this.form) ; // calculate and report revised zeroed distortion to form } ; // end guess Df15 function guessDf11 ( ) { sinSum = Math.sin ( ( 5 * pi/180)* ( 5 * pi/180) ) + // find total sin squared energy Math.sin ( ( 15 * pi/180)* ( 15 * pi/180) ) + Math.sin ( ( 25 * pi/180)* ( 25 * pi/180) ) + Math.sin ( ( 35 * pi/180)* ( 35 * pi/180) ) + Math.sin ( ( 45 * pi/180)* ( 45 * pi/180) ) + Math.sin ( ( 55 * pi/180)* ( 55 * pi/180) ) + Math.sin ( ( 65 * pi/180)* ( 65 * pi/180) ) + Math.sin ( ( 75 * pi/180)* ( 75 * pi/180) ) + Math.sin ( ( 85 * pi/180)* ( 85 * pi/180) ) ; nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (85 * pi/180)* (85 * pi/180) ) )/sinSum ) ; Angles[21] = Math.acos ( Math.cos ( ( 85*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[20] = Math.acos ( Math.cos ( ( 85*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (75 * pi/180)* (75 * pi/180) ) )/sinSum ) ; Angles[19] = Math.acos ( Math.cos ( ( 75*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[18] = Math.acos ( Math.cos ( ( 75*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (65 * pi/180)* (65 * pi/180) ) )/sinSum ) ; Angles[17] = Math.acos ( Math.cos ( ( 65*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[16] = Math.acos ( Math.cos ( ( 65*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (55 * pi/180)* (55 * pi/180) ) )/sinSum ) ; Angles[15] = (120*pi/180) - Angles [16] ; // p8e is dependent on p9s Angles[14] = Math.acos ( Math.cos ( Angles[15] ) + nrgFract ) ; // pulse start angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (45 * pi/180)* (45 * pi/180) ) )/sinSum ) ; Angles[13] = Math.acos ( Math.cos ( ( 45*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[12] = Math.acos ( Math.cos ( ( 45*pi/180)) + nrgFract/2 ) ; // pulse end angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (35 * pi/180)* (35 * pi/180) ) )/sinSum ) ; Angles[11] = Math.acos ( Math.cos ( ( 35*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[10] = Math.acos ( Math.cos ( ( 35*pi/180)) + nrgFract/2 ) ; // pulse end angle Angles[9] = Angles[21] - ( 60*pi/180) ; // dependent p5e Angles[8] = 60*(pi/180) - Angles[10] ; // dependent p5s Angles[7] = 60*(pi/180) - Angles[11] ; // dependent p4e Angles[6] = Angles[20] - 60*(pi/180) ; // dependent p4s Angles[5] = Angles[19] - ( 60*pi/180) ; // dependent p3e Angles[4] = 60*(pi/180) - Angles[12] ; // dependent 3s Angles[3] = 60*(pi/180) - Angles[13] ; // dependent p2e Angles[2] = Angles[18] - (60*pi/180) ; // dependent p2s Angles[1] = Angles[17] - ( 60*pi/180) ; // dependent p1e Angles[0] = 60*(pi/180) - Angles[14] ; // dependent p1s // no second guessing yet storeAngles (this.form) ; // store revised angle array to form findHarms (this.form) ; // calculate revised amplitude and harmonics storeHarms (this.form) ; // store amplitude and harmonics to form findDist (this.form) ; // calculate and report revised zeroed distortion to form } ; // end guess Df11 // guessDf7is presently "hard wired" and n dependent // carrier angles are 7.5, 22,5, 37.5, 52.5, 67.5, and 82.5 // independent edges are p7e, p7s, p6e, p6s, p5s, p4e, and p4s. // dependent edges are p6e, p3e, p3s, p2e, p2s, p1e, and p1s // dependence relationships are ( from http://www.tinaja.com/glib/deltams1.pdf ) ... // p5e = 120 - p6s ---> Angles{9] = 120r - Angles[10} // p3e = p7e - 60 ---> Angles[5] = Angles[13] - 60r // p3s = 60 - p4s ---> Angles [4] = 60r - Angles[6] // p2e = 60 - p4e ---> Angles [3] = 60r - Angles [7] // p2s = p7s - 60 ---> Angles{2] = Angles[12] -60r // p1e = p6e - 60 ---> Angles[1] = Angles[11] - 60r // p1s = 60 - p5s ---> Angles[0] = 60r - Angles[8] ; function guessDf7 ( ) { ; sinSum = Math.sin ( ( 7.5 * pi/180)* ( 7.5 * pi/180) ) + // find total sin squared energy Math.sin ( (22.5 * pi/180)* (22.5 * pi/180) ) + Math.sin ( (37.5 * pi/180)* (37.5 * pi/180) ) + Math.sin ( (52.5 * pi/180)* (52.5 * pi/180) ) + Math.sin ( (67.5 * pi/180)* (67.5 * pi/180) ) + Math.sin ( (82.5 * pi/180)* (82.5 * pi/180) ) ; nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (82.5 * pi/180)* (82.5 * pi/180) ) )/sinSum ) ; Angles[13] = Math.acos ( Math.cos ( ( 82.5*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[12] = Math.acos ( Math.cos ( ( 82.5*pi/180)) + nrgFract/2 ) ; // pulse start angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (67.5 * pi/180)* (67.5 * pi/180) ) )/sinSum ) ; Angles[11] = Math.acos ( Math.cos ( ( 67.5*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[10] = Math.acos ( Math.cos ( ( 67.5*pi/180)) + nrgFract/2 ) ; // pulse start angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (52.5 * pi/180)* (52.5 * pi/180) ) )/sinSum ) ; Angles[9] = (120*pi/180) - Angles [10] ; // p5e is dependent on p6s Angles[8] = Math.acos ( Math.cos ( Angles[9]) + nrgFract ) ; // pulse start angle FULL nrgFract nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (37.5 * pi/180)* (37.5 * pi/180) ) )/sinSum ) ; Angles[7] = Math.acos ( Math.cos ( ( 37.5*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[6] = Math.acos ( Math.cos ( ( 37.5*pi/180)) + nrgFract/2 ) ; // pulse start angle Angles[5] = Angles[13] - (60*pi/180) ; // dependent p3e Angles[4] = 60*pi/180 - Angles[6] ; // dependent p3s Angles[3] = 60*(pi/180) - Angles[7] ; // dependent p2e Angles[2] = Angles[12] - (60*pi/180) ; // dependent p2s Angles[1] = Angles[11] - (60*pi/180) ; // dependent p1e Angles[0] = 60*(pi/180) - Angles[8] ; // dependent p1s // Secondguess7d () ; //try second guessing storeAngles (this.form) ; // store revised angle array to form findHarms (this.form) ; // calculate revised amplitude and harmonics storeHarms (this.form) ; // store amplitude and harmonics to form findDist (this.form) ; // calculate and report revised zeroed distortion to form } ; // end guess Def7 // Secondguess7d makes only a minor improvement so far -- not connected fudge7 = -0.29*pi/180 ; fudge7 = 0 ; function Secondguess7d () { Angles[0] += Math.sin ( Angles[0] )*fudge7 ; // this is fixte 0.53 amplitude adjustment only! Angles[1] += Math.sin ( Angles[0] )*fudge7 ; Angles[2] += Math.sin ( Angles[0] )*fudge7 ; Angles[3] += Math.sin ( Angles[0] )*fudge7 ; Angles[4] += Math.sin ( Angles[0] )*fudge7 ; Angles[5] += Math.sin ( Angles[0] )*fudge7 ; Angles[6] += Math.sin ( Angles[0] )*fudge7 ; Angles[7] += Math.sin ( Angles[0] )*fudge7 ; Angles[8] += Math.sin ( Angles[0] )*fudge7 ; Angles[9] += Math.sin ( Angles[0] )*fudge7 ; Angles[10] += Math.sin ( Angles[0] )*fudge7 ; Angles[11] += Math.sin ( Angles[0] )*fudge7 ; Angles[12] += Math.sin ( Angles[0] )*fudge7 ; Angles[13] += Math.sin ( Angles[0] )*fudge7 ; } ; // guessDf3is presently "hard wired" and n dependent // carrier angles are 15, 45, and 75 // independent edges are p2s, p3s, p3e // dependent edges are p1s, p1e, and p2e // dependence relationships are ( from http://www.tinaja.com/glib/deltams1.pdf ) ... // p2e = 120 - p3s ---> Angles[3] = 120d - Angles[4] // p1e = p3e - 60 ---> Angles[1] = Angles[5] - 60d // p1s = 60 - p2s --> Angles[0] = 60d - Angles[2] function guessDf3 ( ) { sinSum = Math.sin ( ( 15 * pi/180)* ( 15 * pi/180) ) + // find total sin squared energy Math.sin ( ( 45 * pi/180)* ( 45 * pi/180) ) + Math.sin ( ( 75 * pi/180)* ( 75 * pi/180) ) ; nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (75 * pi/180)* (75 * pi/180) ) )/sinSum ) ; Angles[5] = Math.acos ( Math.cos ( ( 75*pi/180)) - nrgFract/2 ) ; // pulse end angle Angles[4] = Math.acos ( Math.cos ( ( 75*pi/180)) + nrgFract/2 ) ; // pulse start angle nrgFract = form["fa00"]["value"] *pi/4 * ( ( Math.sin ( (45 * pi/180)* (45 * pi/180) ) )/sinSum ) ; Angles[3] = (120*pi/180) - Angles [4] ; // p2e is dependent on p6s Angles[2] = Math.acos ( Math.cos ( Angles[3] ) + nrgFract ) ; // pulse start angle Angles[1] = Angles[5] - (60*pi/180) ; // dependent p1e Angles[0] = 60*(pi/180) - Angles[2] ; // dependent p1s // no second guessing yet storeAngles (this.form) ; // store revised angle array to form findHarms (this.form) ; // calculate revised amplitude and harmonics storeHarms (this.form) ; // store amplitude and harmonics to form findDist (this.form) ; // calculate and report revised zeroed distortion to form } ; // end guess Def3 ////////////////////////////////////////////// // improve functions ///////////////////////////////////////////// // imProveBeff calculates an improved guess for Best Efficiency magic sinewaves. // Array generation is kept dynamic and local to allow n independence on sinewave changes. function imProveBeff () { eqns = Array (nxnOrder) ; // attempt to create redefined? two dimensional array of n and n+1 for ( ii=0; ii0){iixx = Angles.length - ii} ; // highest harm first for Gauss // nn = 2*iixx + 1 ; // generates 1,3,5.... nn = 1 ; // fundamental first if (ii>0) {nn = harmSequence [ii] } ; // minimize coeff buildup for (jj= 0;jj0) {nn = harmSequence [ii] } ; // attempt to minimize coeff buildup for (jj= 0;jj=1; i3--) { zz = eqns[i3][gjNsize] ; for (var i4 = (i3-1); i4 >=0 ; i4--){ eqns[i4][gjNsize] -= eqns [i4][i3]*zz eqns[i4][i3] = 0 } } ; } ; // optional 4x4 test routine should return 4,3,2,1... function testGJ () { eq0 = [ 4, 3, -2, 1 , 22 ] eq1 = [ 2, 1, -2, 2, 9 ] eq2 = [ 1,-1, 1, 5 , 8 ] eq3 = [ 3, 1, 3, 1 , 22 ] eqns = [ eq0, eq1, eq2, eq3] ; solveGaussJordan () ; alert (eqns) ; } ; ////////////////////////////////////////////////// //// exploration and derivation area ///////////////////////////////////////////////// // Some notes on deriving the delta equations. Seven independent edges are p4s, p4e, p5s, p6s, p6e, p7s, p7e. // start edges are positive, end edges are negative. // Because of Gaussian reduction, negative equations are equal to their positive equivalents. This greatly simplifies // certain expressions. // p3s = 60 - p4s ---> Angles [4] = 60r - Angles[6] fundamental terms are + [ cos (60 - p4s) + cos(p4s) ] // cos60*cos(p4s) + sin60*sin(p4s) + cos(p4s) = + [ 0.866* sin(p4s) + 1.5* cos(p4s) ] = p4sx term // p2e = 60 - p4e ---> Angles [3] = 60r - Angles [7] fundamental terms are -(cos(60-p4e) - cos(p4e) // -(cos(60)*cos(p4e) + sin(60)*sin(p4e) -cos(p4e) = - [ 0.866* sin(p4e) + 1.5* cos(p4e) ] = p4ex term // p1s = 60 - p5s ---> Angles[0] = 60r - Angles[8] ; fundamental terms are + [cos (60 - p5s) + cos(p5s) ] // cos60*cos(p5s) + sin60*sin(p5s) + cos(p5s) = + [ 0.866* sin(p5s) + 1.5* cos(p5s) ] = p5sx term // p5e = 120 - p6s ---> want p6s[10] - p5e[9] ---> cos(p6s) - cos (120 - p6s) // cos(p6s) - [ cos(120)cos(p6s) + sin(120)sin(p6s) ] --> cos(p6s) - [-0.5cos(p6s) + 0.866sin(p6s) ] --> // 1.5 cos(p6s) -0.866sin(p6s) ---> // p1e = p6e - 60 ---> Angles[1] = Angles[11] - 60r fundamental terms are -cos(p6e - 60) -cos(p6e) // -[cos(p6e)*cos(60) + sin(p6e)*sin(60)] - cos(p6e) = - [ 0.866*sin(p6e) + 1.5* cos(p6e) ] = p6ex term // p2s = p7s - 60 ---> Angles{2] = Angles[12] -60r fundmental terms are + cos(p7s - 60) + cos(p7s) // cos(p7s)cos(60) + sin(p7s)sin(60) + cos(p7s) = + [ 0.866*sin(p7s) + 1.5 * cos(p7s) ] = p7sx term // p3e = p7e - 60 ---> Angles[5] = Angles[13] - 60r fundamental terms are - [ cos(p7e - 60) - cos(p7e) ] // -[cos(60)*cos(p7e) + sin(60)*sin(p7e)] - cos(p7e) - [0.866*sin(p7e) + 1.5 *cos(p7e) ] = p7ex term // Extreme serendipity shows [0.866*sin(p7e) + 1.5 *cos(p7e) ] is apparently p7ex = (p7e + 60 degrees)*(sin(60)) valid in first quadrant. // The reverse transform would be p7e = (p7ex - 60 degrees)/(sin(60)) . // third and other triad harmonics will self-zero l as individual term pairs... // for instance, cos (3*p4s) + cos(3*(p3s) = cos (3*p4s) + cos(3*(60 - p4s)) = cos (3*p4s) + cos(180 - 3*p4s)) = // cos (3*p4s)+ [cos(180)cos(3*4ps) + sin(180)sin(3*4ps) = cos (3*p4s)+ [-1*)cos(3*4ps) + 0*sin(3*4ps) = 0 // find the fifth order equation paired terms... // typical for the paired edge cases... // cos (5*p4s) + cos(5*(p3s) = cos (5*p4s) + cos(5*(60 - p4s)) = cos (5*p4s) + cos(300 - 3*p4s)) = // cos (5*p4s)+ [cos(300)cos(5*4ps) + sin(300)sin(5*4ps)] = cos (5*p4s)+ [cos(-60)cos(5*4ps) + sin(-60)sin(5*4ps)] // cos (5*p4s)+ 0.5*)cos(5*4ps) + 0.866*sin(5*4ps) = 1.5*cos (5*p4s) - 0.866*sin(5*4ps) // vector transforms to - [ cos (5*(p4s + 30) * 2 * sin(60) ] // for the crossed edge case... // p5e = 120 - p6s // cos (5*p6s) - cos(5*(p5e) = cos (5*p6s) - [ cos(5*(120 - p6s) ] = cos (5*p6s) - [ cos(600 - 5*p6s) ] = cos (5*p6s) - [ cos(-120 - 5*p6s) ] = // cos (5*p6s) - [ cos(-120)cos(5*p6s) + sin(-120)sin(5*p6s) ] = cos (5*p6s) - [ -0.5*cos(5*p6s) - 0.866 sin(5*p6s) ] = // 1.5*cos(5*4ps) + 0.866* sin(5*6ps) vector transforms to // vector transforms to + [ cos (5*(p4s + 30) * 2 * sin(60) ] // bottom line... // leading or trailing edge pairs radian transform as // Angles[10] = dAngles[0] + (30*pi/180) ; // when[10] and [0] are paired, etc // Angles[11] = dAngles[1] + (30*pi/180) ; // Angles[12] = dAngles[2] + (30*pi/180) ; // Angles[13] = dAngles[3] + (30*pi/180) ; // Angles[14] = dAngles[4] + (30*pi/180) ; // crossed edge pairs radian transform as... // Angles[16] = dAngles[5] - (30*pi/180) ; // special because of mixed edges // These relationships follow from summing the two angles together and then using the trig // identity of cos (a+b) = cos(a)cos(b) - sin(a)sin(b), simplifying, and finding the cosine equivalent angle. // They also appear to be the vector sum of the two angles involved. //////////////////////////////////////////// //// test and trial area /////////////////////////////////////////// // last uncommented deBug in list is the active one. function deBug () { alert ("Debug is not currently active.") ; } ; // end test area //////////////////////////////////