Britbot
static Direction Britbot.Navigator.CalculateDirectionToMovingTarget ( Location  myLoc,
HeadingVector  myHeading,
Location  target,
HeadingVector  targetHeading 
) [inline, static]

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.

Parameters:
myLoclocation of the one asking for directions
myHeadingdirection vector of the one looking for direction
targetthe location of the moving target
targetHeadingdirection vector of the moving target
Returns:

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);
        }