src/layers/craters/profiles/martin_parkes_dunstan.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | |||
| 3 | #include "terraingen/layers/craters/profiles/martin_parkes_dunstan.h" | ||
| 4 | |||
| 5 | #include <stdexcept> | ||
| 6 | |||
| 7 | namespace terraingen { | ||
| 8 | |||
| 9 | 6651613 | double MartinParkesDunstanProfile::Height(double distance, double diameter, | |
| 10 | const CraterState& state) const { | ||
| 11 | 6651613 | const CraterMorphometry& current = state.current; | |
| 12 | 6651613 | if (!(current.depthRatio > 0.0 && current.rimHeightRatio >= 0.0 && | |
| 13 | 6651611 | current.rimHeightRatio <= state.fresh.rimHeightRatio)) { | |
| 14 | 3 | throw std::invalid_argument( | |
| 15 | 3 | "Crater state needs a positive depth and 0 <= rim height <= fresh rim height"); | |
| 16 | } | ||
| 17 | 6651610 | return static_cast<double>(SimpleProfileHeight(m_kernel, static_cast<float>(distance), | |
| 18 | static_cast<float>(diameter), | ||
| 19 | 6651610 | KernelStateRecord(diameter, state))); | |
| 20 | } | ||
| 21 | |||
| 22 | } // namespace terraingen | ||
| 23 |