l5kit.geometry.angle module¶
- l5kit.geometry.angle.angle_between_vectors(v1: numpy.ndarray, v2: numpy.ndarray) float ¶
angle_between_vectors returns the angle in radians between two vectors.
- Parameters
v1 (np.ndarray) – Vector 1 of shape (N)
v2 (np.ndarray) – Vector 2 of same shape as
v1
- Returns
angle in radians
- Return type
float
- l5kit.geometry.angle.angular_distance(angle_a: Union[float, numpy.ndarray], angle_b: Union[float, numpy.ndarray]) Union[float, numpy.ndarray] ¶
A function that takes two arrays of angles in radian and compute the angular distance, wrap the angular distance such that they are always in the [-pi, pi) range.
- Parameters
angle_a (np.ndarray, float) – first array of angles in radians
angle_b (np.ndarray, float) – second array of angles in radians
- Returns
angular distance in radians between two arrays of angles
- l5kit.geometry.angle.compute_yaw_around_north_from_direction(direction_vector: numpy.ndarray) float ¶
compute_yaw_from_direction computes the yaw as angle between a 2D input direction vector and the y-axis direction vector (0, 1).
- Args:
direction_vector (np.ndarray): Vector of shape (2,)
- Returns:
float: angle to (0,1) vector in radians