54 EARTH_RADIUS = 6371008.0
62 firstLetter = string[0]
63 if firstLetter ==
'N' or firstLetter ==
'E':
65 elif firstLetter ==
'S' or firstLetter ==
'W':
68 lessString = string.strip(
"NSEW ")
70 values = lessString.split(
'-', 2)
76 decimal = a*(d+(m/60.0)+(s/3600.0))
85 def meter_convert(originLat, originLong, originAlt, newLat, newLong, newAlt):
88 crossRadius = cos(originLat*pi/180.0)*EARTH_RADIUS
90 GPSdestination = [newLat, newLong, -newAlt]
93 latChange = ((newLat - originLat)*pi/180.0)*EARTH_RADIUS
95 longChange = ((newLong - originLong)*pi/180.0)*crossRadius
97 altitudeChange = newAlt - originAlt
100 distance = sqrt(pow(latChange, 2.0) + pow(longChange, 2.0) + pow(altitudeChange, 2.0))
103 destination = [latChange, longChange, newAlt, distance]
113 def to_meters(originLat, originLong, originAlt, newLat, newLong, newAlt, flag):
117 originAlt = .305*originAlt
120 GPSorigin = [originLat, originLong, originAlt]
121 GPSdestination = [newLat, newLong, newAlt]
123 values = [str(originLat), str(originLong), str(newLat), str(newLong)]
127 if (
"N" in value)
or (
"S" in value)
or (
"E" in value)
or (
"W" in value) == 1:
134 newValues.append(float(value))
136 destination =
meter_convert(newValues[0], newValues[1], originAlt, newValues[2], newValues[3], newAlt)
def meter_convert(originLat, originLong, originAlt, newLat, newLong, newAlt)
def decimal_degrees(string)
def to_meters(originLat, originLong, originAlt, newLat, newLong, newAlt, flag)