geod-calc.html 22.1 KB
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593
<!DOCTYPE html>
<html>
  <head>
    <title>Geodesic calculations for an ellipsoid done right</title>
    <meta name="description"
          content="Geodesic calculations for an ellipsoid done right" />
    <meta name="author" content="Charles F. F. Karney">
    <meta name="keywords"
          content="geodesics,
                   geodesic distance,
                   geographic distance,
                   shortest path,
                   direct geodesic problem,
                   inverse geodesic problem,
                   distance and azimuth,
                   distance and heading,
                   range and bearing,
                   geographic area,
                   geodesic polygon,
                   spheroidal triangle,
                   latitude and longitude,
                   online calculator,
                   WGS84 ellipsoid,
                   GeographicLib" />
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <!--
        Full URL for latest version of geographiclib.min.js is
        https://geographiclib.sourceforge.io/scripts/geographiclib.min.js
        URL for a specific version is, for example,
        https://geographiclib.sourceforge.io/scripts/geographiclib-1.45.min.js
      -->
    <script type="text/javascript" src="geographiclib.min.js">
    </script>
    <script type="text/javascript">
"use strict";

var geod = GeographicLib.Geodesic.WGS84,
    dms = GeographicLib.DMS;

(function(g) {
  "use strict";

  /*
   * Compute the area of a polygon
   */
  g.Geodesic.prototype.Area = function(points, polyline) {
    var poly = this.Polygon(polyline), i;
    for (i = 0; i < points.length; ++i)
      poly.AddPoint(points[i].lat, points[i].lon);
    return poly.Compute(false, true);
  };

  /*
   * split a geodesic line into k approximately equal pieces which are no
   * longer than about ds12 (but k cannot exceed maxk, default 20), and returns
   * an array of length k + 1 of objects with fields lat, lon, azi.
   */
  g.Geodesic.prototype.InversePath =
    function(lat1, lon1, lat2, lon2, ds12, maxk) {
      var line = this.InverseLine(lat1, lon1, lat2, lon2, g.STANDARD),
          k, points, da12, vals, i;
      if (!maxk) maxk = 20;
      if (!(ds12 > 0))
        throw new Error("ds12 must be a positive number");
      k = Math.max(1, Math.min(maxk, Math.ceil(line.s13 / ds12)));
      points = new Array(k + 1);
      da12 = line.a13 / k;
      for (i = 0; i <= k; ++i) {
        vals = line.ArcPosition(i * da12);
        points[i] = {lat: vals.lat2, lon: vals.lon2, azi: vals.azi2};
      }
      return points;
    };

})(GeographicLib.Geodesic);

function formatpoint(lat, lon, azi, dmsformat, prec) {
  var trail;
  prec += 5;
  if (dmsformat) {
    trail = prec < 2 ? dms.DEGREE :
      (prec < 4 ? dms.MINUTE : dms.SECOND);
    prec = prec < 2 ? prec : (prec < 4 ? prec - 2 : prec - 4);
    return (dms.Encode(lat, trail, prec, dms.LATITUDE) + " " +
            dms.Encode(lon, trail, prec, dms.LONGITUDE) + " " +
            dms.Encode(azi, trail, prec, dms.AZIMUTH));
  } else {
    return (lat.toFixed(prec) + " " +
            lon.toFixed(prec) + " " +
            azi.toFixed(prec));
  }
};

