Problem with angles between lat and longitudes when using the atan function

Casting them to float did the trick!
Thank you so much, not sure I ever would've tried that.