(self)
| 462 | moon2.orbital_period = 2 * math.pi * math.sqrt((moon2.semi_major_axis * 1000) ** 3 / (self.planet.constants.G * self.planet.mass)) |
| 463 | |
| 464 | break |
| 465 | |
| 466 | def get_moon_data(self) -> List[Dict]: |
| 467 | moon_data = [] |
| 468 | for moon in self.moons: |
| 469 | data = { |
| 470 | "name": moon.name, |
| 471 | "properties": { |
| 472 | "mass_kg": moon.mass, |
| 473 | "radius_km": moon.radius, |
| 474 | "density_kg_m3": moon.density, |
| 475 | "type": moon.moon_type, |
| 476 | "origin": moon.origin.value, |
| 477 | }, |
| 478 | "orbit": { |
| 479 | "semi_major_axis_km": moon.semi_major_axis, |
| 480 | "eccentricity": moon.eccentricity, |
| 481 | "inclination_deg": moon.inclination, |
| 482 | "orbital_period_seconds": moon.orbital_period, |
| 483 | "orbital_period_days": moon.orbital_period / 86400, |
| 484 | "current_angle": 0, |
| 485 | }, |
| 486 | "rotation": { |
| 487 | "rotation_period_s": moon.rotation_period, |
| 488 | "rotation_period_hours": moon.rotation_period / 3600, |
| 489 | "angular_velocity_rad_s": moon.angular_velocity, |
| 490 | "is_tidally_locked": abs(moon.rotation_period - moon.orbital_period) < 0.01 * moon.orbital_period, |
| 491 | }, |
| 492 | "visuals": { |
| 493 | "base_color": "#8B8680", |
| 494 | "roughness": 0.8, |
| 495 | "metalness": 0.1, |
| 496 | "normal_strength": 1.0, |
| 497 | "relative_size": moon.radius / (self.planet.diameter / 2), |
| 498 | "has_atmosphere": False, |
| 499 | }, |
| 500 | "procedural": { |
| 501 | "seed": moon.seed, |
| 502 | "noise_scale": 0.5, |
| 503 | "crater_density": 1.0, |
| 504 | "surface_variation": 0.5, |
| 505 | }, |
| 506 | } |
| 507 | moon_data.append(data) |
| 508 | return moon_data |
nothing calls this directly
no outgoing calls
no test coverage detected