DATA

REQUIRED
Info The speed at which the target is moving.
Info The current direction from your detachment towards the target.
Info The direction in which the target is currently moving.
Info The current distance from your detachment to the target.
OPTIONAL
Info The total distance the target intends to travel.
Info The time within which you wish to intercept the target.

INTERCEPT

Waiting for Data

VISUAL

How to use

Introduction

Greetings, brave Tarkhan.

Decoded a radio message and uncertain about the next move? Fret not.

For a successful INTERCEPT, ensure you have the target's location relative to your position, their heading, their speed, and the course length they are currently traveling.

What is this?

This is an intercept calculator for the video game HighFleet. Plug in data provided by radio decoded messages to calculate the intercept course.

Steps

  1. Input your detachment's max speed. This is a required step.
  2. Enter the target's speed. This is mandatory.
  3. Determine the target's direction relative to your compass. Utilize the ruler; click on your position and drag to the target's location to receive this bearing. This step is compulsory.
  4. Input the target's current heading. If the heading is unknown, but you're aware of the target's next city destination, use the ruler. Click on their current position and drag to their next city destination to ascertain the heading. This is an essential step.
  5. Indicate the distance between you and the target. The ruler will assist in gauging this distance. This is a required step.
  6. Optionally, you can specify a desired time for the intercept. This allows you to plan strategically, as patience can often be an advantage. It can be particularly helpful for ensuring a nighttime interception, if needed.
  7. If you have access to the target's course length, you can enter it in the form. This information can be obtained by measuring the distance from the target's starting point to their destination city. Providing this optional input will help determine if your current detachment can reach the target before they change directions.
  8. Click RUN to derive the intercept course. Utilize the results to set your detachment on an intercept trajectory with the target. Remember, if your intercept point is beyond the target's next stop, the intercept will fail. The calculator will notify you if the intercept isn't feasible.

Math Details

1. Intercept Course Calculation:

The intercept course blends your bearing towards the target and the target's heading. This amalgamation helps in determining the optimal heading to successfully intercept the target.

Intercept Course = atan2((targetSpeed * sin(targetHeading)) + (maxSpeed * sin(targetBearing)), 
(targetSpeed * cos(targetHeading)) + (maxSpeed * cos(targetBearing)))

2. Time to Intercept Calculation:

The time to intercept is gauged by dividing the distance to the target by the closing speed. An additional check is done to determine if the interception is possible before the target reaches its destination.

Time to Intercept = targetDistance / closingSpeed

3. Distance to Intercept Calculation:

In scenarios where the desired time to intercept isn't provided, the distance is essentially the path you'd cover, considering your max speed and the time to intercept.

Distance to Intercept = maxSpeed * timeToIntercept

4. Required Speed Calculation:

The required speed depends on the desired time to intercept. If provided, the speed needed to intercept the target within the specified time is calculated. An additional check is added to ensure the required speed doesn't exceed the maximum speed.

Required Speed = Distance to Intercept / desiredTimeToIntercept
Required Speed = Distance to Intercept / timeToIntercept (if desired time isn't specified)

5. Target's Time to Destination Calculation:

The time it takes for the target to reach its destination is computed by dividing the target's course length by its speed. This is important as it ensures that the interception occurs before the target reaches its destination.

Time to Destination = targetCourseLength / targetSpeed

Remember, trigonometric functions in these formulas (like sin, cos, atan2) require angles in radians, not degrees. In the script, I've utilized helper functions to toggle between degrees and radians as necessary.