Bez tytułu

z Gamboge Armadillo, 2 dni temu, napisane w Plain Text, wyświetlone 1 razy. [paste_expire] 10 miesiące.
URL https://pastebin.k4be.pl/view/6679a354 Udostępnij
Pobierz wklejkę lub Pokaż surowy tekst
  1. 272:
  2. 273: function summarytxt(e){
  3. 274:     var layer = e.target;
  4. 275:     // pcco2=layer.feature.properties.co2pc;
  5. 276:
  6. 277:     if (layer.feature.properties.co2pc<emissions){
  7. 278:            ratio=emissions/layer.feature.properties.co2pc;
  8. 279:            stringplus="This flight produces (per passenger) the same amount of greenhouse gases as "+ratio.toFixed(1)+" average resident of "+layer.feature.properties.name +" did in 2017.";
  9. 280:     } else {
  10. 281:            ratio=layer.feature.properties.co2pc/emissions;
  11. 282:            stringplus="This average resident of "+layer.feature.properties.name +" produced the same amount of greenhouse gases in 2017 as "+ratio.toFixed(1) +" of these flights (per passenger)";
  12. 283:     }
  13. 284:
  14. 285:     hoverstring="<span id='hovername'>"+layer.feature.properties.name+":</span> "+layer.feature.properties.co2pc+" tonnes CO<sub>2</sub> per capita<br>"+stringplus;
  15. 286:
  16. 345:
  17. 346: //constants for equation
  18. 347: shDC=50;
  19. 348: lhDC=125;
  20. 349: ash=3.87871E-05;
  21. 350: alh=0.000134576;
  22. 351: bsh=2.9866;
  23. 352: csh=1263.42;
  24. 353: blh=6.1798;
  25. 354: clh=3446.20;
  26. 355: Ssh=158.44;
  27. 356: Slh=280.39;
  28. 357: Plf=0.77;
  29. 358: passF=0.951;
  30. 359: ecosh=0.96;
  31. 360: ecolh=0.8;
  32. 361: bussh=1.26;
  33. 362: buslh=1.54;
  34. 363: fcsh=2.4;
  35. 364: fclh=2.4;
  36. 365: EF=3.150;
  37. 366: pp=0.51;
  38. 367: Mnonco2=2;
  39. 389:    eraseErrorMsg();
  40. 390:
  41. 391:    origin=airportdata[fromindex];
  42. 392:    destination=airportdata[toindex];
  43. 393:
  44. 394:    origincoord=[origin.Lat,origin.Long];
  45. 395:    destcoord=[destination.Lat,destination.Long];
  46. 396:
  47. 397:    greatcircledist=getDistance(origincoord,destcoord)/1000; //units of km
  48. 398:
  49. 399:    if (greatcircledist<1500){
  50. 400:            CW=ecosh;
  51. 401:            dist2=greatcircledist+shDC;
  52. 402:            flightdist= (dist2);
  53. 403:            emissions2=((ash*flightdist**2+bsh*flightdist+csh)/(Ssh*Plf))*passF*CW*(EF*Mnonco2+pp)*2/1000;
  54. 404:
  55. 405:    } else {
  56. 406:            CW=ecolh;
  57. 407:            dist2=greatcircledist+lhDC;
  58. 408:            flightdist= (dist2);
  59. 409:            emissions2=((alh*flightdist**2+blh*flightdist+clh)/(Slh*Plf))*passF*CW*(EF*Mnonco2+pp)*2/1000;
  60. 410:
  61. 438:
  62. 439: function getDistance(origin, destination) {
  63. 440:     // return distance in meters
  64. 441:     var lon1 = toRadian(origin[1]),
  65. 442:         lat1 = toRadian(origin[0]),
  66. 443:         lon2 = toRadian(destination[1]),
  67. 444:         lat2 = toRadian(destination[0]);
  68. 445:
  69. 446:     var deltaLat = lat2 - lat1;
  70. 447:     var deltaLon = lon2 - lon1;
  71. 448:
  72. 449:     var a = Math.pow(Math.sin(deltaLat/2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(deltaLon/2), 2);
  73. 450:     var c = 2 * Math.asin(Math.sqrt(a));
  74. 451:     var EARTH_RADIUS = 6371;
  75. 452:     return c * EARTH_RADIUS * 1000;

odpowiedź "Bez tytułu"

Tutaj możesz odpowiedzieć na wklejkę z góry

captcha