第i枚导弹跟随领弹,在指定攻击时间内以相同攻角攻击目标
clear
clc
%----------领弹参数----------
v_L=250;
x_L=400;
y_L=0;
theta_L=30*pi/180;%导弹航迹角
%----------第i枚被领弹参数(0<φi(0)<Π)----------
v_i=250;
x_i=0;
y_i=300;
theta_i=30*pi/180;%导弹航迹角
%----------目标参数----------
v_t=0;%静止
x_t=1000;
y_t=1000;
theta_t=0;
%----------领弹变量定义----------
R_L=sqrt((x_L-x_t)2+(y_L-y_t)2);
q_L=atan((y_t-y_L)/(x_t-x_L));
dR_L=((x_L-x_t)(v_Lcos(theta_L)-v_tcos(theta_t))+(y_L-y_t)(v_Lsin(theta_L)-v_tsin(theta_t)))/sqrt((x_L-x_t)2+(y_L-y_t)2);
dq_L=((x_t-x_L)(v_tsin(theta_t)-v_Lsin(theta_L))-(y_t-y_L)(v_tcos(theta_t)-v_Lcos(theta_L)))/((x_L-x_t)2+(y_L-y_t)2);
n=1;
t=0;
dt=0.01;
hit_angle_L=