mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
Merge branch 'physics/basic_orbital_capture' of https://github.com/FatAnorexic/Python into physics/basic_orbital_capture
This commit is contained in:
commit
e968e14aa5
@ -16,26 +16,29 @@ This algorithm does not account for an N-body problem.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def capture_radii(
|
def capture_radii(
|
||||||
target_body_radius: float, target_body_mass: float,
|
target_body_radius: float, target_body_mass: float, projectile_velocity: float
|
||||||
projectile_velocity: float
|
) -> float:
|
||||||
)->float:
|
# Gravitational constant to four signifigant figures as of 7/8/2023|
|
||||||
|
# Source google: gravitational constant
|
||||||
|
g = 6.6743e-11 # SI units (N*m**2)/kg**2
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
#Gravitational constant to four significant figures as of 7/8/2023|
|
#Gravitational constant to four significant figures as of 7/8/2023|
|
||||||
#Source google: gravitational constant
|
#Source google: gravitational constant
|
||||||
g=6.6743e-11 #SI units (N*m**2)/kg**2
|
g=6.6743e-11 #SI units (N*m**2)/kg**2
|
||||||
|
=======
|
||||||
|
escape_velocity_squared = (2 * g * target_body_mass) / target_body_radius
|
||||||
|
>>>>>>> 3b6df7598ead9eeffd0f53ad6bf8ae27039469c0
|
||||||
|
|
||||||
escape_velocity_squared=(2*g*target_body_mass)/target_body_radius
|
capture_radius = target_body_radius * math.sqrt(
|
||||||
|
1 + escape_velocity_squared / math.pow(projectile_velocity, 2)
|
||||||
capture_radius=target_body_radius*math.sqrt(
|
|
||||||
1+escape_velocity_squared/math.pow(projectile_velocity,2)
|
|
||||||
)
|
)
|
||||||
return capture_radius
|
return capture_radius
|
||||||
|
|
||||||
|
|
||||||
def capture_area(capture_radius: float)->float:
|
def capture_area(capture_radius: float) -> float:
|
||||||
sigma=math.pi*math.pow(capture_radius,2)
|
sigma = math.pi * math.pow(capture_radius, 2)
|
||||||
return sigma
|
return sigma
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user