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

What values do latDiff & lonDiff have. Since they're integers, you're using integer division and apparently getting zero. Try casting them to float when you do the division.