Free Seismic P-Wave and S-Wave Lag Time Calculator

Accurately estimate earthquake epicentral distance using P-wave and S-wave arrival time differences. Fast, free, browser-based tool for geophysics students and researchers.

Built by@Akhenaten

AI Generation Prompt

Seismic P-Wave and S-Wave Lag Time Estimator

Overview

A clean, professional, and highly responsive web application designed for geophysics students and hobbyists to calculate the epicentral distance of an earthquake based on the difference in arrival times between P-waves and S-waves.

Key Features

  • Live Calculation Engine: Immediate distance estimation as values are typed (using the formula: Distance = (Ts - Tp) / ((1/Vs) - (1/Vp))).
  • Configurable Velocity Models: Adjustable velocity inputs for Vp (P-wave velocity) and Vs (S-wave velocity) to account for different crustal types.
  • Unit Conversion: Toggle between kilometers (km) and miles (mi).
  • Visual Feedback: A clear, color-coded status bar indicating the quality of inputs.
  • Interactive Results Display: Large, easy-to-read result cards for distance, lag time, and delta.
  • Responsive Design: Optimized for desktop and mobile, ensuring usability in field or lab settings.

UI Layout

  • Header: Clean title with a minimalist icon.
  • Main Tool Area: A two-column layout (on desktop) or stacked (on mobile).
    • Left column: Input fields for P-arrival time, S-arrival time, and velocity constants.
    • Right column: Real-time results dashboard with a large, primary output card for Distance.
  • Information Panel: A small, collapsible 'Theory' section explaining the calculation logic.

Color Palette (Light Mode Only)

  • Primary Blue: #2563EB (Primary buttons and active states).
  • Neutral Gray: #F3F4F6 (Card backgrounds).
  • Text/Typography: #1F2937 (Dark Gray for readability).
  • Success/Accent: #059669 (For calculated results).
  • Surface: #FFFFFF (Page background).

Animations & Micro-interactions

  • Input Focus: Subtle scaling and border-color transition on active input fields.
  • Dynamic Results: Smooth numerical counters when results update, preventing jarring value jumps.
  • Fade-in: Page elements should fade in and slide up slightly on initial load for a premium feel.

Developer Directives

  1. Architecture: Strictly one single HTML file. Embed CSS in <style> and JS in <script> tags.
  2. No Storage: Zero usage of localStorage, sessionStorage, or cookies. Ensure the script does not attempt to access these to prevent sandbox DOMExceptions.
  3. External Resources: Use Tailwind CSS via CDN. Keep all logic in pure Vanilla JS.
  4. Accessibility: Use semantically correct HTML5 tags (<main>, <section>, <article>) and ensure high-contrast ratios for text.
  5. Sandboxed Iframe: Ensure all external links (if any) use target="_blank" and rel="noopener noreferrer". Do not use alert() or prompt(); build custom modal overlays.

Spread the word

2Total Views
gemini-3.0-flashAI Model

Files being used

index.html
11.8 KB
#seismic wave calculator#p-wave s-wave lag time#earthquake distance estimator#geophysics travel time tool#seismic epicentral distance#P-wave S-wave delay#earthquake magnitude basics

Frequently Asked Questions

Everything you need to know about using this application.

How does P-wave and S-wave arrival time difference determine distance?

Primary (P) waves are compressional waves that travel faster through the Earth's crust than Secondary (S) waves, which are shear waves. Because P-waves arrive at a seismic station before S-waves, the time gap between their arrivals (the lag time) increases the further the station is from the earthquake's epicenter. By knowing the typical velocities of these waves in the crust, scientists can mathematically relate this delay to the distance from the seismic source. Our tool uses the standard velocity model to calculate this distance automatically. By simply inputting the arrival times, the application calculates the delay and applies the distance-time formula, providing an immediate estimate of how far the tremor occurred from the recording site.

Can I adjust the velocity settings for different crustal materials?

Yes, this tool allows for manual adjustment of both P-wave and S-wave velocities to accommodate different geological settings. While the default values are optimized for typical continental crustal properties, different rock types and depths significantly alter wave propagation speeds. Users can refine these parameters to obtain a more accurate distance calculation for their specific region of interest. Changing these values will dynamically update the calculated results in real-time. This functionality makes the tool highly versatile for educational purposes, allowing students to simulate how different lithospheric conditions affect the seismic data they are analyzing.

Is this tool suitable for professional earthquake monitoring?

This application is designed primarily as a fast, accessible utility for students, researchers, and hobbyists needing quick estimations. While the mathematical models used are consistent with fundamental seismological principles, professional earthquake monitoring requires complex, multi-station network data, real-time telemetry, and advanced velocity models that account for heterogeneous crustal structures. For professional applications, this tool can serve as a quick sanity-check for manual calculations or as an educational aid. It is not intended to replace dedicated, high-fidelity seismic analysis software suites that process continuous waveforms from global or local sensor arrays.

Does this tool store my input data or previous calculations?

For security and privacy reasons, this application does not use local storage, cookies, or any database. All calculations are performed entirely in-memory within your web browser. Once you refresh the page or close your browser tab, all input data and results are permanently cleared from the session memory. This ensures a clean, privacy-first experience where no tracking or data logging occurs. You can safely use this tool in a shared environment or on public computers without the concern of leaving sensitive calculation data behind, as the tool functions strictly as an ephemeral, single-session utility.

Related Applications