clipping algorithms