33 135.0, 150.0, 180.0, 225.0, 270.0, 360.0};
37 std::numbers::pi_v<RealType> / 6.0,
38 std::numbers::pi_v<RealType> / 4.0,
39 std::numbers::pi_v<RealType> / 3.0,
40 std::numbers::pi_v<RealType> / 2.0,
41 2.0 * std::numbers::pi_v<RealType> / 3.0,
42 3.0 * std::numbers::pi_v<RealType> / 4.0,
43 5.0 * std::numbers::pi_v<RealType> / 6.0,
44 std::numbers::pi_v<RealType>};
56 return is_close(value, std::round(value), 1
e-6);
67 const std::ranges::input_range
auto&
candidates)
noexcept
87 const RealType pi = std::numbers::pi_v<RealType>;
88 for (
int numerator = 1; numerator <= 12; ++numerator)
90 for (
int denominator = 1; denominator <= 12; ++denominator)
92 if (std::gcd(numerator, denominator) != 1)
111 constexpr std::array<RealType, 5>
clean_values = {0.0, 0.5, std::numbers::sqrt2_v<RealType> / 2.0,
112 std::numbers::sqrt3_v<RealType> / 2.0, 1.0};
127 const RealType pi = std::numbers::pi_v<RealType>;
167 if ((std::fmod(
rounded, 45.0) == 0.0) || (std::fmod(
rounded, 30.0) == 0.0) ||
168 (std::fmod(
rounded, 15.0) == 0.0) || (std::fmod(
rounded, 10.0) == 0.0) ||
169 (std::fmod(
rounded, 5.0) == 0.0))
195 const RealType pi = std::numbers::pi_v<RealType>;
198 (std::abs(
result.degree_score -
result.radian_score) > 1))
311 const ValueKind kind,
const std::string_view source,
312 const std::string_view
owner,
const std::string_view
field)
321 std::format(
"{} rotation {} '{}' looks like {} but '{}' was declared (confidence: {}, value: {}). "
322 "Change rotationangleunit or convert existing values.",
void maybe_warn_about_rotation_value(const RealType value, const params::RotationAngleUnit declared_unit, const ValueKind kind, const std::string_view source, const std::string_view owner, const std::string_view field)
Emits or captures a warning when a rotation value likely uses the wrong unit.