{"record":{"id":"f997993ec71fdfab","repo":"TheAlgorithms/Python","slug":"cannot-have-a-capture-radius-less-than-0","errorCode":null,"errorMessage":"Cannot have a capture radius less than 0","messagePattern":"Cannot have a capture radius less than 0","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"physics/basic_orbital_capture.py","lineNumber":88,"sourceCode":"    capture_radius: The radius of orbital capture and impact for a central body of\n    mass M and a projectile moving towards it with velocity v\n        SI units: meters | m\n    Returns:\n    --------\n    >>> capture_area(17209590691)\n    9.304455331329126e+20\n    >>> capture_area(-1)\n    Traceback (most recent call last):\n        ...\n    ValueError: Cannot have a capture radius less than 0\n\n    Returned SI units:\n    ------------------\n    meters*meters | m**2\n    \"\"\"\n\n    if capture_radius < 0:\n        raise ValueError(\"Cannot have a capture radius less than 0\")\n    sigma = pi * pow(capture_radius, 2)\n    return round(sigma, 0)\n\n\nif __name__ == \"__main__\":\n    from doctest import testmod\n\n    testmod()\n\n\"\"\"\nDerivation:\n\nLet: Mt=target mass, Rt=target radius, v=projectile_velocity,\n     r_0=radius of projectile at instant 0 to CM of target\n     v_p=v at closest approach,\n     r_p=radius from projectile to target CM at closest approach,\n     R_capture= radius of impact for projectile with velocity v\n","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/physics/basic_orbital_capture.py#L70-L106","documentation":"Error \"Cannot have a capture radius less than 0\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at physics/basic_orbital_capture.py:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a capture radius of 0 or greater."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f5988cc09713315817df6a7e327e258013a94440","analyzedAt":"2026-08-14T17:30:07.041Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}