./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
8 / 8
100.0%
Branches:
7 / 7
100.0%
Functions:
1 / 1
100.0%

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
4/4
✓ Branch 0 taken 6651612 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 6651611 times.
✓ Branch 3 taken 1 time.
6651613 if (!(current.depthRatio > 0.0 && current.rimHeightRatio >= 0.0 &&
13
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 6651610 times.
6651611 current.rimHeightRatio <= state.fresh.rimHeightRatio)) {
14 3 throw std::invalid_argument(
15
1/1
✓ Branch 2 taken 3 times.
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