var x1,y1,x2,y2;
var x=new Array();
var y=new Array();
function sample(){
for(t=100;t<400;t++){
u1=Math.pow(t,0.66)*Math.pow(t,0.34);
xs=t;
ys=t;
maxu=0;
for(s=100;s<400;s++){
c1=u1/Math.pow(s,0.66);
y1=Math.pow(c1,3);
x2=500-s;
y2=500-y1;
u2=Math.pow(x2,0.34)*Math.pow(y2,0.66);
if(x2<0)u2=-999;
if(y2<0)u2=-999;
if(u2>maxu)xs=s;
if(u2>maxu)ys=y1;
if(u2>maxu)maxu=u2;
}
x[t]=u1;
y[t]=maxu;
}
maxu=0;
for(t=100;t<400;t++){
u1=x[t]*y[t];
if(u1>maxu)xs=x[t];
if(u1>maxu)ys=y[t];
if(u1>maxu)maxu=u1;
}
paint();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"500\" height=\"500\">";
str=str+sub.rect(0,0,500,500,"green");
str=str+sub.rect(xs,500-ys,5,5,"red");
str=str+"</svg>";
$("#memo").html(str);
}
最終更新:2016年11月22日 11:50