I am dealing with a general rotation function to use in my programs. I use atan2(y, x) function to get angles. Since the origin is at top left on my Nexus S, I actually use atan2(-y, x) to get correct results in atan2. Otherwise I get wrong direction for rotation. For example, moving from P0(5,1) to P1(1, 5) is clockwise in my android and counterclockwise in a normal quadrant.
My assumption is that the origin is at top left in all Android devices. Is it correct?
Yes, the origin is always in the top left corner in screen space. This has historical reasons, as screen space calculations started when television sets were used as screens. The raster gun of a TV starts at the top left corner, so this was accepted as the origin.
There are some notable exceptions from the rule (though not for android devices) – cocoa interfaces seem to have their origin in the bottom left corner.