agentsociety.environment.utils.map_utils¶
Module Contents¶
Functions¶
Given two points (start_point and end_point) defining a line, and a distance s to travel along the line, return the coordinates of the point reached after traveling s units along the line, starting from start_point. |
|
API¶
- agentsociety.environment.utils.map_utils.get_angle(x, y)¶
- agentsociety.environment.utils.map_utils.point_on_line_given_distance(start_node, end_node, distance)¶
Given two points (start_point and end_point) defining a line, and a distance s to travel along the line, return the coordinates of the point reached after traveling s units along the line, starting from start_point.
Args: start_point (tuple): tuple of (x, y) representing the starting point on the line. end_point (tuple): tuple of (x, y) representing the ending point on the line. distance (float): Distance to travel along the line, starting from start_point.
Returns: tuple: tuple of (x, y) representing the new point reached after traveling s units along the line.
- agentsociety.environment.utils.map_utils.get_key_index_in_lane(nodes: list[dict[str, float]], distance: float, direction: Union[Literal[front], Literal[back]]) int¶