{"id":2374,"date":"2026-02-09T23:35:13","date_gmt":"2026-02-09T21:35:13","guid":{"rendered":"https:\/\/science-x.net\/?page_id=2374"},"modified":"2026-02-09T23:41:14","modified_gmt":"2026-02-09T21:41:14","slug":"sound-distance-calculator","status":"publish","type":"page","link":"https:\/\/science-x.net\/?page_id=2374","title":{"rendered":"Sound Distance Calculator (Thunder)"},"content":{"rendered":"\n<div class=\"eco-tool wp-block-group\" id=\"eco-tool-thunder-3c1a8\">\n  <div class=\"eco-tool__header\">\n    <h2 class=\"eco-tool__title\">Sound Distance Calculator (Thunder)<\/h2>\n    <p class=\"eco-tool__lead\">\n      Estimate how far away a lightning strike is by timing the delay between the flash and the thunder.\n    <\/p>\n  <\/div>\n\n  <form class=\"eco-tool__form\" id=\"eco-th-form-3c1a8\" novalidate>\n    <div class=\"eco-tool__grid3\">\n      <!-- Seconds -->\n      <div class=\"eco-tool__field\">\n        <label class=\"eco-tool__label\" for=\"eco-th-sec-3c1a8\">\n          Time delay<br>(seconds)\n        <\/label>\n        <input class=\"eco-tool__input\" id=\"eco-th-sec-3c1a8\" type=\"number\" min=\"0\" step=\"0.1\" value=\"10\" inputmode=\"decimal\" \/>\n        <div class=\"eco-tool__hint\">Count seconds between the flash and the sound.<\/div>\n      <\/div>\n\n      <!-- Temperature -->\n      <div class=\"eco-tool__field\">\n        <label class=\"eco-tool__label\" for=\"eco-th-temp-3c1a8\">\n          Air temperature<br>(\u00b0C)\n        <\/label>\n        <input class=\"eco-tool__input\" id=\"eco-th-temp-3c1a8\" type=\"number\" min=\"-40\" max=\"50\" step=\"1\" value=\"20\" inputmode=\"numeric\" \/>\n        <div class=\"eco-tool__hint\">Speed of sound increases slightly with temperature.<\/div>\n      <\/div>\n\n      <!-- Units -->\n      <div class=\"eco-tool__field\">\n        <label class=\"eco-tool__label\" for=\"eco-th-unit-3c1a8\">\n          Output<br>units\n        <\/label>\n        <select class=\"eco-tool__input\" id=\"eco-th-unit-3c1a8\">\n          <option value=\"km\" selected>Kilometers<\/option>\n          <option value=\"mi\">Miles<\/option>\n        <\/select>\n        <div class=\"eco-tool__hint\">We\u2019ll show the distance in your chosen unit.<\/div>\n      <\/div>\n    <\/div>\n\n    <div class=\"eco-tool__actions\">\n      <button type=\"button\" class=\"wp-element-button eco-tool__btn\" id=\"eco-th-calc-3c1a8\">Calculate<\/button>\n      <button type=\"button\" class=\"wp-element-button eco-tool__btn eco-tool__btn--ghost\" id=\"eco-th-reset-3c1a8\">Reset<\/button>\n      <div class=\"eco-tool__error\" id=\"eco-th-error-3c1a8\" aria-live=\"polite\"><\/div>\n    <\/div>\n  <\/form>\n\n  <div class=\"eco-tool__result\" id=\"eco-th-result-3c1a8\" hidden>\n    <h3 class=\"eco-tool__subtitle\">Estimated distance<\/h3>\n\n    <div class=\"eco-tool__cards\">\n      <div class=\"eco-tool__card\">\n        <div class=\"eco-tool__metric-label\">Distance to lightning<\/div>\n        <div class=\"eco-tool__metric-value\" id=\"eco-th-dist-3c1a8\">\u2014<\/div>\n        <div class=\"eco-tool__metric-sub\" id=\"eco-th-sub-3c1a8\">\u2014<\/div>\n      <\/div>\n\n      <div class=\"eco-tool__card\">\n        <div class=\"eco-tool__metric-label\">Speed of sound used<\/div>\n        <div class=\"eco-tool__metric-value\" id=\"eco-th-speed-3c1a8\">\u2014<\/div>\n        <div class=\"eco-tool__metric-sub\">Approximation<\/div>\n      <\/div>\n    <\/div>\n\n    <div class=\"eco-tool__card eco-tool__card--wide\">\n      <div class=\"eco-tool__metric-label\">Safety note<\/div>\n      <div class=\"eco-tool__metric-sub\" id=\"eco-th-safe-3c1a8\"><\/div>\n    <\/div>\n\n    <p class=\"eco-tool__note\">\n      Light arrives almost instantly; thunder arrives later because sound travels much slower than light.\n    <\/p>\n  <\/div>\n\n  <details class=\"eco-tool__details\">\n    <summary class=\"eco-tool__summary\">How we calculate<\/summary>\n    <div class=\"eco-tool__details-body\">\n      <p class=\"eco-tool__text\">\n        Speed of sound (dry air) is approximated as: v \u2248 331 + 0.6\u00d7T (m\/s), where T is \u00b0C.\n        Distance \u2248 v \u00d7 time.\n      <\/p>\n    <\/div>\n  <\/details>\n<\/div>\n\n<style>\n.eco-tool{border:1px solid rgba(0,0,0,.12);border-radius:12px;padding:16px}\n.eco-tool__grid3{display:grid;grid-template-columns:1fr;gap:16px}\n@media (min-width:860px){.eco-tool__grid3{grid-template-columns:1fr 1fr 1fr}}\n.eco-tool__field{display:flex;flex-direction:column;gap:6px}\n.eco-tool__label{font-weight:600}\n.eco-tool__input{height:44px;padding:0 12px;border:1px solid rgba(0,0,0,.2);border-radius:10px;background:#fff;font:inherit;box-sizing:border-box}\n.eco-tool select.eco-tool__input{appearance:none;padding-right:40px}\n.eco-tool__hint{font-size:.92em;opacity:.78;min-height:38px}\n\n.eco-tool__actions{display:flex;gap:10px;margin-top:16px;align-items:center;flex-wrap:wrap}\n.eco-tool__btn{padding:10px 22px}\n.eco-tool__btn--ghost{background:transparent!important;border:1px solid rgba(0,0,0,.2)!important}\n.eco-tool__btn--ghost:hover,.eco-tool__btn--ghost:focus{background:rgba(0,0,0,.06)!important;border-color:rgba(0,0,0,.35)!important}\n.eco-tool__error{font-weight:600;min-height:1.2em;flex:1 1 240px}\n\n.eco-tool__result{margin-top:16px}\n.eco-tool__subtitle{margin:0 0 10px}\n.eco-tool__cards{display:grid;gap:10px;grid-template-columns:1fr}\n@media (min-width:860px){.eco-tool__cards{grid-template-columns:1fr 1fr}}\n.eco-tool__card{border:1px solid rgba(0,0,0,.12);border-radius:12px;padding:12px}\n.eco-tool__card--wide{margin-top:10px}\n.eco-tool__metric-label{opacity:.85;font-weight:600}\n.eco-tool__metric-value{font-size:1.6em;font-weight:800;margin-top:6px;line-height:1.1}\n.eco-tool__metric-sub{opacity:.85;margin-top:6px}\n.eco-tool__note{margin-top:10px;opacity:.9}\n.eco-tool__details{margin-top:14px}\n.eco-tool__summary{cursor:pointer;font-weight:700}\n.eco-tool__details-body{margin-top:10px}\n<\/style>\n\n<script>\n(function(){\n  const S=\"3c1a8\";\n  const el=(id)=>document.getElementById(id+\"-\"+S);\n\n  const secEl=el(\"eco-th-sec\");\n  const tempEl=el(\"eco-th-temp\");\n  const unitEl=el(\"eco-th-unit\");\n\n  const calcBtn=el(\"eco-th-calc\");\n  const resetBtn=el(\"eco-th-reset\");\n  const errEl=el(\"eco-th-error\");\n\n  const resEl=el(\"eco-th-result\");\n  const distEl=el(\"eco-th-dist\");\n  const subEl=el(\"eco-th-sub\");\n  const speedEl=el(\"eco-th-speed\");\n  const safeEl=el(\"eco-th-safe\");\n\n  function setError(msg){ errEl.textContent = msg || \"\"; }\n  function fmt(n,d){ return Number(n).toLocaleString(undefined,{maximumFractionDigits:d}); }\n\n  function calculate(){\n    setError(\"\");\n\n    const t = Number(secEl.value);\n    const T = Number(tempEl.value);\n    const unit = unitEl.value;\n\n    if(!Number.isFinite(t) || t <= 0){\n      setError(\"Please enter a valid time delay in seconds.\");\n      resEl.hidden = true;\n      return;\n    }\n    if(!Number.isFinite(T) || T < -60 || T > 60){\n      setError(\"Please enter a reasonable air temperature (\u00b0C).\");\n      resEl.hidden = true;\n      return;\n    }\n\n    \/\/ v \u2248 331 + 0.6T (m\/s)\n    const v = 331 + 0.6 * T; \/\/ m\/s\n    const meters = v * t;\n\n    let value, label;\n    if(unit === \"mi\"){\n      value = meters \/ 1609.344;\n      label = \"miles\";\n    } else {\n      value = meters \/ 1000;\n      label = \"km\";\n    }\n\n    distEl.textContent = `${fmt(value,2)} ${label}`;\n    subEl.textContent = `Distance \u2248 speed \u00d7 time = ${fmt(v,1)} m\/s \u00d7 ${fmt(t,1)} s`;\n    speedEl.textContent = `${fmt(v,1)} m\/s`;\n\n    \/\/ Simple safety message\n    safeEl.textContent =\n      (value <= (unit===\"mi\" ? 6 : 10))\n        ? \"If you can hear thunder, you are close enough to be struck. Go indoors.\"\n        : \"Still be cautious \u2014 storms can move quickly. If thunder continues, seek shelter.\";\n\n    resEl.hidden = false;\n  }\n\n  function reset(){\n    secEl.value = \"10\";\n    tempEl.value = \"20\";\n    unitEl.value = \"km\";\n    setError(\"\");\n    resEl.hidden = true;\n  }\n\n  calcBtn.addEventListener(\"click\", calculate);\n  resetBtn.addEventListener(\"click\", reset);\n})();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>Sound Distance Calculator (Thunder) Estimate how far away a lightning strike is by timing the delay between the flash and the thunder. Time delay(seconds) Count seconds between the flash and&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":2354,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"_links":{"self":[{"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2374"}],"collection":[{"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/science-x.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2374"}],"version-history":[{"count":2,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2374\/revisions"}],"predecessor-version":[{"id":2377,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2374\/revisions\/2377"}],"up":[{"embeddable":true,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2354"}],"wp:attachment":[{"href":"https:\/\/science-x.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}