def adjust_position(self): # Vector addition self.displacementVector = self.CLOCK_INTERVAL * standardcalc.Vector2D.create_from_angle( self.boatData.cog, self.boatData.sog) self.boatData.gps_coord.lat, self.boatData.gps_coord.long = standardcalc.shift_coordinates( self.boatData.gps_coord.lat, self.boatData.gps_coord.long, self.displacementVector) self.arrivedAtPointFlag = self.arrivedAtPoint()
def adjust_position(self): # Vector addition self.displacement = self.CLOCK_INTERVAL * self.boatVector # self.currentData['latitude'], self.currentData['longitude'] = standardcalc.shift_coordinates( # self.currentData['latitude'], # self.currentData['longitude'], # self.displacement) self.boatData.gps_coord.lat, self.boatData.gps_coord.long = standardcalc.shift_coordinates( self.boatData.gps_coord.lat, self.boatData.gps_coord.long, self.displacement )
def testShiftCoordinates(self): displacement = standardcalc.Vector2D.create_from_angle(30, 1000000) latitude, longitude = standardcalc.shift_coordinates(53.0, 40.0, displacement) self.assertAlmostEqual(latitude, 60.5, delta=0.2) self.assertAlmostEqual(longitude, 49.1, delta=0.2)
def testShiftCoordinates(self): displacement = standardcalc.Vector2D.create_from_angle(30, 1000000) latitude, longitude = standardcalc.shift_coordinates( 53.0, 40.0, displacement) self.assertAlmostEqual(latitude, 60.5, delta=0.2) self.assertAlmostEqual(longitude, 49.1, delta=0.2)