Main Menu | A-Level Resources Menu | Program Menu
Noel Dornan, Ballymena Academy
Peter McPolin, St. Mary’s College of Education, Belfast
This program models the motion of two particles A and B travelling with constant velocities in the x-y plane. It consists of two sub-programs: the first calculates the distance and time of closest approach of the two particles, each moving with a given constant velocity; the second part calculates the bearing of particle A that is required for interception with B, or failing that, of closest approach with B.
When REVEL is run the main menu is displayed, showing the two sub-programs:- see below.

The following input convention holds for both programs:
The velocity of a particle is specified by giving its speed (
0)
and its direction of travel as a bearing
from some arbitrary fixed direction (0
360°).
The initial (time t = 0) relative position of B with respect to A is specified
by giving the distance S between them and specifying the bearing of the
direction A
B. The speeds and distance are assumed to be in consistent units.
Below is a description of each program in detail:
1. CLOSE APPROACH
The program prompts the user to enter the velocities of A and B as well as the relative position of B with respect to A. It will then output the distance and time of closest approach.
The following is an example input screen:- see below left.


Pressing the [ENTER] key after the last input gives the output screen on the above right.
If the particles follow diverging paths the closest approach distance will be their initial separation occurring at time t = 0, e.g.


2. INTERCEPTION
This time the program prompts the user to input the speed of particle
A together with the velocity of B and the direction A
B - the actual initial distance S between A and B is not required. There
will then be three types of output depending on the values of these input
parameters.
Case 1
Interception is certainly possible if the speed of A is greater than that of B. n this case the program will output the direction of motion that A should follow so as to achieve this.
When the speed of A is less than or equal to that of B there are two possibilities:
Case 2
Interception is possible along two different courses for A. The program will output both of these.
Case 3
Interception is not possible. In this case the program will calculate the direction of motion that A should follow so as to get as close as possible to B. This direction will then be outputted.
Below are three example inputs together with their corresponding output screens illustrating the three cases above:
Case 1 example


Case 2 example


Case 3 example


(Click on names to view listing)
The program uses 1318 bytes of program memory. The main program
is RELVEL which displays the main menu. The closest
approach program is RELVEL1. In this program
the speeds of A and B are held in the variables U and V respectively, while
their directions of travel are held in the variables A and B. The output
shortest distance and time are stored in Y and Z respectively. The interception
program is RELVEL2. In this program the speeds
of A and B are held in the variables A and B respectively, while B’s direction
of travel is stored in the variable C.
Instructions for downloading at the Texas Program Archive.