Girish Mahajan (Editor)

Cyrus–Beck algorithm

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

The Cyrus–Beck algorithm is a generalized line clipping algorithm. It was designed to be more efficient than the Sutherland–Cohen algorithm which uses repetitive clipping. Cyrus–Beck is a general algorithm and can be used with a convex polygon clipping window unlike Sutherland-Cohen that can be used only on a rectangular clipping area.

Here the parametric equation of a line in the view plane is:

p ( t ) = t p 1 + ( 1 t ) p 0 = p 0 + t ( p 1 p 0 )

where 0 t 1 .

Now to find intersection point with the clipping window we calculate value of dot product. Let pE be a point on the clipping plane E.

Calculate n ( p ( t ) p E ) .

Here n stands for normal of the current clipping plane (pointed away from interior).

By this we select the point of intersection of line and clipping window where (dot product = 0 ) and hence clip the line.

References

Cyrus–Beck algorithm Wikipedia