function GeodesicInverse(input, dmsformat, prec) {
  var result = {},
      t, p1, p2;
  try {
    // Input is a blank-delimited line: lat1 lon1 lat2 lon2
    t = input;
    t = t.replace(/^\s+/,"").replace(/\s+$/,"").split(/[\s,]+/,6);
    if (t.length != 4)
      throw new Error("Need 4 input items");
    p1 = GeographicLib.DMS.DecodeLatLon(t[0], t[1]);
    p2 = GeographicLib.DMS.DecodeLatLon(t[2], t[3]);
    t = geod.Inverse(p1.lat, p1.lon, p2.lat, p2.lon,
                     GeographicLib.Geodesic.ALL |
                     GeographicLib.Geodesic.LONG_UNROLL);
    result.status = "OK";
    result.p1 = formatpoint(t.lat1, t.lon1, t.azi1, dmsformat, prec);
    result.p2 = formatpoint(t.lat2, t.lon2, t.azi2, dmsformat, prec);
    result.s12 = t.s12.toFixed(prec);
    result.a12 = t.a12.toFixed(prec + 5);
    result.m12 = t.m12.toFixed(prec);
    result.M1221 = t.M12.toFixed(prec + 7) + " " + t.M21.toFixed(prec + 6);
    result.S12 = t.S12.toFixed(Math.max(prec - 7, 0));
  }
  catch (e) {
    result.status = "ERROR: " + e.message;
    result.p1 = "";
    result.p2 = "";
    result.s12 = "";
    result.a12 = "";
    result.m12 = "";
    result.M1221 = "";
    result.S12 = "";
  }
  return result;
};

function GeodesicDirect(input, dmsformat, prec) {
  var result = {},
      t, p1, azi1, s12;
  try {
    // Input is a blank-delimited line: lat1 lon1 azi1 s12
    t = input;
    t = t.replace(/^\s+/,"").replace(/\s+$/,"").split(/[\s,]+/,6);
    if (t.length != 4)
      throw new Error("Need 4 input items");
    p1 = GeographicLib.DMS.DecodeLatLon(t[0], t[1]);
    azi1 = GeographicLib.DMS.DecodeAzimuth(t[2]);
    s12 = parseFloat(t[3]);
    t = geod.Direct(p1.lat, p1.lon, azi1, s12,
                    GeographicLib.Geodesic.ALL |
                    GeographicLib.Geodesic.LONG_UNROLL);
    result.status = "OK";
    result.p1 = formatpoint(t.lat1, t.lon1, t.azi1, dmsformat, prec);
    result.p2 = formatpoint(t.lat2, t.lon2, t.azi2, dmsformat, prec);
    result.s12 = t.s12.toFixed(prec);
    result.a12 = t.a12.toFixed(prec + 5);
    result.m12 = t.m12.toFixed(prec);
    result.M1221 = t.M12.toFixed(prec + 7) + " " + t.M21.toFixed(prec + 6);
    result.S12 = t.S12.toFixed(Math.max(prec - 7, 0));
  }
  catch (e) {
    result.status = "ERROR: " + e.message;
    result.p1 = "";
    result.p2 = "";
    result.s12 = "";
    result.a12 = "";
    result.m12 = "";
    result.M1221 = "";
    result.S12 = "";
  }
  return result;
};

function GeodesicInversePath(input, dmsformat, prec) {
  var result = {},
      t, p1, p2, ds12, maxnum, i;
  try {
    // Input is a blank-delimited line: lat1 lon1 lat2 lon2 ds12 maxnum
    t = input;
    t = t.replace(/^\s+/,"").replace(/\s+$/,"").split(/[\s,]+/,8);
    if (t.length != 6)
      throw new Error("Need 6 input items");
    p1 = GeographicLib.DMS.DecodeLatLon(t[0], t[1]);
    p2 = GeographicLib.DMS.DecodeLatLon(t[2], t[3]);
    ds12 = parseFloat(t[4]);
    maxnum = parseInt(t[5]);
    t = geod.InversePath(p1.lat, p1.lon, p2.lat, p2.lon, ds12, maxnum);
    result.status = "OK";
    result.points = ""
    for (i = 0; i < t.length; ++i)
      result.points +=
      formatpoint(t[i].lat, t[i].lon, t[i].azi, dmsformat, prec) + "\n";
  }
  catch (e) {
    result.status = "ERROR: " + e.message;
    result.points = "";
  }
  return result;
};

