Let me see if I understand this.
You have a list of positions a-f. Each of these positions is a two-dimensional (X, Y) location. And each position has an array of range values [q,r,s,t,u,v] where the
value of each variable in the array is the distance to the nearest obstacle in a certain direction, with q=North distance, r=North-East distance, etc around the compass until v=North-West.
There are any number of ways to do this, but the simplest approach that I can think of is to treat the entire movement space as a 2D grid. So,
1: create a 2D array FLOOR. Each (FLOOR[X,Y]) entry in the FLOOR array will contain data on whether that coordinate is obstructed or free.
2: create a 2D array of structure type variables ROBOT_ MAP. Each entry (ROBOT_MAP[X,Y]) will contain the following sub-elements: North-Distance, NorthEast-Distance, etc.
Assuming North is parallel with X+ and West is parallel with Y+, FLOOR[X,Y] will be set by using ROBOT_MAP[X,Y] to determine where obstacles are in FLOOR[]:
FOR X = 1 TO (maximum X dimension of motion space)
FOR Y = 1 to (maximum Y dimension of motion space)
FLOOR[X+ROBOT_MAP[X,Y].North_Distance,Y] = Obstructed
FlOOR[X,Y+ROBOT_MAP[X,Y].East_Distance] = Obstructed
....and so on
NEXT Y
NEXT X
That will map your motion space.
Then, draw a line equation between points ROBOT_MAP[1] and ROBOT_MAP[5]. If for brevity we call [1] A and [5] B, then the distance will be equal to SQRT((A.X-B.X)^2 + (A.Y-B.Y)^2).
So the equation for the line drawn between points A and B would be:
Slant = ((A.Y-B.Y)/(A.X-B.X))
The formula for finding any point along that line would be:
Y = (X*Slant) + (A.Y - (Slant*A.X))
So:
FOR X = 1 TO (max X dimension)
Y = (X*Slant) + (A.Y - (Slant*A.X))
IF FLOOR[X,Y] = Obstructed THEN
...put obstruction handling code here
ENDIF
NEXT X
This is very basic and bare-bones, of course. What your code actually *does* when it finds an obstruction along its projected path becomes very complicated, too much so to cover here.
Try looking here, for one thing:
http://coecsl.ece.uiuc.edu/ge423/spring03/Group7/index.html