I am having problems with this piece of script. Usually the script
works and the alert gives an array length of 9. But every so often the
array length is 8 and naturally the output is then wrong. But seeing
as I am using dis/8 in the loop how can the array length be 8?
var dis = myLine.Distance ();
var fresnelHi=[];
var fresnelLo=[];
var heightDiff;
var minHeight;
var slope=heightDif f/dis;
var freq= document.getEle mentById("Freq1 ").value;
wl= .3/freq ;
for(s=0;s<=dis; s=s+(dis/8)) {
var intervalHeight= (slope*s) + minHeight;
var points=wl*s*(di s-s)/dis;
fresHi=(interva lHeight + Math.sqrt(point s))/10;
fresnelHi.push( fresHi);
fresLo=(interva lHeight - Math.sqrt(point s))/10;
fresnelLo.push( fresLo);
}
alert(fresnelLo .length)
works and the alert gives an array length of 9. But every so often the
array length is 8 and naturally the output is then wrong. But seeing
as I am using dis/8 in the loop how can the array length be 8?
var dis = myLine.Distance ();
var fresnelHi=[];
var fresnelLo=[];
var heightDiff;
var minHeight;
var slope=heightDif f/dis;
var freq= document.getEle mentById("Freq1 ").value;
wl= .3/freq ;
for(s=0;s<=dis; s=s+(dis/8)) {
var intervalHeight= (slope*s) + minHeight;
var points=wl*s*(di s-s)/dis;
fresHi=(interva lHeight + Math.sqrt(point s))/10;
fresnelHi.push( fresHi);
fresLo=(interva lHeight - Math.sqrt(point s))/10;
fresnelLo.push( fresLo);
}
alert(fresnelLo .length)
Comment