The Richter scale — a nonlinear (log/exp) conversion between an earthquake's
magnitude and its radiated seismic energy, ported from Frink's Richter[n]
function (Choy–Boatwright 1995). Because the scale is logarithmic, every result
is irrational ⇒ an ApproxQuantity.
(require '[commensura.richter :as r] '[commensura.core :refer [to]]) (r/magnitude->energy 7.0) ;=> ~2.0e15 joule (r/energy->magnitude (r/magnitude->energy 7.0)) ;=> ~7.0 richter
richter is a dimensionless marker unit, so a computed magnitude prints as
6.9 richter [dimensionless] rather than a bare number.
The Richter scale — a nonlinear (log/exp) conversion between an earthquake's magnitude and its radiated seismic energy, ported from Frink's `Richter[n]` function (Choy–Boatwright 1995). Because the scale is logarithmic, every result is irrational ⇒ an `ApproxQuantity`. (require '[commensura.richter :as r] '[commensura.core :refer [to]]) (r/magnitude->energy 7.0) ;=> ~2.0e15 joule (r/energy->magnitude (r/magnitude->energy 7.0)) ;=> ~7.0 richter `richter` is a dimensionless marker unit, so a computed magnitude prints as `6.9 richter [dimensionless]` rather than a bare number.
(energy->magnitude e)Radiated seismic energy (any energy-dimensioned quantity) → its Richter
magnitude: m = -2.9 + 0.28953·ln(E/J).
Radiated seismic energy (any energy-dimensioned quantity) → its Richter magnitude: `m = -2.9 + 0.28953·ln(E/J)`.
(magnitude->energy m)A Richter magnitude (dimensionless number or richter-denominated quantity) →
radiated seismic energy: E = 22387 · e^(3.45388·m) J.
A Richter magnitude (dimensionless number or `richter`-denominated quantity) → radiated seismic energy: `E = 22387 · e^(3.45388·m) J`.
A point on the Richter magnitude scale (dimensionless).
A point on the Richter magnitude scale (dimensionless).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |