colour.geometry.intersect_ray_circle_2d#
- colour.geometry.intersect_ray_circle_2d(ray_origin: ArrayLike, ray_direction: ArrayLike, circle_radius: float) NDArrayFloat[source]#
Compute the intersection distance of 2D ray(s) with a circle centred at the origin.
Supports batched inputs: if ray_origin and ray_direction have shape
(..., 2), the result has shape(...).- Parameters:
- Returns:
Distance(s) along the ray to the nearest forward intersection, or
np.nanwhere no forward intersection exists.- Return type:
Examples
>>> intersect_ray_circle_2d([0, 5], [0, 1], 10) 5.0 >>> intersect_ray_circle_2d([0, 15], [0, 1], 10) nan