Cyrus/Beck Overview 1) Do the trivial accept/reject test on each line. For lines that don't get accepted or rejected you will have to clip them 2) We need to clip each boundary (N,S,E,W) with the line. So first, calculate D = , where P0 is the start point, and P1 is the end point of the line. 3) Create your normals, N. N is relative to the clipping edge you're using: North: N = <0,1>; East: N = <1,0>; South: N = <0,-1> ; West: N = <-1,0>. 3) Now, do the t calculation for each clipping edge, using the proper normal, N, that corresponds to its clipping edge. For each edge, first calculate (N dot D). If this is less than zero, then this t value is an entering point. If it's greater than zero, it's a leaving point. If it's equal to zero, then the line is parallel to that clipping edge, and there is no intersection 5) Now calculate the t value for each clip edge: N dot [P0 - Pei] t = ---------------- - [N dot D] where Pei is ANY point on the clip edge being tested. 6) You will have up to 4 t values, one for each edge. Throw out any where t<0 or t>1. They aren't on the line segment. For those that remain, recall that we classified them as entering or leaving points. Remember that N dot D tells you if they are entering or leaving. Take the largest t value for the entering points (PEmax) and the smallest t value for the leaving points (PLmin) and check if: PEmax < PLmin If this is the case, then those 2 t values are the new endpoints of the clipped line. Convert the t values to (x,y) coordinates using the parametric line equation: P(t) = P0(1-t) + P1(t) then send these new endpoints to Bresenham.