拿到新超武钻头才开始研究蓄力模式,为了发挥新超武的挖坑特性,显然比较适合用高抛的打法。但钻头的爆炸直径小,对高抛准度有很高的要求。
传统高抛计算一般采用经验公式:
力度=95
角度=90°-屏距±风力×2
但这样算出的只是近似结果,当距离较大或者有垂直高度差时结果往往不准
因此我采用二次函数图像拟合的方法计算,作出了一个计算高抛角度力度的小程序,输入xy坐标和风力就能计算出高抛的角度力度,误差在0.1屏距以内(测试并不是很多,可能还需要修正)
程序使用matlab编写的,暂时还不会打包,只能分享下代码
clear;
x0=input('x:');y0=input('y:');
theta=100;
t0=theta/180*pi;
power=95;
wind=input('风力:');
w=wind*0.352;
v=power*0.1795;
vx=v*cos(t0);
vy=v*sin(t0);
t1=(vy+(vy^2-2*10*y0)^0.5)/10;
% x1=t1*vx+0.5*w*t1^2;
dis=abs(vx*t1+0.5*w*t1^2-x0);
while(dis>0.1)
theta=theta-0.1;
t0=theta/180*pi;
vx=v*cos(t0);
vy=v*sin(t0);
t1=(vy+(vy^2-2*10*y0)^0.5)/10;
dis=abs(vx*t1+0.5*w*t1^2-x0);
end
t=0:0.01:20;
y=t.*vy-0.5*10*t.^2;
x=t.*vx+0.5*w*t.^2;
plot(x,y);
hold on;
plot(x0,y0,'*');
axis([0 30 -10 30]);
theta1=round(theta);
power=95+(theta-theta1)*10;
disp('角度:');
disp(theta1);
disp('力度:');
disp(power);
传统高抛计算一般采用经验公式:
力度=95
角度=90°-屏距±风力×2
但这样算出的只是近似结果,当距离较大或者有垂直高度差时结果往往不准
因此我采用二次函数图像拟合的方法计算,作出了一个计算高抛角度力度的小程序,输入xy坐标和风力就能计算出高抛的角度力度,误差在0.1屏距以内(测试并不是很多,可能还需要修正)
程序使用matlab编写的,暂时还不会打包,只能分享下代码
clear;
x0=input('x:');y0=input('y:');
theta=100;
t0=theta/180*pi;
power=95;
wind=input('风力:');
w=wind*0.352;
v=power*0.1795;
vx=v*cos(t0);
vy=v*sin(t0);
t1=(vy+(vy^2-2*10*y0)^0.5)/10;
% x1=t1*vx+0.5*w*t1^2;
dis=abs(vx*t1+0.5*w*t1^2-x0);
while(dis>0.1)
theta=theta-0.1;
t0=theta/180*pi;
vx=v*cos(t0);
vy=v*sin(t0);
t1=(vy+(vy^2-2*10*y0)^0.5)/10;
dis=abs(vx*t1+0.5*w*t1^2-x0);
end
t=0:0.01:20;
y=t.*vy-0.5*10*t.^2;
x=t.*vx+0.5*w*t.^2;
plot(x,y);
hold on;
plot(x0,y0,'*');
axis([0 30 -10 30]);
theta1=round(theta);
power=95+(theta-theta1)*10;
disp('角度:');
disp(theta1);
disp('力度:');
disp(power);