I have this function in Python that calculate distance from a point with bearing. Problem is the latitude part is generating the wrong answer and i cannot figure out where i went wrong:
def add_distance(self, lat, lon, bearing, distance):
d = distance/6371
x = sin(lat) * cos(d) + cos(lat) * sin(d) * cos(bearing)
new_lat = asin( float(x) )
new_lon = lon + atan2(sin(bearing)*sin(distance/6371)*cos(lat),
cos(distance/6371)-sin(lat)*sin(new_lat))
print '\tNew Lat:%s' % (new_lat )
print '\tNew Lon:%s' % new_lon
return ''
print
statements do not convert radians back to degrees, it seems unlikely that you converted the inputs to radians to start.