function z = atan2dx(y, x)
% atan2d with quadrant symmetries enforced
  q1 = abs(y) > abs(x); t = y(q1); y(q1) = x(q1); x(q1) = t;
  q2 = x < 0; x(q2) = -x(q2);
  q = 2 * q1 + q2;
  z = atan2(y, x) * (180 / pi);         % z in [-45, 45]
  % t = q == 0;             z(t) =      + z(t);
  t = q == 1 & ~signbit(y); z(t) =  180 - z(t);
  t = q == 1 &  signbit(y); z(t) = -180 - z(t);
  t = q == 2;               z(t) =   90 - z(t);
  t = q == 3;               z(t) =  -90 + z(t);
end