예제 #1
0
 def rotate(self, dhdg, loc, tile):
     assert loc and tile
     (lat, lon) = loc
     h = atan2(self.lon - lon, self.lat - lat) + radians(dhdg)
     l = hypot(self.lon - lon, self.lat - lat)
     self.lon = max(tile[1], min(tile[1] + 1, round2res(lon + sin(h) * l)))
     self.lat = max(tile[0], min(tile[0] + 1, round2res(lat + cos(h) * l)))
예제 #2
0
 def rotate(self, dhdg, loc, tile):
     assert loc and tile
     (lat,lon) = loc
     h = atan2(self.lon-lon, self.lat-lat) + radians(dhdg)
     l = hypot(self.lon-lon, self.lat-lat)
     self.lon = max(tile[1], min(tile[1]+1, round2res(lon + sin(h) * l)))
     self.lat = max(tile[0], min(tile[0]+1, round2res(lat + cos(h) * l)))
예제 #3
0
 def rotate(self, dhdg, loc, tile):
     Node.rotate(self, dhdg, loc, tile)
     (lat,lon) = loc
     if self.bezlon or self.bezlat:
         h = atan2(self.bezlon, self.bezlat) + radians(dhdg)
         l = hypot(self.bezlon, self.bezlat)
         self.bezlon = round2res(sin(h) * l)
         self.bezlat = round2res(cos(h) * l)
     if not self.split:
         self.bz2lon = -self.bezlon
         self.bz2lat = -self.bezlat
     elif self.bz2lon or self.bz2lat:
         h = atan2(self.bz2lon, self.bz2lat) + radians(dhdg)
         l = hypot(self.bz2lon, self.bz2lat)
         self.bz2lon = round2res(sin(h) * l)
         self.bz2lat = round2res(cos(h) * l)
예제 #4
0
 def rotate(self, dhdg, loc, tile):
     Node.rotate(self, dhdg, loc, tile)
     (lat, lon) = loc
     if self.bezlon or self.bezlat:
         h = atan2(self.bezlon, self.bezlat) + radians(dhdg)
         l = hypot(self.bezlon, self.bezlat)
         self.bezlon = round2res(sin(h) * l)
         self.bezlat = round2res(cos(h) * l)
     if not self.split:
         self.bz2lon = -self.bezlon
         self.bz2lat = -self.bezlat
     elif self.bz2lon or self.bz2lat:
         h = atan2(self.bz2lon, self.bz2lat) + radians(dhdg)
         l = hypot(self.bz2lon, self.bz2lat)
         self.bz2lon = round2res(sin(h) * l)
         self.bz2lat = round2res(cos(h) * l)