Input Param: ------------ capture_radius: The radius of orbital capture and impact for a central body of mass M and a projectile moving towards it with velocity v SI units: meters | m Returns: -------- >>> capture_area(17209590691) 9.304455331329126e+20 >
(capture_radius: float)
| 64 | |
| 65 | |
| 66 | def capture_area(capture_radius: float) -> float: |
| 67 | """ |
| 68 | Input Param: |
| 69 | ------------ |
| 70 | capture_radius: The radius of orbital capture and impact for a central body of |
| 71 | mass M and a projectile moving towards it with velocity v |
| 72 | SI units: meters | m |
| 73 | Returns: |
| 74 | -------- |
| 75 | >>> capture_area(17209590691) |
| 76 | 9.304455331329126e+20 |
| 77 | >>> capture_area(-1) |
| 78 | Traceback (most recent call last): |
| 79 | ... |
| 80 | ValueError: Cannot have a capture radius less than 0 |
| 81 | |
| 82 | Returned SI units: |
| 83 | ------------------ |
| 84 | meters*meters | m**2 |
| 85 | """ |
| 86 | |
| 87 | if capture_radius < 0: |
| 88 | raise ValueError("Cannot have a capture radius less than 0") |
| 89 | sigma = pi * pow(capture_radius, 2) |
| 90 | return round(sigma, 0) |
| 91 | |
| 92 | |
| 93 | if __name__ == "__main__": |
nothing calls this directly
no outgoing calls
no test coverage detected