A method for performing a high-performance closed-form single-scan calculation of oblong-shape rotation angles from binary images of arbitrary size on a processor using running sums is disclosed. Running sums are calculated and stored throughout each scan, and the results are obtained in closed form by simple post-scan computation. An algorithmic embodiment may execute on one or more hardware processors with limited or constrained computation power, available instruction cycles, available memory, etc. Exemplary hardware processors are found in one or more CPUs of a desktop, laptop, tablet, or handheld computing device, and may be an embedded processor or a signal processor chip. The resulting method may be used for touch or optical user interfaces, real-time image recognition, real-time machine vision, and other purposes.