There is a loop of is it close enough or not something like that. It is a brute force. Atan2 purely looks like that to me.