Determine the centroid of multiple points

前端 未结 6 1741
甜味超标
甜味超标 2020-12-09 01:01

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         


        
6条回答
  •  借酒劲吻你
    2020-12-09 01:14

    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)

提交回复
热议问题