I\'m writing a mapping application that I am writing in python and I need to get the lat/lon centroid of N points. Say I have two locations
a.lat = 101 a.lon
If you are averaging angles and have to deal with them crossing the 0/360 then it is safer to sum the sin and cos of each value and then Average = atan2(sum of sines,sum of cosines) (be careful of the argument order in your atan2 function)