{"id":2344,"date":"2026-02-05T19:35:24","date_gmt":"2026-02-05T17:35:24","guid":{"rendered":"https:\/\/science-x.net\/?page_id=2344"},"modified":"2026-02-05T19:35:48","modified_gmt":"2026-02-05T17:35:48","slug":"horizon-distance-calculator","status":"publish","type":"page","link":"https:\/\/science-x.net\/?page_id=2344","title":{"rendered":"Horizon Distance Calculator"},"content":{"rendered":"\n<div class=\"eco-tool wp-block-group\" id=\"eco-tool-horizon-5a0c3\">\n  <div class=\"eco-tool__header\">\n    <h2 class=\"eco-tool__title\">Horizon Distance Calculator<\/h2>\n    <p class=\"eco-tool__lead\">\n      Estimate how far the horizon is from your viewpoint. Choose a height and compare Earth, Moon, and Mars (approximate, ignores refraction).\n    <\/p>\n  <\/div>\n\n  <form class=\"eco-tool__form\" id=\"eco-hz-form-5a0c3\" novalidate>\n    <div class=\"eco-tool__grid3\">\n      <!-- Height preset -->\n      <div class=\"eco-tool__field\">\n        <label class=\"eco-tool__label\" for=\"eco-hz-preset-5a0c3\">Height preset<\/label>\n        <select class=\"eco-tool__input\" id=\"eco-hz-preset-5a0c3\">\n          <option value=\"custom\" selected>Custom height<\/option>\n          <option value=\"standing\">Standing person (~1.7 m)<\/option>\n          <option value=\"roof\">Rooftop (~10 m)<\/option>\n          <option value=\"hill\">Hill (~100 m)<\/option>\n          <option value=\"mountain\">Mountain (~2,000 m)<\/option>\n          <option value=\"airplane\">Airplane (~10,000 m)<\/option>\n          <option value=\"iss\">ISS altitude (~420,000 m)<\/option>\n        <\/select>\n        <div class=\"eco-tool__hint\">Pick a preset or enter your own height.<\/div>\n      <\/div>\n\n      <!-- Height input -->\n      <div class=\"eco-tool__field\" id=\"eco-hz-height-wrap-5a0c3\">\n        <label class=\"eco-tool__label\" for=\"eco-hz-height-5a0c3\">Observer height (m)<\/label>\n        <input class=\"eco-tool__input\" id=\"eco-hz-height-5a0c3\" type=\"number\" min=\"0.1\" step=\"0.1\" value=\"1.7\" inputmode=\"decimal\" \/>\n        <div class=\"eco-tool__hint\">Height above the surface.<\/div>\n      <\/div>\n\n      <!-- Notes -->\n      <div class=\"eco-tool__field\">\n        <label class=\"eco-tool__label\">Assumptions<\/label>\n        <div class=\"eco-tool__noteBox\">\n          Uses a spherical-body approximation and ignores atmospheric refraction. On Earth, refraction often makes the horizon slightly farther.\n        <\/div>\n        <div class=\"eco-tool__hint\">Good for intuition and comparisons.<\/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-hz-calc-5a0c3\">Calculate<\/button>\n      <button type=\"button\" class=\"wp-element-button eco-tool__btn eco-tool__btn--ghost\" id=\"eco-hz-reset-5a0c3\">Reset<\/button>\n      <div class=\"eco-tool__error\" id=\"eco-hz-error-5a0c3\" aria-live=\"polite\"><\/div>\n    <\/div>\n  <\/form>\n\n  <div class=\"eco-tool__result\" id=\"eco-hz-result-5a0c3\" hidden>\n    <h3 class=\"eco-tool__subtitle\">Distance to the horizon<\/h3>\n\n    <div class=\"eco-tool__cardsGrid\" id=\"eco-hz-cards-5a0c3\"><\/div>\n\n    <div class=\"eco-tool__card eco-tool__card--wide\">\n      <div class=\"eco-tool__metric-label\">Formula used<\/div>\n      <div class=\"eco-tool__metric-sub\">\n        d \u2248 \u221a(2Rh + h\u00b2), where R is radius and h is observer height.\n      <\/div>\n      <div class=\"eco-tool__metric-sub eco-tool__muted\" id=\"eco-hz-formula-note-5a0c3\"><\/div>\n    <\/div>\n\n    <p class=\"eco-tool__note\">\n      If the object also has height, its visible distance increases (you can add both horizon distances).\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        We use the geometric horizon formula for a sphere: d = \u221a(2Rh + h\u00b2).\n        For small h compared to R, this is close to d \u2248 \u221a(2Rh).\n      <\/p>\n      <ul class=\"eco-tool__list\" id=\"eco-hz-factors-5a0c3\"><\/ul>\n    <\/div>\n  <\/details>\n<\/div>\n\n<style>\n.eco-tool{\n  border: 1px solid rgba(0,0,0,.12);\n  border-radius: 12px;\n  padding: 16px;\n}\n\n.eco-tool__grid3{\n  display: grid;\n  grid-template-columns: 1fr;\n  gap: 16px;\n}\n@media (min-width: 860px){\n  .eco-tool__grid3{ grid-template-columns: 1fr 1fr 1fr; }\n}\n\n.eco-tool__field{\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n}\n.eco-tool__label{ font-weight: 600; }\n\n.eco-tool__input{\n  height: 44px;\n  padding: 0 12px;\n  border: 1px solid rgba(0,0,0,.2);\n  border-radius: 10px;\n  font: inherit;\n  background: #fff;\n  box-sizing: border-box;\n}\n.eco-tool select.eco-tool__input{\n  appearance: none;\n  padding-right: 40px;\n}\n\n.eco-tool__hint{\n  font-size: .92em;\n  opacity: .78;\n  min-height: 38px;\n}\n\n.eco-tool__noteBox{\n  border: 1px solid rgba(0,0,0,.12);\n  border-radius: 12px;\n  padding: 12px;\n  background: rgba(0,0,0,.02);\n  min-height: 44px;\n}\n\n.eco-tool__actions{\n  display: flex;\n  gap: 10px;\n  margin-top: 16px;\n  align-items: center;\n  flex-wrap: wrap;\n}\n.eco-tool__btn{ padding: 10px 22px; }\n.eco-tool__btn--ghost{\n  background: transparent !important;\n  border: 1px solid rgba(0,0,0,.2) !important;\n}\n.eco-tool__btn--ghost:hover,\n.eco-tool__btn--ghost:focus{\n  background: rgba(0,0,0,.06) !important;\n  border-color: rgba(0,0,0,.35) !important;\n}\n\n.eco-tool__error{\n  font-weight: 600;\n  min-height: 1.2em;\n  flex: 1 1 240px;\n}\n\n.eco-tool__result{ margin-top: 16px; }\n.eco-tool__subtitle{ margin: 0 0 10px; }\n\n.eco-tool__cardsGrid{\n  display: grid;\n  grid-template-columns: 1fr;\n  gap: 10px;\n  margin-top: 12px;\n}\n@media (min-width: 860px){\n  .eco-tool__cardsGrid{ grid-template-columns: 1fr 1fr 1fr; }\n}\n\n.eco-tool__card{\n  border: 1px solid rgba(0,0,0,.12);\n  border-radius: 12px;\n  padding: 12px;\n}\n.eco-tool__card--wide{ margin-top: 10px; }\n\n.eco-tool__metric-label{ opacity: .85; font-weight: 600; }\n.eco-tool__metric-value{ font-size: 1.55em; font-weight: 900; margin-top: 6px; line-height: 1.1; }\n.eco-tool__metric-sub{ opacity: .85; margin-top: 6px; }\n.eco-tool__muted{ opacity: .8; }\n\n.eco-tool__pTop{\n  display: flex;\n  justify-content: space-between;\n  gap: 10px;\n  align-items: baseline;\n}\n.eco-tool__pName{ font-weight: 800; }\n.eco-tool__pR{ opacity: .75; font-weight: 600; }\n\n.eco-tool__pTag{\n  display: inline-block;\n  margin-top: 8px;\n  padding: 6px 10px;\n  border-radius: 999px;\n  border: 1px solid rgba(0,0,0,.14);\n  opacity: .9;\n}\n\n.eco-tool__note{ margin-top: 10px; opacity: .9; }\n\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.eco-tool__list{ padding-left: 18px; }\n<\/style>\n\n<script>\n(function(){\n  const S = \"5a0c3\";\n  const el = (id) => document.getElementById(id + \"-\" + S);\n\n  const presetEl = el(\"eco-hz-preset\");\n  const hEl = el(\"eco-hz-height\");\n\n  const calcBtn = el(\"eco-hz-calc\");\n  const resetBtn = el(\"eco-hz-reset\");\n  const errorEl = el(\"eco-hz-error\");\n\n  const resultEl = el(\"eco-hz-result\");\n  const cardsEl = el(\"eco-hz-cards\");\n  const fNoteEl = el(\"eco-hz-formula-note\");\n  const factorsEl = el(\"eco-hz-factors\");\n\n  const PRESETS = {\n    custom: null,\n    standing: 1.7,\n    roof: 10,\n    hill: 100,\n    mountain: 2000,\n    airplane: 10000,\n    iss: 420000\n  };\n\n  \/\/ Radii in km\n  const BODIES = [\n    { key:\"earth\", name:\"Earth\", Rkm: 6371 },\n    { key:\"moon\",  name:\"Moon\",  Rkm: 1737.4 },\n    { key:\"mars\",  name:\"Mars\",  Rkm: 3389.5 }\n  ];\n\n  function setError(msg){ errorEl.textContent = msg || \"\"; }\n  function clamp(x,a,b){ return Math.max(a, Math.min(b, x)); }\n\n  function fmt(n, d){\n    const p = (typeof d === \"number\") ? d : 2;\n    return (Math.round(n * Math.pow(10,p)) \/ Math.pow(10,p)).toLocaleString(undefined,{\n      minimumFractionDigits:p, maximumFractionDigits:p\n    });\n  }\n\n  function updatePreset(){\n    const p = presetEl.value;\n    if (p !== \"custom\"){\n      hEl.value = String(PRESETS[p]);\n    }\n  }\n\n  function horizonKm(Rkm, hM){\n    const Rm = Rkm * 1000;\n    const h = hM;\n    const d = Math.sqrt(2 * Rm * h + h * h); \/\/ meters\n    return d \/ 1000;\n  }\n\n  function tagFor(dKm){\n    if (dKm < 5) return \"Nearby horizon\";\n    if (dKm < 50) return \"Regional horizon\";\n    if (dKm < 500) return \"Long-range horizon\";\n    return \"Very long-range\";\n  }\n\n  function fillFactors(){\n    factorsEl.innerHTML = BODIES.map(b =>\n      `<li><strong>${b.name}:<\/strong> radius \u2248 ${b.Rkm.toLocaleString()} km<\/li>`\n    ).join(\"\");\n  }\n\n  function calculate(){\n    setError(\"\");\n\n    const h = Number(hEl.value);\n    if (!Number.isFinite(h) || h <= 0){\n      setError(\"Please enter a valid height (meters).\");\n      resultEl.hidden = true;\n      return;\n    }\n\n    const rows = BODIES.map(b => {\n      const d = horizonKm(b.Rkm, h);\n      const cls = \"eco-tool__card\";\n      return `\n        <div class=\"${cls}\">\n          <div class=\"eco-tool__pTop\">\n            <div class=\"eco-tool__pName\">${b.name}<\/div>\n            <div class=\"eco-tool__pR\">R = ${b.Rkm.toLocaleString()} km<\/div>\n          <\/div>\n          <div class=\"eco-tool__metric-value\">${fmt(d,2)} km<\/div>\n          <div class=\"eco-tool__metric-sub\">Distance to horizon<\/div>\n          <div class=\"eco-tool__pTag\">${tagFor(d)}<\/div>\n        <\/div>\n      `;\n    }).join(\"\");\n\n    cardsEl.innerHTML = rows;\n\n    fNoteEl.textContent = `Using h = ${fmt(h,1)} m (no atmospheric refraction).`;\n\n    resultEl.hidden = false;\n  }\n\n  function reset(){\n    presetEl.value = \"standing\";\n    updatePreset();\n    setError(\"\");\n    resultEl.hidden = true;\n  }\n\n  \/\/ init\n  fillFactors();\n  presetEl.value = \"standing\";\n  updatePreset();\n\n  presetEl.addEventListener(\"change\", updatePreset);\n  calcBtn.addEventListener(\"click\", calculate);\n  resetBtn.addEventListener(\"click\", reset);\n})();\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Horizon Distance Calculator Estimate how far the horizon is from your viewpoint. Choose a height and compare Earth, Moon, and Mars (approximate, ignores refraction). Height preset Custom heightStanding person (~1.7&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":2295,"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\/2344"}],"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=2344"}],"version-history":[{"count":2,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2344\/revisions"}],"predecessor-version":[{"id":2346,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2344\/revisions\/2346"}],"up":[{"embeddable":true,"href":"https:\/\/science-x.net\/index.php?rest_route=\/wp\/v2\/pages\/2295"}],"wp:attachment":[{"href":"https:\/\/science-x.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}