|
Britbot
|
This function calculates the directions to a moving target it does so by solving the intersection point equation as appears in calculation sheet 1 and then using the above CalculateDirectionToStationeryTarget i am very likely to be wrong here.
Definition at line 91 of file Navigator.cs. {
//defining parameters for calculation (see image 1 under calculations)
double a = targetHeading.Norm1();
double b = target.Col - myLoc.Col;
double c = targetHeading.X;
double d = target.Row - myLoc.Row;
double e = targetHeading.Y;
//calculating r, hopefully
double r = Navigator.SolveStupidEquation(a, b, c, d, e);
//finally, calculating the intersection point
Location intersection = HeadingVector.AddvanceByVector(target, r * targetHeading);
//returning path to intersection
return Navigator.CalculateDirectionToStationeryTarget(myLoc, myHeading, intersection);
}
|
1.7.6.1