# Project Structure
Structure map for the Earths crate.
```text
Earths/
├── README.md # Project overview and usage
├── LICENSE # MIT license
├── ChangeLog.md # Version history
├── ComingSoon.md # Planned features
├── Contributing # Contribution guidelines
├── lastest_versions.sh # Restore wildcard dependency versions
│
├── src/
│ ├── main.rs # Entry point — unified Earth simulation with orbit, climate, geology, rendering
│ ├── lib.rs # Library root, physical constants (gravity, albedo, Stefan-Boltzmann) and re-exports
│ │
│ ├── atmosphere/ # Atmospheric science
│ │ ├── mod.rs # Exports climate, heatwaves, layers, storms, winds
│ │ ├── climate.rs # CO₂/CH₄ tracking, radiative forcing, greenhouse effect, energy balance
│ │ ├── heatwaves.rs # Heat index, wet-bulb temperature, danger levels, Magnus formula
│ │ ├── layers.rs # Standard atmosphere (troposphere–thermosphere), barometric pressure, lapse rates
│ │ ├── storms.rs # Saffir-Simpson cyclones, CAPE, Fujita tornado scale, Rossby deformation
│ │ └── winds.rs # Geostrophic/gradient wind, Coriolis parameter, Ekman spiral, windchill
│ │
│ ├── biosphere/ # Living systems
│ │ ├── mod.rs # Exports ecosystems, fauna, vegetation
│ │ ├── ecosystems.rs # Shannon/Simpson diversity, species-area relation, net primary productivity
│ │ ├── fauna.rs # Kleiber metabolic scaling, logistic growth, Lotka-Volterra predator-prey (RK4)
│ │ └── vegetation.rs # Farquhar C3 photosynthesis (Vcmax/Jmax), LAI transpiration, carbon residence
│ │
│ ├── geodata/ # Geographic data
│ │ ├── mod.rs # Exports bathymetry, coordinates, elevation, regions
│ │ ├── bathymetry.rs # Ocean-floor depth sampling, basin statistics (volume, area, mean depth)
│ │ ├── coordinates.rs # LatLon ↔ ECEF (WGS84 ellipsoid), Haversine distance, iterative conversion
│ │ ├── elevation.rs # Global elevation grid via spherical harmonics (Legendre), bilinear interpolation
│ │ └── regions.rs # Continent/country/ocean database with boundary polygons and area
│ │
│ ├── geology/ # Geologic processes
│ │ ├── mod.rs # Exports earthquakes, erosion, mountains, plate_tectonics, volcanism
│ │ ├── earthquakes.rs # Seismic magnitude, moment, energy, P/S wave travel, Gutenberg-Richter relation
│ │ ├── erosion.rs # Fluvial erosion (Manning), chemical/frost weathering, wind erosion threshold
│ │ ├── mountains.rs # Airy isostatic root depth, flexural rigidity, orogeny uplift rate
│ │ ├── plate_tectonics.rs # Euler pole rotation, crustal root, geothermal gradient, lithospheric flexure
│ │ └── volcanism.rs # Magma composition (SiO₂/MgO), Arrhenius viscosity, VEI classification
│ │
│ ├── hydrology/ # Water systems
│ │ ├── mod.rs # Exports glaciers, lakes, oceans, rivers
│ │ ├── glaciers.rs # Glen's flow law, basal shear stress, equilibrium line altitude, sea level rise
│ │ ├── lakes.rs # Thermal stratification energy, Penman evaporation, longwave radiation
│ │ ├── oceans.rs # Ocean layers (surface/thermocline/deep), UNESCO density, sound speed, heat content
│ │ └── rivers.rs # Manning velocity, Froude/Reynolds numbers, Shields sediment transport
│ │
│ ├── lighting/ # Illumination and day cycles
│ │ ├── mod.rs # Exports day_night, seasons, solar_position
│ │ ├── day_night.rs # Daylight state (twilight zones), terminator position, ambient light level
│ │ ├── seasons.rs # Solar declination, season classification, day length from tropical year fraction
│ │ └── solar_position.rs # Solar azimuth/elevation, Earth-Sun distance (AU), ephemeris with perturbations
│ │
│ ├── physics/ # Orbital and impact mechanics
│ │ ├── mod.rs # Exports collisions, orbit, rotation, tides
│ │ ├── collisions.rs # Crater diameter, fireball radius, impact energy (TNT), ejecta volume scaling
│ │ ├── orbit.rs # Kepler's laws, vis-viva velocity, specific energy/angular momentum
│ │ ├── rotation.rs # Angular velocity, surface speed, centripetal acceleration, precession
│ │ └── tides.rs # Tidal acceleration/potential, bulge height, Love numbers (k₂, h₂)
│ │
│ ├── rendering/ # Visual rendering
│ │ ├── mod.rs # Exports atmosphere_scattering, clouds, materials, ocean_rendering, shaders
│ │ ├── atmosphere_scattering.rs # Rayleigh/Mie scattering, volume rendering, Henyey-Greenstein phase function
│ │ ├── clouds.rs # Cloud types (cumulus/stratus/cirrus/Cb), altitude, coverage, density profiles
│ │ ├── materials.rs # PBR materials (albedo, roughness, metallic) for ocean/desert/forest/snow
│ │ ├── ocean_rendering.rs # Phillips spectrum wave heights, dispersion relation ω = √(g·k·tanh(k·d))
│ │ └── shaders.rs # GLSL uniforms for terrain PBR, atmospheric scattering, ocean surface
│ │
│ ├── satellites/ # Natural and artificial satellites
│ │ ├── mod.rs # Exports artificial, moon
│ │ ├── artificial.rs # Orbital elements, J2 perturbations (RAAN/apsidal precession), drag decay
│ │ └── moon.rs # Osculating Keplerian elements, perturbation dynamics, IPC interface
│ │
│ ├── temporal/ # Time and calendar
│ │ ├── mod.rs # Exports calendar, epoch, time_scale
│ │ ├── calendar.rs # Julian date ↔ DateTime (Gregorian), Unix timestamp, Delta-T interpolation
│ │ ├── epoch.rs # Reference epochs (J2000, J1950, MJD), GMST with nutation corrections
│ │ └── time_scale.rs # Simulation clock with speed multiplier, pause/resume, unit conversions
│ │
│ └── terrain/ # Terrain generation
│ ├── mod.rs # Exports heightmap, lod, mesh, texturing
│ ├── heightmap.rs # Spherical harmonic geoid undulation, procedural Perlin noise, elevation lookup
│ ├── lod.rs # Quadtree LOD subdivision, split distance heuristics, hierarchical refinement
│ ├── mesh.rs # Spherical terrain mesh from lat/lon bounds, vertex normals, tangent vectors
│ └── texturing.rs # Biome classification (ocean/desert/forest/tundra) from elevation and moisture
│
├── tests/ # Integration tests
│ ├── atmosphere_tests.rs # Tests layer profiles, barometric model, standard atmosphere validity
│ ├── biosphere_tests.rs # Tests Shannon index, Simpson diversity, species-area scaling, photosynthesis
│ ├── geodata_tests.rs # Tests LatLon ↔ ECEF roundtrip, geodetic distances, region database
│ ├── geology_tests.rs # Tests seismic magnitude/energy, wave travel times, magma viscosity, plate velocity
│ ├── hydrology_tests.rs # Tests ocean density, glacier flow law, Manning equation, Henry's law
│ ├── lighting_tests.rs # Tests solar position ephemeris, daylight state transitions, seasonal elevation
│ ├── physics_tests.rs # Tests orbital period (365.25 d), equatorial velocity (~465 m/s), tidal bulge
│ ├── satellites_tests.rs # Tests Moon elements (e ≈ 0.055, i ≈ 5.14°), J2 perturbations, lunar distance
│ ├── temporal_tests.rs # Tests Julian date conversions, Unix roundtrips, Delta-T interpolation
│ └── terrain_tests.rs # Tests heightmap generation, elevation sampling (Everest/Mariana), LOD, biomes
│
└── examples/ # Runnable examples
├── check_elev.rs # Samples notable landmarks (Paris, Everest, Mariana Trench)
├── climate_sim.rs # Atmospheric layers, climate variations, CO₂ forcing, energy balance
├── earthquake_sim.rs # Seismic magnitude/energy, wave physics, magma properties, plate velocity
└── tidal_sim.rs # Orbital mechanics, rotation, tidal forces, spring/neap, satellite dynamics
```