function GeodesicArea(input, polyline) {
  var result = {},
      t, i, pos;
  try {
    // Input is a newline-delimited points;
    // each point is blank-delimited: lat lon
    t = input;
    t = t.split(/[\r\n]/);
    if (t.length > 0 && t[0] == "") t.shift();
    if (t.length > 0 && t[t.length-1] == "") t.pop();
    for (i = 0; i < t.length; ++i) {
      pos = t[i].replace(/^\s+/,"").replace(/\s+$/,"").split(/[\s,]+/,4);
      if (pos.length != 2)
        throw new Error("Need 2 items on each line");
      t[i] = dms.DecodeLatLon(pos[0], pos[1]);
    }
    t = geod.Area(t, polyline);
    result.status = "OK";
    result.area = t.number + " " +
      t.perimeter.toFixed(8);
    if (!polyline)
      result.area += " " + t.area.toFixed(2);
  }
  catch (e) {
    result.status = "ERROR: " + e.message;
    result.area = "";
  }
  return result;
};
    </script>
  </head>
  <body>
    <div>
      <h2>Geodesic calculations for an ellipsoid done right</h2>
    </div>
    <p>
      This page illustrates the geodesic routines available in
      JavaScript package
      <a href="https://www.npmjs.com/package/geographiclib">
        geographiclib, the geodesic routines in GeographicLib</a>
      (<a href="https://geographiclib.sourceforge.io/html/js/">
        documentation</a>).
      The algorithms are considerably more accurate than Vincenty's
      method, and offer more functionality (an inverse method which
      never fails to converge, differential properties of the geodesic,
      and the area under a geodesic).  The algorithms are derived in
      <blockquote>
        Charles F. F. Karney,<br>
        <a href="https://doi.org/10.1007/s00190-012-0578-z">
          <i>Algorithms for geodesics</i></a>,<br>
        J. Geodesy <b>87</b>(1), 43&ndash;55 (Jan. 2013);<br>
        DOI:
        <a href="https://doi.org/10.1007/s00190-012-0578-z">
          10.1007/s00190-012-0578-z</a>
        (<a href="https://doi.org/10.1007/s00190-012-0578-z">pdf</a>);
        addenda:
        <a href="https://geographiclib.sourceforge.io/geod-addenda.html">
          geod-addenda.html</a>.
      </blockquote>
      This page just provides a basic interface.  Enter latitudes,
      longitudes, and azimuths as degrees and distances as meters using
      spaces or commas as separators.  (Angles may be entered as decimal
      degrees or as degrees, minutes, and seconds, e.g. -20.51125,
      20&deg;30&prime;40.5&Prime;S, S20d30'40.5&quot;, or
      -20:30:40.5.)  The results are accurate to about
      15&nbsp;nanometers (or 0.1&nbsp;m<sup>2</sup> per vertex for
      areas).  A slicker page where the geodesics are incorporated into
      Google Maps is given <a href="geod-google.html">here</a>.  Basic
      online tools which provide similar capabilities are
      <a href="https://geographiclib.sourceforge.io/cgi-bin/GeodSolve">
        GeodSolve</a>
      and
      <a href="https://geographiclib.sourceforge.io/cgi-bin/Planimeter">
        Planimeter</a>;
      these call a C++ backend.  This page uses version
      <script type="text/javascript">
        document.write(GeographicLib.Constants.version_string);
      </script>
      of the geodesic code.
    <p>
      Jump to:
      <ul>
        <li><a href="#inverse">Inverse problem</a></li>
        <li><a href="#direct">Direct problem</a></li>
        <li><a href="#path">Geodesic path</a></li>
        <li><a href="#area">Polygon area</a></li>
        <li><a href="geod-google.html">Geodesic lines, circles, and
        envelopes in Google Maps</a></li>
      </ul>
    </p>
    <hr>
    <form name="inverse" >
      <h3><a class="anchor" id="inverse">Inverse problem</h3>
      <p>
        Find the shortest path between two points on the earth.  The
        path is characterized by its length <i>s12</i> and its azimuth
        at the two ends <i>azi1</i> and <i>azi2</i>.  See
        <a href="https://geographiclib.sourceforge.io/html/GeodSolve.1.html">
          GeodSolve(1)</a>
        for the definition of the
        quantities <i>a12</i>, <i>m12</i>, <i>M12</i>, <i>M21</i>,
        and <i>S12</i>.  The sample calculation finds the shortest path
        between Wellington, New Zealand, and Salamanca, Spain.  To
        perform the calculation, press the &ldquo;COMPUTE&rdquo; button.
      </p>
      <p>Enter <i>&ldquo;lat1 lon1 lat2 lon2&rdquo;</i>:</p>
      <p>input:
        <input name="input" size=72 value="-41.32 174.81 40.96 -5.50" />
      </p>
      <p>
        Output format:&nbsp;&nbsp;<label for="ig">
          <input type="radio" value="g" name="format" id="ig" checked>
          decimal degrees
        </label>&nbsp;
        <label for="id">
          <input type="radio" value="d" name="format" id="id">
          degrees minutes seconds
        </label><br>
        Output precision:&nbsp;&nbsp;<select name="prec" size=1>
          <option value='0'> 1m 0.00001d 0.1"</option>
          <option value='1'> 100mm 0.01"</option>
          <option value='2'> 10mm 0.001"</option>
          <option value='3' selected> 1mm 0.0001"</option>
          <option value='4'> 100um 0.00001"</option>
          <option value='5'> 10um 0.000001"</option>
          <option value='6'> 1um 0.0000001"</option>
          <option value='7'> 100nm 0.00000001"</option>
          <option value='8'> 10nm 0.000000001"</option>
          <option value='9'> 1nm 0.0000000001"</option>
        </select>
      </p>
      <p>
        <input type="button" value="COMPUTE"
               onclick="var t = GeodesicInverse(document.inverse.input.value,
                                document.inverse.format[1].checked,
                                document.inverse.prec.selectedIndex);
                        document.inverse.status.value = t.status;
                        document.inverse.p1.value = t.p1;
                        document.inverse.p2.value = t.p2;
                        document.inverse.s12.value = t.s12;
                        document.inverse.a12.value = t.a12;
                        document.inverse.m12.value = t.m12;
                        document.inverse.M1221.value = t.M1221;
                        document.inverse.S12.value = t.S12;" />
      </p>
      <p>
        status:
        <input name="status" size=50 readonly />
      </p>
      <p>
        lat1 lon1 <font color='blue'>azi1</font>:
        <input name="p1" size=75 readonly />
      </p>
      <p>
        lat2 lon2 <font color='blue'>azi2</font>:
        <input name="p2" size=75 readonly />
      </p>
      <p>
        <font color='blue'>s12</font>:
        <input name="s12" size=25 readonly />
      </p>
      <p>
        <font color='blue'>a12</font>:
        <input name="a12" size=25 readonly />
      </p>
      <p>
        <font color='blue'>m12</font>:
        <input name="m12" size=25 readonly />
      </p>
      <p>
        <font color='blue'>M12 M21</font>:
        <input name="M1221" size=50 readonly />
      </p>
      <p>
        <font color='blue'>S12</font>:
        <input name="S12" size=25 readonly />
      </p>
    </form>
    <hr>
    <form name="direct">
      <h3><a class="anchor" id="direct">Direct problem</h3>
      <p>
        Find the destination traveling a given distance along a geodesic
        with a given azimuth at the starting point.  The destination is
        characterized by its position <i>lat2, lon2</i> and its azimuth
        at the destination <i>azi2</i>.  See
        <a href="https://geographiclib.sourceforge.io/html/GeodSolve.1.html">
          GeodSolve(1)</a>
        for the definition of the
        quantities <i>a12</i>, <i>m12</i>, <i>M12</i>, <i>M21</i>,
        and <i>S12</i>.  The sample calculation shows the result of
        travelling 10000 km NE from JFK airport.  To perform the
        calculation, press the &ldquo;COMPUTE&rdquo; button.
      </p>
      <p>Enter <i>&ldquo;lat1 lon1 azi1 s12&rdquo;</i>:</p>
      <p>input:
        <input name="input" size=72 value="40.6 -73.8 45 10000e3" />
      </p>
      <p>
        Output format:&nbsp;&nbsp;<label for="dg">
          <input type="radio" value="g" name="format" id="dg" checked>
          decimal degrees
        </label>&nbsp;
        <label for="dd">
          <input type="radio" value="d" name="format" id="dd">
          degrees minutes seconds
        </label><br>
        Output precision:&nbsp;&nbsp;<select name="prec" size=1>
          <option value='0'> 1m 0.00001d 0.1"</option>
          <option value='1'> 100mm 0.01"</option>
          <option value='2'> 10mm 0.001"</option>
          <option value='3' selected> 1mm 0.0001"</option>
          <option value='4'> 100um 0.00001"</option>
          <option value='5'> 10um 0.000001"</option>
          <option value='6'> 1um 0.0000001"</option>
          <option value='7'> 100nm 0.00000001"</option>
          <option value='8'> 10nm 0.000000001"</option>
          <option value='9'> 1nm 0.0000000001"</option>
        </select>
      </p>
      <p>
        <input type="button" value="COMPUTE"
               onclick="var t = GeodesicDirect(document.direct.input.value,
                                document.direct.format[1].checked,
                                document.direct.prec.selectedIndex);
                        document.direct.status.value = t.status;
                        document.direct.p1.value = t.p1;
                        document.direct.p2.value = t.p2;
                        document.direct.s12.value = t.s12;
                        document.direct.a12.value = t.a12;
                        document.direct.m12.value = t.m12;
                        document.direct.M1221.value = t.M1221;
                        document.direct.S12.value = t.S12;" />
      </p>
      <p>
        status:
        <input name="status" size=50 readonly />
      </p>
      <p>
        lat1 lon1 azi1:
        <input name="p1" size=75 readonly />
      </p>
      <p>
        <font color='blue'>lat2 lon2 azi2</font>:
        <input name="p2" size=75 readonly />
      </p>
      <p>
        s12:
        <input name="s12" size=25 readonly />
      </p>
      <p>
        <font color='blue'>a12</font>:
        <input name="a12" size=25 readonly />
      </p>
      <p>
        <font color='blue'>m12</font>:
        <input name="m12" size=25 readonly />
      </p>
      <p>
        <font color='blue'>M12 M21</font>:
        <input name="M1221" size=50 readonly />
      </p>
      <p>
        <font color='blue'>S12</font>:
        <input name="S12" size=25 readonly />
      </p>
    </form>
    <hr>
    <form name="path">
      <h3><a class="anchor" id="path">Geodesic path</h3>
      <p>
        Find intermediate points along a geodesic.  In addition to
        specifying the endpoints, give <i>ds12</i>, the maximum distance
        between the intermediate points and <i>maxk</i>, the maximum
        number of intervals the geodesic is broken into.  The output
        gives a sequence of positions <i>lat, lon</i> together with the
        corresponding azimuths <i>azi</i>.  The sample shows the path
        from JFK to Singapore's Changi Airport at about 1000 km
        intervals.  (In this example, the path taken by Google Earth
        deviates from the shortest path by about 2.9 km.)  To perform
        the calculation, press the &ldquo;COMPUTE&rdquo; button.
      </p>
      <p>Enter <i>&ldquo;lat1 lon1 lat2 lon2 ds12 maxk&rdquo;</i>:</p>
      <p>input:
        <input name="input" size=72 value="40.6 -73.8 1.4 104 1000e3 20" />
      </p>
      <p>
        Output format:&nbsp;&nbsp;<label for="pg">
          <input type="radio" value="g" name="format" id="pg" checked>
          decimal degrees
        </label>&nbsp;
        <label for="pd">
          <input type="radio" value="d" name="format" id="pd">
          degrees minutes seconds
        </label><br>
        Output precision:&nbsp;&nbsp;<select name="prec" size=1>
          <option value='0' selected> 1m 0.00001d 0.1"</option>
          <option value='1'> 100mm 0.01"</option>
          <option value='2'> 10mm 0.001"</option>
          <option value='3'> 1mm 0.0001"</option>
          <option value='4'> 100um 0.00001"</option>
          <option value='5'> 10um 0.000001"</option>
          <option value='6'> 1um 0.0000001"</option>
          <option value='7'> 100nm 0.00000001"</option>
          <option value='8'> 10nm 0.000000001"</option>
          <option value='9'> 1nm 0.0000000001"</option>
        </select>
      </p>
      <p>
        <input type="button" value="COMPUTE"
               onclick="var t = GeodesicInversePath(document.path.input.value,
                                document.path.format[1].checked,
                                document.path.prec.selectedIndex);
                        document.path.status.value = t.status;
                        document.path.points.value = t.points;" />
      </p>
      <p>
        status:
        <input name="status" size=50 readonly />
      </p>
      <p>
        points (lat lon azi):<br>
        <textarea name="points" cols=70 rows=21 readonly></textarea>
      </p>
    </form>
    <hr>
    <form name="area">
      <h3><a class="anchor" id="area">Polygon area</h3>
      <p>
        Find the perimeter and area of a polygon whose sides are
        geodesics.  The polygon must be simple (i.e., must not intersect
        itself).  (There's no need to ensure that the polygon is
        closed.)  Counter-clockwise traversal of the polygon results in
        a positive area.  The polygon can encircle one or both poles.
        The sample gives the approximate perimeter (in m) and area (in
        m<sup>2</sup>) of Antarctica.  (For this example, Google Earth
        Pro returns an area which is 30 times too large!  However this
        is a little unfair, since Google Earth has no concept of
        polygons which encircle a pole.)  If the <i>polyline</i> option
        is selected then just the length of the line joining the points
        is returned.  To perform the calculation, press the
        &ldquo;COMPUTE&rdquo; button.
      </p>
      <p>Enter points, one per line, as <i>&ldquo;lat lon&rdquo;</i>:</p>
      <p>points (lat lon):<br>
        <textarea name="input" cols=36 rows=13>-63.1  -58
