Content deleted Content added
m Since we refered about 'inside' of and edge, then it should write 'left of the line', not 'right of the line'. left means inside, while right means outside. |
Testing if a point lies to the right or left of a line is implemented with a cross product. The dot product is commutative. |
||
Line 32:
done
The vertices of the clipped polygon are to be found in ''outputList'' when the algorithm terminates. Note that a point is defined as being ''inside'' an edge if it lies on the same side of the edge as the remainder of the polygon. If the vertices of the clip polygon are consistently listed in a clockwise direction, then this is equivalent to testing whether the point lies to the left of the line (left means ''inside'', while right means ''outside''), and can be implemented simply by using a [[
''ComputeIntersection'' is a trivial function, omitted here for clarity, which returns the intersection of a line segment and an infinite edge. Note that it is only called if such an intersection is known to exist, and hence can simply treat both lines as being infinitely long.
|