|
|
|
@@ -442,55 +442,51 @@ function customarySymLength(m, singular = false) { |
|
|
|
} |
|
|
|
|
|
|
|
function approxLength(m, singular = false) { |
|
|
|
if (m < 25) { |
|
|
|
if (m < 0.8) { |
|
|
|
let length = round(m / 0.4, 1); |
|
|
|
return length + (singular || length == 1 ? " cinderblock" : " cinderblocks"); |
|
|
|
} else if (m < 0.9) { |
|
|
|
let length = round(1, 1); |
|
|
|
return length + (singular || length == 1 ? " baseball bat" : " baseball bats"); |
|
|
|
} else if (m < 25) { |
|
|
|
let length = round(m / 1.9, 1); |
|
|
|
return length + (singular || length == 1 ? " person" : " people"); |
|
|
|
return length + (singular || length == 1 ? " person" : " people"); |
|
|
|
} else if (m < 350) { |
|
|
|
let length = round(m / 49, 1); |
|
|
|
return ( |
|
|
|
length + |
|
|
|
(singular || length == 1 ? " football field" : " football fields") |
|
|
|
); |
|
|
|
return length + (singular || length == 1 ? " football field" : " football fields"); |
|
|
|
} else if (m < 20000) { |
|
|
|
let length = round(m / 449, 1); |
|
|
|
return ( |
|
|
|
length + |
|
|
|
(singular || length == 1 |
|
|
|
? " Empire State Building" |
|
|
|
: " Empire State Buildings") |
|
|
|
); |
|
|
|
return length +(singular || length == 1 ? " Empire State Building" : " Empire State Buildings"); |
|
|
|
} else if (m < 2000000) { |
|
|
|
let length = round(m / 80467.2, 1); |
|
|
|
return ( |
|
|
|
length + (singular || length == 1 ? " Panama Canal" : " Panama Canals") |
|
|
|
); |
|
|
|
return length + (singular || length == 1 ? " Panama Canal" : " Panama Canals"); |
|
|
|
} else if (m < 3474574 * 2) { |
|
|
|
let length = round(m / 3474574, 1); |
|
|
|
return length + (singular || length == 1 ? " Moon" : " moons"); |
|
|
|
return length + (singular || length == 1 ? " Moon" : " moons"); |
|
|
|
} else if (m < 12.742e6 * 130) { |
|
|
|
let length = round(m / 12.742e6, 2); |
|
|
|
return length + (singular || length == 1 ? " Earth" : " earths"); |
|
|
|
return length + (singular || length == 1 ? " Earth" : " earths"); |
|
|
|
} else if (m < 149.6e12) { |
|
|
|
let length = round(m / 149.6e9, 3); |
|
|
|
return length + (singular || length == 1 ? " AU" : " AUs"); |
|
|
|
return length + (singular || length == 1 ? " AU" : " AUs"); |
|
|
|
} else if (m < 9.4607e22) { |
|
|
|
let length = round(m / 9.4607e15, 3); |
|
|
|
return length + (singular || length == 1 ? " light year" : " light years"); |
|
|
|
return length + (singular || length == 1 ? " light year" : " light years"); |
|
|
|
} else if (m < 3e19) { |
|
|
|
let length = round(m / 3.0856776e16, 3); |
|
|
|
return length + (singular || length == 1 ? " parsec" : " parsecs"); |
|
|
|
return length + (singular || length == 1 ? " parsec" : " parsecs"); |
|
|
|
} else if (m < 3e22) { |
|
|
|
let length = round(m / 3.0856776e19, 3); |
|
|
|
return length + (singular || length == 1 ? " kiloparsec" : " kiloparsecs"); |
|
|
|
return length + (singular || length == 1 ? " kiloparsec" : " kiloparsecs"); |
|
|
|
} else if (m < 3e25) { |
|
|
|
let length = round(m / 3.0856776e22, 3); |
|
|
|
return length + (singular || length == 1 ? " megaparsec" : " megaparsecs"); |
|
|
|
return length + (singular || length == 1 ? " megaparsec" : " megaparsecs"); |
|
|
|
} else if (m < 3e28) { |
|
|
|
let length = round(m / 3.0856776e25, 3); |
|
|
|
return length + (singular || length == 1 ? " gigaparsec" : " gigaparsecss"); |
|
|
|
return length + (singular || length == 1 ? " gigaparsec" : " gigaparsecss"); |
|
|
|
} else { |
|
|
|
let length = round(m / 3.0856776e28, 3); |
|
|
|
return length + (singular || length == 1 ? " teraparsec" : " teraparsecs"); |
|
|
|
return length + (singular || length == 1 ? " teraparsec" : " teraparsecs"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|