You may assume that the user enters convex polygons (that is, you need not check them before/while doing the clipping).

Some links to billiards references: