implementation of polygon filling algorithm in c