watchdog545
New Member
I don't want to code it, even if I code it, there's no way of knowing if it's semantically correct or not. So I am asking it here-:
Pure Pursuit Problem
My pseudocode-:
Pure Pursuit Problem
My pseudocode-:
Code:
Read the following-:
a) Bomber's path xb(t), yb(t) for t=0,1,2...12
b) initial position of fighter xf(0) and yf(0)
c) fighter's velocity vf
while(1)
{
dist(t)=sqrt((xb(t)-xf(t))²+(yb(t)-yf(t))²)
if dist<=10kms=>print target caught at time "t"mins and distance "dist" kms=>stop
else if t>11=>print "target escaped"=>stop
else
cos(th)=[yb(t)-yf(t)]/[dist(t)]
sin(th)=[xb(t)-xf(t)]/[dist(t)]
t=t+1
xf(t)=xf(t)+vf*cos(th)
yf(t)=yf(t)+vf*sin(th)
}