pygmaps.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:route2map 作者: xuboying 项目源码 文件源码
def getcycle(self,rpoint):
        cycle = []
        lat = rpoint[0]
        lng = rpoint[1]
        rad = rpoint[2] #unit: meter
        d = (rad/1000.0)/6378.8;
        lat1 = (math.pi/180.0)* lat
        lng1 = (math.pi/180.0)* lng

        r = [x*30 for x in range(12)]
        for a in r:
            tc = (math.pi/180.0)*a;
            y = math.asin(math.sin(lat1)*math.cos(d)+math.cos(lat1)*math.sin(d)*math.cos(tc))
            dlng = math.atan2(math.sin(tc)*math.sin(d)*math.cos(lat1),math.cos(d)-math.sin(lat1)*math.sin(y))
            x = ((lng1-dlng+math.pi) % (2.0*math.pi)) - math.pi 
            cycle.append( ( float(y*(180.0/math.pi)),float(x*(180.0/math.pi)) ) )
        return cycle
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号