";
c.sort(function(a,b){return b[0]-a[0]});
legend1 = ""; //this is a separate variable because we are going to be adding to it from the bottom up
c_radii[det_index] = [];
var circs=0;
for(rec in c) {
switch (c[rec][1]) {
case "therm":
switch(c[rec][2]) {
case "_3rd-100":
var t_text = "3rd degree burns";
var t_extra = "100% probability for 3rd degree burns at this yield is "+Math.round(bc.thermal_radiation_param_q(kt,c[rec][2]),1)+" cal/cm
2.";
var caption = "Third degree burns extend throughout the layers of skin, and are often painless because they destroy the pain nerves. They can cause severe scarring or disablement, and can require amputation.";
break;
case "_3rd-50":
var t_text = "3rd degree burns (50%)";
var t_extra = "50% probability for 3rd degree burns at this yield is "+Math.round(bc.thermal_radiation_param_q(kt,c[rec][2]),1)+" cal/cm
2.";
var caption = "Third degree burns extend throughout the layers of skin, and are often painless because they destroy the pain nerves. They can cause severe scarring or disablement, and can require amputation.";
break;
case "_2nd-50":
var t_text = "2nd degree burns (50%)";
var t_extra = "50% probability for 2nd degree burns at this yield is "+Math.round(bc.thermal_radiation_param_q(kt,c[rec][2]),1)+" cal/cm
2.";
var caption = "Second degree burns are deeper burns to several layers of the skin. They are very painful and require several weeks to heal. Extreme second degree burns can produce scarring or require grafting.";
break;
case "_1st-50":
var t_text = "1st degree burns (50%)";
var t_extra = "50% probability for 1st degree burns at this yield is "+Math.round(bc.thermal_radiation_param_q(kt,c[rec][2]),1)+" cal/cm
2.";
var caption = "First degree burns are superficial burns to the outer layers of the skin. They are painful but heal in 5-10 days. They are more or less the same thing as a sunburn.";
break;
case "_noharm-100":
var t_text = "no harm";
var t_extra = "100% probability of no significant thermal damage at this yield is "+Math.round(bc.thermal_radiation_param_q(kt,c[rec][2]),1)+" cal/cm
2.";
var caption = "The distance at which anybody beyond would definitely suffer no damage from thermal radiation (heat).";
break;
default:
var t_text = "";
var t_extra = "";
var caption = "";
break;
}
if(t_text) {
legend1 = "
Thermal radiation radius ("+t_text+"): "+distance(c[rec][0]*mi2km,true)+"
"+caption+" "+t_extra+""+legend1;
} else {
legend1 = "
Thermal radiation radius ("+c[rec][2]+" cal/cm
2): "+distance(c[rec][0]*mi2km,true)+(caption?"
"+caption+"":"")+legend1;
}
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: true,
fillColor: "#FFA500",
fillOpacity: .3,
stroke: true,
color: "#FFA500",
opacity: 1,
weight: 1,
zIndex: (circs+1)+(det_index+1)*10,
title: (t_text?"Thermal radiation radius ("+t_text+")":"Thermal radiation radius ("+c[rec][2]+" cal/cm
2)"),
},marker,pos);
break;
case "psi":
var p = parseInt(c[rec][2]);
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: true,
fillColor: "#"+colorStep(p-5,20,"808080","FF0000","800000","800000"),
fillOpacity: p>=5?.3:lerp(.3,5,.2,1,p),
stroke: true,
color: "#"+colorStep(p-5,20,"808080","FF0000","800000","800000"),
opacity: p>=5?1:lerp(1,5,.5,1,p),
weight: p<5?1:2,
zIndex: (circs+1)+(det_index+1)*10,
title: "Air blast radius ("+addCommas(p)+" psi)",
},marker,pos);
switch(true) {
case (p == 10000):
var caption = "10,000 psi is approximately the pressure felt at 4 miles under the ocean. Not much can withstand this.";
break;
case (p == 7000):
var caption = "7,000 psi is supposedly the maximum amount of pressure that super-hardened American missile silos can withstand.";
break;
case (p<10000&&p>1000):
var caption = "Missile silos can be blast hardened to survive many thousand psi of pressure, but not much else can.";
break;
case (p == 200):
var caption = "200 psi is approximately the pressure felt inside of a steam boiler on a locomotive. Extreme damage to all civilian structures, some damage to even "hardened" structures.";
break;
case (p == 20):
var caption = "At 20 psi overpressure, heavily built concrete buildings are severely damaged or demolished; fatalities approach 100%. Often used as a benchmark for
heavy damage in cities.";
break;
case (p < 20 && p > 5):
var caption = "Between moderate and heavy damage in cities.";
break;
case (p == 5):
var caption = "At 5 psi overpressure, most residential buildings collapse, injuries are universal, fatalities are widespread. The chances of a fire starting in commercial and residential damage are high, and buildings so damaged are at high risk of spreading fire. Often used as a benchmark for
moderate damage in cities.";
break;
case (p < 5 && p > 1):
var caption = "Between light and moderate damage in cities. Buildings damaged with between 2 and 5 psi of blast are considered a major risk for fire spread (because they are damaged but still standing).";
break;
case (p == 1):
var caption = "At a around 1 psi overpressure, glass windows can be expected to break. This can cause many injuries in a surrounding population who comes to a window after seeing the flash of a nuclear explosion (which travels faster than the pressure wave). Often used as a benchmark for
light damage in cities.";
break;
default:
var caption = "";
break;
}
if(airburst) {
caption+=" Optimal height of burst to maximize this effect is "+distance(bc.opt_height_for_psi(kt,c[rec][2])*ft2km)+".";
}
var legend2 = "
";
switch(p) {
case 20: legend2+="Heavy blast damage radius (20 psi):"; break;
case 5: legend2+="Moderate blast damage radius (5 psi):"; break;
case 1: legend2+="Light blast damage radius (1 psi):"; break;
default: legend2+= "Air blast radius ("+addCommas(c[rec][2])+" psi):";
}
legend1 = legend2+" "+distance(c[rec][0]*mi2km,true)+(caption?"
"+caption+"":"")+legend1;
break;
case "rem":
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: true,
fillColor: "#00FF00",
fillOpacity: .3,
stroke: true,
color: "#00FF00",
opacity: 1,
weight: 1,
zIndex: (circs+1)+(det_index+1)*10,
title: "Radiation radius ("+(c[rec][2])+" rem)",
},marker,pos);
//linear fit to NAPB-90 data, table B-2, which is just LNT. cancer risk.
var c_risk =0.0303*(c[rec][2])-0.2065;
if(c_risk<1) {
c_risk = "less than 1%";
} else if(c_risk>100) {
c_risk = "100%";
} else {
c_risk = Math.round(c_risk)+"%";
}
//incapacitation and death info comes from Jorma K. Miettinen, "Enhanced Radiation Warfare," BAS 33, no. 7 (1977), 32-37.
var caption = addCommas(c[rec][2])+" rem ionizing radiation dose; ";
if(c[rec][2]>=17000) {
caption+="fatal, incapacitating within five minutes, death within one day."; //no need to talk about survivors
} else if(c[rec][2]>=7000) {
caption+="fatal, incapacitating within five minutes, death within one to two days."; //no need to talk about survivors
} else if (c[rec][2]>=1000) {
caption+="fatal, incapacitating within five minutes with recovery period, death within four to six days."; //no need to talk about survivors
} else if (c[rec][2]>=1000) {
caption+="fatal, in two weeks or less."; //no need to talk about survivors
} else if(c[rec][2]>=500) {
caption+="likely fatal, in about 1 month; "+c_risk+" of survivors will eventually die of cancer as a result of exposure.";
} else if(c[rec][2]>=250) {
caption+="sickness inducing, medical care would be required, some deaths in 30-60 days; "+c_risk+" of survivors will eventually die of cancer as a result of exposure.";
} else if(c[rec][2]>=100) {
caption+="sickness inducing, less than 5% chance of death in 60 days; "+c_risk+" of survivors will die of cancer as a result of exposure.";
} else if(c[rec][2]>0) {
caption+="no immediate symptoms; "+c_risk+" of survivors will die of cancer as a result of exposure.";
}
legend1 = "
Radiation radius ("+(c[rec][2])+" rem): "+distance(c[rec][0]*mi2km,true)+(caption?"
"+caption+"":"")+legend1;
break;
case "fireball":
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: true,
fillColor: "#FFA500",
fillOpacity: airburst?.3:.5,
stroke: true,
color: "#FFFF00",
opacity: airburst?.8:1,
weight: airburst?1:2,
zIndex: (circs+1)+(det_index+1)*10,
title: "Fireball radius",
},marker,pos);
var caption = "Maximum size of the nuclear fireball; relevance to damage on the ground depends on the height of detonation. If it touches the ground, the amount of radioactive fallout is significantly increased. Anything inside the fireball is effectively vaporized. ";
if(airburst) caption+=" Minimum burst height for negligible fallout: "+distance(bc.minimum_height_for_negligible_fallout(kt)*mi2km)+".";
legend1 = "
Fireball radius: "+distance(c[rec][0]*mi2km,true) + "
"+caption+""+legend1;
break;
case "crater_lip":
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: true,
fillColor: "#2E2E2E",
fillOpacity: .5,
stroke: true,
color: "#2E2E2E",
opacity: 1,
weight: 1,
zIndex: (circs+1)+(det_index+1)*10,
title: "Crater lip radius",
},marker,pos);
legend1 = "
Crater lip radius: "+distance(c[rec][0]*mi2km,true) + legend1;
break;
case "crater_apparent":
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: true,
fillColor: "#2E2E2E",
fillOpacity: .5,
stroke: true,
color: "#2E2E2E",
opacity: 1,
weight: 1,
zIndex: (circs+1)+(det_index+1)*10,
title: "Crater inner radius",
},marker,pos);
legend1 = "
"+"
"+"
Crater inside radius: "+distance(c[rec][0]*mi2km,true) +"
↓
Crater depth: "+ distance(cr[2]*5280*ft2km,false) + legend1;
break;
case "cep":
c_radii[det_index][circs] = newCircle({
map: map,
radius: c[rec][0]*mi2m,
fill: false,
fillColor: "#0000FF",
fillOpacity: 0,
stroke: true,
color: "#"+colorStep(c[rec][0],50,"8080FF","0000FF"),
opacity: .8,
weight: 1,
zIndex: (circs+1)+(det_index+1)*10,
title: "Circular Error Probable ("+c[rec][2]+"%)",
},marker,pos);
var caption ="The radius (based on the user-defined CEP of "+distance(cep_ft*ft2km,false)+") where the bomb or warhead has a "+c[rec][2]+"% chance of landing.";
legend1 = "
Circular Error Probable ("+c[rec][2]+"%): "+distance(c[rec][0]*mi2km,true) + "
"+caption+""+legend1;
break;
};
circs++;
};
var big_bounds = LatLngBounds();
if(c_radii[det_index].length) {
big_bounds = getBounds(c_radii[det_index][0]);
if((document.getElementById("option_autozoom").checked == true) && (override_autozoom != true)) fitBounds(map, big_bounds);
}
if(cloud) {
//all of these are in FEET
var cloud_final_horizontal_semiaxis = bc.cloud_final_horizontal_semiaxis(kt);
var cloud_final_height = bc.cloud_top(kt);
var cloud_final_vertical_semiaxis = (cloud_final_height-bc.cloud_bottom(kt))/2;
top_altitude = cloud_final_height;
head_diameter = cloud_final_horizontal_semiaxis*2;
head_height = cloud_final_vertical_semiaxis*2;
var legend2="";
legend2+= "
"+"
";
legend2+= "
↑
";
legend2+= "Mushroom cloud altitude: "+distance(top_altitude*ft2km,false);
legend2+= "
↔
";
legend2+= "Mushroom cloud head diameter: "+ distance(head_diameter*ft2km,false);
legend2+= "
↕
";
legend2+= "Mushroom cloud head height: "+ distance(head_height*ft2km,false);
legend2+= "
";
legend1=legend1+legend2;
}
if(airburst) {
legend1+="
";
if(hob_ft||hob_ft===0) {
legend1+= "*Detonation altitude: "+distance(hob_ft*ft2km,false,false,true)+".";
if(hob_opt==1) {
legend1+=" (Chosen to maximize the "+addCommas(hob_opt_psi)+" psi range.)";
}
} else {
legend1+= "*Effects shown for multiple, different detonation altitudes.";
}
legend1+="
";
}
legend = legend + legend1;
if(errs.length) {
legend+="
The following errors were encountered trying to implement these settings:";
legend+="
";
for(var i=0;i"+errs[i]+"";
}
legend+="
";
}
legend = legend + "
Note: Rounding accounts for any inconsistencies in the above numbers."
if(kt>20000) legend = legend + " Also, yields above 20 Mt are derived from a scaling of 20 Mt yields, and are not as validated as those under 20 Mt."
if(kt<1) legend = legend + " Also, yields under 1 kt are derived from a scaling of 1 kt yields, and are not as validated as those over 1 kt."
legend = legend + "";
legend = "
"+legend+"
";
legend+= "
"; //collapsable content div
legends[det_index] = legend;
if(det_index>0) {
legend+="