sub isCorrectPath () { my ($x1, $y1, $x2, $y2, $x, $y) = @_; return !(($x2-$x1)*($y-$y1)-($x-$x1)*($y2-$y1)); }