Export Code

Fork of Earth with Magnetic Field

Nita

Last edited Mar 19, 2025
Created on Mar 19, 2025

Earth with Magnetic Field Visualization

This project shows a 3D visualization of Earth with its magnetic field represented by field lines.

Features

  • 3D Earth with realistic texture
  • Complete 360° magnetic field visualization:
    • Latitude field lines (horizontal circles at different heights)
    • Longitude field lines (vertical semicircles connecting poles)
    • Diagonal field lines for complete spherical coverage
    • Traditional dipole field lines for scientific accuracy
  • Interactive camera controls (rotate, zoom, pan)
  • Earth rotation animation
  • Starry background

Technologies Used

  • Three.js for 3D rendering
  • JavaScript ES modules
  • HTML5 and CSS

How It Works

The magnetic field is visualized using a comprehensive set of field lines:

  1. Latitude lines encircle the Earth horizontally at different heights from pole to pole.
  2. Longitude lines connect the north and south poles vertically along meridians.
  3. Diagonal lines connect various points on the field sphere for complete coverage.
  4. Traditional dipole field lines follow the r = C * sin²(θ) formula, connecting the magnetic poles.

Together, these lines create a complete visualization of a magnetic field surrounding the Earth in all directions.

The blue marker indicates the north magnetic pole, and the orange marker indicates the south magnetic pole.

MIT Licensed