Detecting and changing Handheld Orientation
Ok check it on your smartphone vertically, upside down, or horizontally

The handheld is landscape - counter clockwise

The handheld is landscape - clockwise

The handheld is in portrait mode

The handheld is upside down.