Perl implementation of chaikin's 2D algorithum