Spec for atan2 should be atan2(Y, X), not atan2(X, Y)