-72.9  -74
-71.9 -102
-74.9 -102
-74.3 -131
-77.5 -163
-77.4  163
-71.7  172
-65.9  140
-65.7  113
-66.6   88
-66.9   59
-69.8   25
-70.0   -4
-71.0  -14
-77.3  -33
-77.9  -46
-74.7  -61
</textarea>
      </p>
      <p>
        Treat points as:&nbsp;&nbsp;<label for="lg">
          <input type="radio" value="p" name="polyline" id="lg" checked>
          polygon
        </label>&nbsp;
        <label for="ll">
          <input type="radio" value="l" name="polyline" id="ll">
          polyline
        </label>
      </p>
      <p>
        <input type="button" value="COMPUTE"
               onclick="var t = GeodesicArea(document.area.input.value,
                        document.area.polyline[1].checked);
                        document.area.status.value = t.status;
                        document.area.area.value = t.area;" />
      </p>
      <p>
        status:
        <input name="status" size=50 readonly />
      </p>
      <p>
        number perimeter area:
        <input name="area" size=55 readonly />
      </p>
    </form>
    <hr>
    <address>Charles Karney
      <a href="mailto:charles@karney.com">&lt;charles@karney.com&gt;</a>
      (2015-08-12)</address>
    <br>
    <a href="https://geographiclib.sourceforge.io">
      Geographiclib Sourceforge</a>
  </body>
</html>