# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405
r"""
Circle geometry queries.

Provides circle-circle and circle-rectangle intersection detection,
line-segment-vs-circle intersection points, circle-rectangle full-containment
checks, line-segment-vs-circle intersection, and point projection onto a
circle's circumference.
"""

from raygeo.geo import types
import typing
__all__ = [
    "does_circle_intersect_rect",
    "find_tangent_circle_centers",
    "get_circle_circle_intersections",
    "get_line_circle_intersections",
    "is_circle_inside_rect",
    "line_segment_intersects_circle",
    "nearest_tangent_circle_on_polyline",
    "project_point_onto_circle",
]

def does_circle_intersect_rect(center: types.Point, radius: float, rect: types.Rect) -> bool:
    r"""
    Check if a circle intersects a rectangle.
    
    :param center: Circle center (x, y).
    :param radius: Circle radius.
    :param rect: Rectangle (x_min, y_min, x_max, y_max).
    :returns: True if the circle intersects the rectangle.
    :complexity: O(1) time, O(1) space
    """

def find_tangent_circle_centers(pass_through: types.Point, seg_a: types.Point, seg_b: types.Point, radius: float) -> list[tuple[types.Point, types.Point]]:
    r"""
    Find circle centres that pass through a point and are tangent to a segment.
    
    :param pass_through: Point the circle must pass through (x, y).
    :param seg_a: Start of the tangent segment (x, y).
    :param seg_b: End of the tangent segment (x, y).
    :param radius: Circle radius.
    :returns: List of (centre, tangent_point) pairs.
    :complexity: O(1) time, O(1) space
    """

def get_circle_circle_intersections(c1: types.Point, r1: float, c2: types.Point, r2: float) -> types.Polygon:
    r"""
    Get intersection points of two circles.
    
    :param c1: Center of first circle (x, y).
    :param r1: Radius of first circle.
    :param c2: Center of second circle (x, y).
    :param r2: Radius of second circle.
    :returns: List of intersection points (x, y).
    :complexity: O(1) time, O(1) space
    """

def get_line_circle_intersections(p1: types.Point, p2: types.Point, center: types.Point, radius: float) -> types.Polygon:
    r"""
    Get intersection points of a line segment with a circle.
    
    :param p1: Start point of the line segment (x, y).
    :param p2: End point of the line segment (x, y).
    :param center: Circle center (x, y).
    :param radius: Circle radius.
    :returns: List of intersection points (x, y).
    :complexity: O(1) time, O(1) space
    """

def is_circle_inside_rect(center: types.Point, radius: float, rect: types.Rect) -> bool:
    r"""
    Check if a circle is inside a rectangle.
    
    :param center: Circle center (x, y).
    :param radius: Circle radius.
    :param rect: Rectangle (x_min, y_min, x_max, y_max).
    :returns: True if the circle is fully inside the rectangle.
    :complexity: O(1) time, O(1) space
    """

def line_segment_intersects_circle(p1: types.Point, p2: types.Point, circle_center: types.Point, circle_radius: float) -> bool:
    r"""
    Check if a line segment intersects a circle.
    
    :param p1: Start point of the line segment (x, y).
    :param p2: End point of the line segment (x, y).
    :param circle_center: Circle center (x, y).
    :param circle_radius: Circle radius.
    :returns: True if the line segment intersects the circle.
    :complexity: O(1) time, O(1) space
    """

def nearest_tangent_circle_on_polyline(point: types.Point, polyline: types.Polygon, radius: float, from_end: bool, containment: types.Polygon) -> typing.Optional[tuple[types.Point, types.Point, int]]:
    r"""
    Find nearest circle through a point tangent to a polyline.
    
    Searches segments of *polyline* for a circle of *radius* that
    passes through *point*, is tangent to a segment, and has its
    centre inside *containment*.  Returns the one whose tangent point
    is closest to the searched end.
    
    :param point: Point the circle must pass through (x, y).
    :param polyline: Polyline segments to search.
    :param radius: Circle radius.
    :param from_end: True to search from last vertex; False from first.
    :param containment: Centre must be inside this polygon.
    :returns: (centre, tangent_point, segment_index) or None.
    """

def project_point_onto_circle(point: types.Point, center: types.Point, radius: float) -> typing.Optional[types.Point]:
    r"""
    Project a point onto a circle.
    
    :param point: Point to project (x, y).
    :param center: Circle center (x, y).
    :param radius: Circle radius.
    :returns: Projected point on the circle (x, y).
    :complexity: O(1) time, O(1) space
    """

