Skip to main content
. 2022 Oct 17;8(10):286. doi: 10.3390/jimaging8100286
Algorithm 1: Function to determine the outcode of the endpoints.

function CODE(x);

begin

        c := [0000];

        if x < xminthenc := [1000]

               else if x > xmaxthenc := [0100];

        if y < yminthenc := c lor [1001]

               else if y > ymaxthenc := c lor [0010];

        CODE := c

end [CODE];