Geography 489/555

Lab 1

(Due Thursday February 27)

Write a program that includes a procedure (module; subroutine) that tests whether two straight line segments (defined by their end points) intersect. It should determine (return) both

Test the program and run it for the following five pairs of line segments:

A: (4,2), (2,0); (4,0),(0,4)

B: (1,0), (1,4); (0,2), (3,3)

C: (1,4), (5,2); (0,-1), (2,3)

D: (1,0), (3,2); (4,3), (6,5)

E: (0,4), (2,2); (2,2), (4,1)

Hand in the program listing, the test data, and the output.