Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 623: | Rivi 623: | ||
ic = 1; | ic = 1; | ||
− | iavg = 0. | + | iavg = 0.5; |
for ( var row=0; row<10; row++ ) { | for ( var row=0; row<10; row++ ) { | ||
Rivi 630: | Rivi 630: | ||
y = row * 10 + 1; | y = row * 10 + 1; | ||
if ( ic > 0 ) { | if ( ic > 0 ) { | ||
− | dist = Math.sqrt( Math.pow( (4.5-col), 2 ) + Math.pow( (4.5-row), 2 ) )/ Math.sqrt( 40.5 ); | + | dist = 1-Math.sqrt( Math.pow( (4.5-col), 2 ) + Math.pow( (4.5-row), 2 ) )/ Math.sqrt( 40.5 ); |
− | |||
− | |||
random = (Math.random()-0.5)*0.25; | random = (Math.random()-0.5)*0.25; | ||
if ( ( (dist+random) > (1-iavg) ) ) { | if ( ( (dist+random) > (1-iavg) ) ) { |