my $PI = 2 * atan2(1, 0);