I wonder if this is really needed. Could you just compare: || data.dy > data.dx