{"record":{"id":"78b3b24d2f7c8f6f","repo":"TheAlgorithms/Python","slug":"invalid-angle-range-is-1-90-degrees","errorCode":null,"errorMessage":"Invalid angle. Range is 1-90 degrees.","messagePattern":"Invalid angle\\. Range is 1-90 degrees\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"physics/horizontal_projectile_motion.py","lineNumber":41,"sourceCode":"# Acceleration Constant on Earth (unit m/s^2)\ng = 9.80665\n\n\ndef check_args(init_velocity: float, angle: float) -> None:\n    \"\"\"\n    Check that the arguments are valid\n    \"\"\"\n\n    # Ensure valid instance\n    if not isinstance(init_velocity, (int, float)):\n        raise TypeError(\"Invalid velocity. Should be an integer or float.\")\n\n    if not isinstance(angle, (int, float)):\n        raise TypeError(\"Invalid angle. Should be an integer or float.\")\n\n    # Ensure valid angle\n    if angle > 90 or angle < 1:\n        raise ValueError(\"Invalid angle. Range is 1-90 degrees.\")\n\n    # Ensure valid velocity\n    if init_velocity < 0:\n        raise ValueError(\"Invalid velocity. Should be a positive number.\")\n\n\ndef horizontal_distance(init_velocity: float, angle: float) -> float:\n    r\"\"\"\n    Returns the horizontal distance that the object cover\n\n    Formula:\n        .. math::\n            \\frac{v_0^2 \\cdot \\sin(2 \\alpha)}{g}\n\n            v_0 - \\text{initial velocity}\n\n            \\alpha - \\text{angle}\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/physics/horizontal_projectile_motion.py#L23-L59","documentation":"Error \"Invalid angle. Range is 1-90 degrees.\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at physics/horizontal_projectile_motion.py:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an angle between 1 and 90 degrees."],"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"}