calculate_orbital_period
Calculate orbital period and velocity for circular orbits using Kepler's Third Law. Input orbital radius and central body mass to get period in seconds, hours, or days.
Instructions
Calculate orbital period: T = 2π√(r³/GM).
Kepler's Third Law for circular orbits. Period depends on orbital
radius and central body mass.
Args:
orbital_radius: Orbital radius in meters (from center of central body)
central_mass: Mass of central body in kg
gravitational_constant: G in m³/(kg⋅s²) (default 6.674e-11)
Returns:
Dict containing:
- period: Orbital period in seconds
- orbital_velocity: v in m/s
- period_hours: Period in hours (for convenience)
- period_days: Period in days (for convenience)
Tips for LLMs:
- Higher orbit → longer period
- More massive central body → shorter period
- Earth: M = 5.972e24 kg, R = 6.371e6 m
- Moon orbit: r ≈ 384,400 km, T ≈ 27.3 days
- ISS orbit: r ≈ 6,771 km (altitude 400 km), T ≈ 90 minutes
Example - ISS orbit:
result = await calculate_orbital_period(
orbital_radius=6.771e6, # meters
central_mass=5.972e24 # Earth mass (kg)
)
# T ≈ 5,558 seconds ≈ 92.6 minutes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orbital_radius | Yes | ||
| central_mass | Yes | ||
| gravitational_constant | No |
Implementation Reference
- MCP tool endpoint decorated with @tool. Accepts orbital_radius, central_mass, and optional gravitational_constant. Delegates to core calculation function and returns dict.
@tool # type: ignore[arg-type] async def calculate_orbital_period( orbital_radius: float, central_mass: float, gravitational_constant: float = 6.674e-11, ) -> dict: """Calculate orbital period: T = 2π√(r³/GM). Kepler's Third Law for circular orbits. Period depends on orbital radius and central body mass. Args: orbital_radius: Orbital radius in meters (from center of central body) central_mass: Mass of central body in kg gravitational_constant: G in m³/(kg⋅s²) (default 6.674e-11) Returns: Dict containing: - period: Orbital period in seconds - orbital_velocity: v in m/s - period_hours: Period in hours (for convenience) - period_days: Period in days (for convenience) Tips for LLMs: - Higher orbit → longer period - More massive central body → shorter period - Earth: M = 5.972e24 kg, R = 6.371e6 m - Moon orbit: r ≈ 384,400 km, T ≈ 27.3 days - ISS orbit: r ≈ 6,771 km (altitude 400 km), T ≈ 90 minutes Example - ISS orbit: result = await calculate_orbital_period( orbital_radius=6.771e6, # meters central_mass=5.972e24 # Earth mass (kg) ) # T ≈ 5,558 seconds ≈ 92.6 minutes """ from ..circular_motion import OrbitalPeriodRequest, calculate_orbital_period as calc_orbit request = OrbitalPeriodRequest( orbital_radius=orbital_radius, central_mass=central_mass, gravitational_constant=gravitational_constant, ) response = calc_orbit(request) return response.model_dump()