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

Provides bounding rectangle computation, intersection tests (arc-rect,
arc-circle, arc-polygons), arc linearization into line segments for
rendering or further processing, angle utilities (normalize, direction,
containment), and arc midpoint / closest-point lookups.
"""

import collections.abc
from raygeo.geo import types
import typing
__all__ = [
    "does_arc_intersect_circle",
    "does_arc_intersect_rect",
    "get_arc_angles",
    "get_arc_bounds",
    "get_arc_closest_point",
    "get_arc_direction",
    "get_arc_length",
    "get_arc_midpoint",
    "get_arc_sweep",
    "get_arc_through_point",
    "get_polyline_turn_sign",
    "is_angle_between",
    "is_arc_clockwise",
    "is_arc_inside_polygons",
    "linearize_arc",
    "normalize_angle",
    "normalize_angle_signed",
]

def does_arc_intersect_circle(arc_start: types.Point, arc_end: types.Point, arc_center: types.Point, clockwise: bool, circle_center: types.Point, circle_radius: float) -> bool:
    r"""
    Check if an arc intersects a circle.
    
    :param arc_start: Arc start point (x, y).
    :param arc_end: Arc end point (x, y).
    :param arc_center: Arc center point (x, y).
    :param clockwise: Whether the arc is clockwise.
    :param circle_center: Circle center (x, y).
    :param circle_radius: Circle radius.
    :returns: True if the arc intersects the circle.
    :complexity: O(n) time, O(1) space
    """

def does_arc_intersect_rect(arc_start: types.Point, arc_end: types.Point, arc_center: types.Point, clockwise: bool, rect: types.Rect) -> bool:
    r"""
    Check if an arc intersects a rectangle.
    
    :param arc_start: Arc start point (x, y).
    :param arc_end: Arc end point (x, y).
    :param arc_center: Arc center point (x, y).
    :param clockwise: Whether the arc is clockwise.
    :param rect: Rectangle (x_min, y_min, x_max, y_max).
    :returns: True if the arc intersects the rectangle.
    :complexity: O(n) time, O(1) space
    """

def get_arc_angles(start: types.Point, end: types.Point, center: types.Point, clockwise: bool) -> types.Point3D:
    r"""
    Get the start, end, and sweep angles of an arc.
    
    :param start: Arc start point (x, y).
    :param end: Arc end point (x, y).
    :param center: Arc center point (x, y).
    :param clockwise: Whether the arc is clockwise.
    :returns: Tuple of (start_angle, end_angle, sweep_angle) in radians.
    :complexity: O(1) time, O(1) space
    """

def get_arc_bounds(start: types.Point, end: types.Point, center: types.Point, clockwise: bool) -> types.Rect:
    r"""
    Get the bounding rectangle of an arc.
    
    :param start: Arc start point (x, y).
    :param end: Arc end point (x, y).
    :param center: Arc center point (x, y).
    :param clockwise: Whether the arc is clockwise.
    :returns: Bounding rectangle as (x_min, y_min, x_max, y_max).
    :complexity: O(1) time, O(1) space
    """

def get_arc_closest_point(arc_cmd: typing.Any, start_pos: types.Point3D, x: float, y: float) -> typing.Optional[tuple[float, types.Point, float]]:
    r"""
    Get the closest point on an arc to a given point.
    
    :param arc_cmd: Arc command row or MockArc-like object.
    :param start_pos: Start position (x, y, z).
    :param x: X coordinate of target point.
    :param y: Y coordinate of target point.
    :returns: Tuple of (parameter, closest_point, distance) or None.
    :complexity: O(n) time, O(1) space
    """

def get_arc_direction(center: types.Point, start: types.Point, mouse: types.Point) -> bool:
    r"""
    Get the direction (CW/CCW) of an arc at a mouse point.
    
    :param center: Arc center (x, y).
    :param start: Arc start point (x, y).
    :param mouse: Mouse point (x, y).
    :returns: True if clockwise, False if counter-clockwise.
    :complexity: O(1) time, O(1) space
    """

def get_arc_length(start_pos: types.Point, end_pos: types.Point, center_offset: types.Point, clockwise: bool) -> float:
    r"""
    Compute the arc length of a circular arc.
    
    :param start_pos: Start point (x, y).
    :param end_pos: End point (x, y).
    :param center_offset: Center offset (i, j) from start.
    :param clockwise: True for clockwise, False for counter-clockwise.
    :returns: Arc length.
    :complexity: O(1) time, O(1) space
    """

def get_arc_midpoint(start: types.Point, end: types.Point, center: types.Point, clockwise: bool) -> types.Point:
    r"""
    Get the midpoint of an arc.
    
    :param start: Arc start point (x, y).
    :param end: Arc end point (x, y).
    :param center: Arc center point (x, y).
    :param clockwise: Whether the arc is clockwise.
    :returns: Midpoint (x, y).
    :complexity: O(1) time, O(1) space
    """

def get_arc_sweep(start_angle: float, end_angle: float, clockwise: bool) -> float:
    r"""
    Compute the signed sweep angle for an arc.
    
    Handles direction (CW/CCW) and full-circle detection.
    
    :param start_angle: Start angle in radians.
    :param end_angle: End angle in radians.
    :param clockwise: Whether the arc is clockwise.
    :returns: Signed sweep angle in radians.
    :complexity: O(1) time, O(1) space
    """

def get_arc_through_point(t_start: types.Point, t_end: types.Point, t_mid: types.Point, center: types.Point, radius: float) -> types.Polygon:
    r"""
    Build a circular arc through three points around a centre.
    
    Returns a polyline approximation of the arc from *t_start* to
    *t_end* that passes through *t_mid*, with the given centre and
    radius.
    
    :param t_start: Arc start point (x, y).
    :param t_end: Arc end point (x, y).
    :param t_mid: Point the arc must pass through (x, y).
    :param center: Arc centre (x, y).
    :param radius: Arc radius.
    :returns: Polyline approximation as list of (x, y) points.
    """

def get_polyline_turn_sign(polyline: collections.abc.Sequence[types.Point]) -> float:
    r"""
    Determine the turn direction of a polyline at its midpoint.
    
    Computes the cross product of the edge vectors just before and
    just after the midpoint vertex.  Returns ``+1.0`` for a
    counter-clockwise (left) turn and ``-1.0`` for a clockwise
    (right) turn.
    
    :param polyline: Open polyline as (x, y) points.
    :returns: ``+1.0`` (CCW) or ``-1.0`` (CW).
    :complexity: O(1) time, O(1) space
    """

def is_angle_between(angle: float, start: float, end: float, clockwise: bool) -> bool:
    r"""
    Check if an angle is between two other angles.
    
    :param angle: Angle to test.
    :param start: Start angle.
    :param end: End angle.
    :param clockwise: Whether the arc is clockwise.
    :returns: True if angle is between start and end.
    :complexity: O(1) time, O(1) space
    """

def is_arc_clockwise(points: collections.abc.Sequence[types.Point2DOr3D], center: types.Point2DOr3D) -> bool:
    r"""
    Check if an arc is clockwise.
    
    :param points: Sequence of (x, y) points on the arc.
    :param center: Arc center (x, y).
    :returns: True if the arc is clockwise.
    :complexity: O(n) time, O(1) space
    """

def is_arc_inside_polygons(arc_start: types.Point, arc_end: types.Point, arc_center: types.Point, clockwise: bool, polygons: typing.Any) -> bool:
    r"""
    Check if an arc is inside a set of polygons.
    
    :param arc_start: Arc start point (x, y).
    :param arc_end: Arc end point (x, y).
    :param arc_center: Arc center point (x, y).
    :param clockwise: Whether the arc is clockwise.
    :param polygons: List of polygons to check against.
    :returns: True if the arc is inside all polygons.
    :complexity: O(n * m) time, O(1) space
    """

def linearize_arc(arc_cmd: typing.Any, start_point: types.Point3D, resolution: float = 0.1) -> list[tuple[types.Point3D, types.Point3D]]:
    r"""
    Linearize an arc into line segments.
    
    :param arc_cmd: Arc command row or MockArc-like object.
    :param start_point: Start point (x, y, z).
    :param resolution: Maximum segment length.
    :returns: List of (p1, p2) segment pairs.
    :complexity: O(n) time, O(n) space
    """

def normalize_angle(angle: float) -> float:
    r"""
    Normalize an angle to the range [0, 2*pi).
    
    :param angle: Angle in radians.
    :returns: Normalized angle in [0, 2*pi).
    :complexity: O(1) time, O(1) space
    """

def normalize_angle_signed(angle: float) -> float:
    r"""
    Normalize an angle to the range [-pi, pi).
    
    :param angle: Angle in radians.
    :returns: Normalized angle in [-pi, pi).
    :complexity: O(1) time, O(1) space
    """

