Analysis of the nicholl-lee-nicholl algorithm

  • Authors:
  • Frank Dévai

  • Affiliations:
  • London South Bank University, London, UK

  • Venue:
  • ICCSA'05 Proceedings of the 2005 international conference on Computational Science and its Applications - Volume Part I
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

The algorithm proposed by Nicholl, Lee and Nicholl (Computer Graphics21,4 pp 253–262) for clipping line segments against a rectangular window in the plane is proved to be optimal in terms of the minimum and maximum number of comparisons and the number of predicates used. It is also demonstrated that, due to its overhead, the algorithm in its compact form is slightly slower than simple algorithms. Though Nicholl et al proposed program-transformation techniques to expand the code to exploit the full potential of the algorithm, in some cases it takes more operations than simple algorithms, e.g., two intersections and three predicates instead of four intersections. While the algorithm is optimal on its own terms, it solves the clipping problem with the added restriction that only valid intersections are allowed to be calculated.