アットウィキロゴ

p555p

var x=new Array();
var y=new Array();
var z=new Array();
var m;
 
function sample(){
 
 
n=0;
m=0;    
 
 var timer;
var delay = 100;
 
var loop = function () {
 
n=n+1;
if(n>500)m=0;    
if(n>500)n=1;
 
x[n]=500*Math.random();
y[n]=500*Math.random();   
z[n]=500*m/n;
 
h=0;    
if(x[n]<250)h=h+1;
if(y[n]<250)h=h+1;   
if(h==2)m=m+1;
 
paint();   
 
 
 
 
clearTimeout(timer);
    timer = setTimeout(loop, delay);
}
 
loop();
 
 
 
 
 
 
 
}
 
function randx(mu,sig) {
 
 
  pi = Math.PI;
 
  p1 = 0;
  p2 = 0;
 
  x1=Math.random();
  x2=Math.random();
 
  f1=Math.log(x1);
  r=Math.sqrt(-2*f1)*Math.cos(2 * pi * x2);
 
 
 
p3=mu+sig*r;
 
return p3;
 
 
}
 
function paint(){
 
      var sub=new svgpaint();
 
str="<svg width=\"700\" height=\"700\">";
h=0;
 
for(s=1;s<n+1;s++){
str=str+sub.rect(s,500-z[s],1,1,"red");
}
 
str=str+"</svg>";
$("#memo").html(str);
 
 
 
  }
 
最終更新:2016年04月22日 01:41