var ax=new Array();
var ay=new Array();
var bx=new Array();
var by=new Array();
function sample(){
pi=3.1425;
for(s=0;s<360;s++){
x1=250*Math.cos(s*pi/180);
ax[s]=Math.floor(x1)+250;
y1=250*Math.sin(s*pi/180);
ay[s]=Math.floor(y1)+250;
}
d1=Math.sqrt(2*150*150);
for(s=0;s<360;s++){
x1=d1*Math.cos(s*pi/180);
bx[s]=Math.floor(x1)+250;
y1=d1*Math.sin(s*pi/180);
by[s]=Math.floor(y1)+250;
}
paint();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"500\" height=\"500\">";
for(s=0;s<360;s++){
str=str+sub.rect(ax[s],ay[s],3,3,"red");
str=str+sub.rect(bx[s],by[s],3,3,"blue");
}
str=str+sub.line(100,100,100,400,3,"black");
str=str+sub.line(100,400,400,400,3,"black");
str=str+sub.line(400,400,400,100,3,"black");
str=str+sub.line(400,100,100,100,3,"black");
str=str+"</svg>";
$("#memo").html(str);
}
最終更新:2015年04月29日 11:21