1

I am trying to find spots that block a circle (a,b,R) on a map, the problem is that coordinates used on the map are translated to different metric values as longitude changes. i know it has something to do with radians. this is the code with the missing part:

class Circle(object):
    def __init__(self,x,y,R):   
        self.x = x #Degrees
        self.y = y #Degrees
        self.R = R #meters

    def getRatio(self,x,y):     
        #This is where the magic happens...
        return latRatio, LatRatio


    def getBlockingSquareCords(self):
        latRation, lonRatio = getLonRatio(x,y)
        latD = self.R/latRatio
        lonD = self.R/lonRatio

        x1 = self.x+latD
        y1 = self.y+lonD

        x2 = self.x-latD
        y2 = self.y-lonD

        return (x1,y1,x2,y2)

this following question has some hints to the answer, but i couldn't figure it out -Calculate distance between two latitude-longitude points? (Haversine formula)

Community
  • 1
  • 1
Mr. Nun.
  • 775
  • 11
  • 29

1 Answers1

4

It does depend only on latitude (because the circles are getting smaller when you move towards poles).

Latitude:  1 deg = 110.54 km
Longitude: 1 deg = 111.320*cos(latitude) km
Andrey
  • 59,039
  • 12
  • 119
  • 163
  • @NadavNuni no, degrees. Do you know the difference between radiant and degree? – Andrey May 26 '14 at 21:54
  • I believe so, actually i have already got my code working with your help. i have used radiants in the cos function, but i have just realized that it does not matter :) – Mr. Nun. May 28 '14 at 08:12