Haloarcula marismortui has been described to be nonmotile prior to the recent identification of flagellar filaments, suggesting the motile nature of H. marismortui. Here we observed the locomotion of freshly cultured H. marismortui cells and tracked the swimming trajectories via ImageJ. Trajectories of H. marismortui are intrinsically noisy, posing difficulties in motion analysis with previously established algorithms. By introducing the concept of "window vector," a Microsoft Excel-VBA-implemented microbial motion analysis algorithm reported here was able to (1) discriminate nonswimming objects from swimming cells without empirical customization by applying a power-law relationship and (2) reduce the noise caused by Brownian motion, thus enhancing the accuracy of swim reversal identification. Based on this motion analysis algorithm, two recently identified sensory rhodopsins, HmSRI and HmSRII, were shown to mediate photoattractant and photorepellent responses, respectively, revealing the phototactic activity of H. marismortui, the only archaeon showing such phenomenon other than Halobacterium salinarum.