def _calc_angle_to_turn(self, x1, y1, x2, y2, x3, y3): if x1 is None or y1 is None: # No prev node (initial alignment) v_a = [1, 0] v_b = [(x3 - x2), (y3 - y2)] node_heading = utils.angle_bw_vectors(v_a, v_b) user_heading = self._get_user_heading(timestamp=utils.now()) return utils.normalize_360(node_heading - user_heading) else: v_a = [(x2 - x1), (y2 - y1)] v_b = [(x3 - x2), (y3 - y2)] return utils.angle_bw_vectors(v_a, v_b)
def _convert_heading_to_horizontal_axis(self, heading): return normalize_360(90 - self.map_north - heading)