K
KBH
- Jan 1, 1970
- 0
KBH said:KBH Code:
{The rabbit at the center of a 10 radius circular pond and the chasing
agent
is at the edge of the pond.}
Var
ads, nag, eag, rba, rbn, rbe, nd, ed, dgr, dst: double;
flg: integer;
Procedure D;
Begin
If (flg = 1) Then
Begin
{Procedure E}
rba:= rba + Pi;
Exit;
End;
rba:= rba + (Pi * 2);
{The structure of procedures D, E, & F are from the KBH Survey Progam for
the HP35S}
End;
Procedure F;
Begin
If (flg = 1) Then Exit;
rba:= rba + Pi;
End;
begin
{KBH Code}
flg:= 0;
rbn:= 10;
rbe:= 10;
dgr:= 1;
While (dgr < 361) Do {Change value for desired output range}
Begin
ads:= (dgr * Pi) / 180;
nag:= 10 + (Cos(ads) * 10);
eag:= 10 + (Sin(ads) * 10);
nd:= rbn - nag;
If (nd = 0) Then nd:= 0.000000000001;
ed:= rbe - eag;
If (ed >= 0) Then flg:= 1;
rba:= ArcTan(ed / nd);
If (rba < 0.000000000001) Then D Else F;
rbn:= rbn + (Cos(rba) * 0.043633231);
rbe:= rbe + (Sin(rba) * 0.043633231);
dst:= Sqrt(Sqr(10 - rbn) + Sqr(10 - rbe));
rba:= (rba / Pi) * 180;
WriteLn(rbn:15:4, rbe:15:4, dgr:15:4, dst:15:4);
dgr:= dgr + 1;
flg:= 0;
End;
ReadLn;
end.
And the above KBH code runs in Delphi Console Mode...
Now the rabbit gets out at North and East coordinates of 8.1332 , 0.1612
while the agent is at an azimuth of 535 degrees on the edge of the
circular
pond and on his second trip around the pond. Of course this is a
systematic
method only...
And here is the KBH Scratch Plot file for the rabbit path:
663&137@F+wtN0E0
41&759@S+wtN20E20
0
352&448@P+bkN10E10
353&...@L+rdN9.9564E9.9992
365&...@L+rdN9.5661E9.9588
378&...@L+rdN9.1452E9.8458
390&...@L+rdN8.7477E9.6669
402&...@L+rdN8.3826E9.4288
412&...@L+rdN8.0572E9.1387
421&...@L+rdN7.7774E8.8044
428&...@L+rdN7.5477E8.4338
433&...@L+rdN7.3716E8.0349
437&...@L+rdN7.2515E7.6158
439&...@L+rdN7.1886E7.1844
439&...@L+rdN7.1834E6.7484
437&...@L+rdN7.2357E6.3155
434&...@L+rdN7.3441E5.8932
429&...@L+rdN7.5067E5.4886
422&...@L+rdN7.7209E5.1089
414&...@L+rdN7.9834E4.7607
405&...@L+rdN8.2899E4.4506
394&...@L+rdN8.6357E4.1851
382&...@L+rdN9.0151E3.9703
369&...@L+rdN9.4215E3.8124
356&...@L+rdN9.8469E3.7173
343&...@L+rdN10.2819E3.6911
329&...@L+rdN10.7150E3.7398
316&...@L+rdN11.1311E3.8687
305&...@L+rdN11.5107E4.0819
295&...@L+rdN11.8285E4.3792
289&...@L+rdN12.00538E4.7515
285&...@L+rdN12.1525E5.1743
286&...@L+rdN12.1075E5.6063
292&...@L+rdN11.9231E5.9996
301&...@L+rdN11.6270E6.318
312&...@L+rdN11.2554E6.5445
325&...@L+rdN10.8406E6.6769
339&...@L+rdN10.4072E6.7212
352&...@L+rdN9.9729E6.6856
365&...@L+rdN9.5502E6.5793
378&...@L+rdN9.1482E6.4106
390&...@L+rdN8.7736E6.1875
400&...@L+rdN8.4315E5.9171
410&...@L+rdN8.1258E5.6061
418&...@L+rdN7.8594E5.2609
425&...@L+rdN7.6345E4.8873
431&...@L+rdN7.4526E4.4909
435&...@L+rdN7.3148E4.0771
438&...@L+rdN7.2216E3.6511
439&...@L+rdN7.1730E3.2176
440&...@L+rdN7.1687E2.7815
438&...@L+rdN7.2079E2.3471
436&...@L+rdN7.2895E1.9186
432&...@L+rdN7.4120E1.5
427&...@L+rdN7.5736E1.0949
421&...@L+rdN7.7720E.7064
414&...@L+rdN8.0048E0.3376
410&...@L+rdN8.1332E0.1612
352&448@P+bkN10E10
41&...@P+blN19.9985E10.1745
352&448@+blN10E10
45&...@P+blN19.8481E11.7365
352&448@+blN10E10
59&...@P+blN19.3969E13.4202
352&448@+blN10E10
82&...@P+blN18.6603E15.0000
352&448@+blN10E10
113&...@P+blN17.6604E16.4279
352&448@+blN10E10
152&...@P+blN16.4279E17.6604
352&448@+blN10E10
196&...@P+blN15.0000E18.6603
352&448@+blN10E10
245&...@P+blN13.4202E19.3969
352&448@+blN10E10
297&...@P+blN11.7365E19.8481
352&448@+blN10E10
352&...@P+blN10.0000E20.0000
352&448@+blN10E10
406&...@P+blN8.2635E19.8481
352&448@+blN10E10
458&...@P+blN6.5798E19.3969
352&448@+blN10E10
507&...@P+blN5.0000E18.6603
352&448@+blN10E10
551&...@P+blN3.5721E17.6604
352&448@+blN10E10
590&...@P+blN2.3396E16.4279
352&448@+blN10E10
621&...@P+blN1.3397E15.0000
352&448@+blN10E10
644&...@P+blN0.6031E13.4202
352&448@+blN10E10
658&...@P+blN0.1519E11.7365
352&448@+blN10E10
663&...@P+blN0.0000E10.0000
352&448@+blN10E10
658&...@P+blN0.1519E8.2635
352&448@+blN10E10
644&...@P+blN0.6031E6.5798
352&448@+blN10E10
621&...@P+blN1.3397E5.0000
352&448@+blN10E10
590&...@P+blN2.3396E3.5721
352&448@+blN10E10
551&...@P+blN3.5721E2.3396
352&448@+blN10E10
507&...@P+blN5.0000E1.3397
352&448@+blN10E10
458&...@P+blN6.5798E0.6031
352&448@+blN10E10
406&...@P+blN8.2635E0.1519
352&448@+blN10E10
352&...@P+blN10.0000E0.0000
352&448@+blN10E10
297&...@P+blN11.7365E0.1519
352&448@+blN10E10
245&...@P+blN13.4202E0.6031
352&448@+blN10E10
196&...@P+blN15.0000E1.3397
352&448@+blN10E10
152&...@P+blN16.4279E2.3396
352&448@+blN10E10
113&...@P+blN17.6604E3.5721
352&448@+blN10E10
82&...@P+blN18.6603E5.0000
352&448@+blN10E10
59&...@P+blN19.3969E6.5798
352&448@+blN10E10
45&...@P+blN19.8481E8.2635
352&448@+blN10E10
51&448@Agent->+blN19.65E10
352&463@Rabbit Begins Here+rdN10E10.5
352&448@P+bkN10E10
661&...@P+blN0.0381E10.8716
599&...@L+blN2.0381E10.8716
597&475@Agent Stops Here on 2nd Loop+blN2.1E10.88
Copy to a text file, save the text file as "Name.plt" with quotation
marks,
and the file will run in KBH Scratch Plot...
And the rabbit path is a small-cap handwritten-style "e"...
Dave wrote:
I've totally lost track of what you are trying to do. Can you recap,
and possibly post the graph on the web and give us the link?
KBH wrote:
But you replied to the final version and thanks for that...
Now...with each step of the agent around the circle...the rabbit moves on a
line from the agent to the rabbit and away from the agent. So just say that
the rabbit turns away from each new position of the agent. And the rabbit
moves one-fourth the distance that the agent moves...each time that the
rabbit turns away.
And this is a systematic method. The agent keeps moving around the circle
and the rabbit keeps turning away...
The graphics that I have is a coordinate plot and not an animation movement.
But you can find Scratch Plot with google, download it in ten seconds,
install it, and make a file for it with the above data. And the rabbit path
is really nice looking...and I think it has a point to make.
Now with the rabbit path you can scale a tangent line off the path at any
point...knowing that the path runs away from the opposite side...and see
which agent point on the circle produced the rabbit path at that rabbit path
point.