def angle_yaw(lat1, long1, lat2, long2): dLon = long2 - long1 y = numpy.sin(dLon) * numpy.cos(lat2) x = numpy.cos(lat1) * numpy.sin(lat2) - numpy.sin(lat1) * \ numpy.cos(lat2) * numpy.cos(dLon) brng = numpy.atan2(y, x) brng = numpy.toDegrees(brng) brng = (brng + 360) % 360 brng = 360 - brng """ count degrees counter-clockwise - remove to make clockwise """ return brng
x = t0 * t3 * t4 - t1 * t2 * t5 y = t0 * t2 * t5 + t1 * t3 * t4 z = t1 * t2 * t4 - t0 * t3 * t5 return [w, x, y, z] def angle_yaw(lat1, long1, lat2, long2): dLon = long2 - long1 y = numpy.sin(dLon) * numpy.cos(lat2) x = numpy.cos(lat1) * numpy.sin(lat2) - numpy.sin(lat1) * numpy.cos(lat2) * numpy.cos(dLon) brng = numpy.atan2(y, x) brng = numpy.toDegrees(brng) brng = (brng + 360) % 360 brng = 360 - brng; """ count degrees counter-clockwise - remove to make clockwise """ return brng with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: client_socket.connect(SERVER_ADDR) # connect to server msg = client_socket.recv(126) # get message from server print("resp from server : {}".format(msg)) # print message from server client_socket.close() msg = str(msg) locations = msg.split('\'') locations = locations[1] locations = locations.split('/')