diff --git a/source/calc.hpp b/source/calc.hpp index 23ff737..5bf9a4a 100644 --- a/source/calc.hpp +++ b/source/calc.hpp @@ -32,8 +32,7 @@ inline DegFT CalculateTemperatureAtAltitudeMcCoy(FeetT altitude, // https://wikipedia.org/wiki/Barometric_formula inline InHgT BarometricFormula(FeetT altitude, InHgT pressure, DegFT temperature) { - const double kGasConstant = 1716.49; // ft-lb / slug^{-1}R^{-1} - const double kMolarMassOfAir = 28.9644; // lb/lb-mol + const double kGasConstant = 1716.49; // ft-lb / slug^{-1}R^{-1} const FeetT kHeight = std::min(altitude, FeetT(kIsaTropopauseAltitudeFt)); const double kExponent = @@ -46,12 +45,9 @@ inline InHgT BarometricFormula(FeetT altitude, InHgT pressure, if (altitude > FeetT(kIsaTropopauseAltitudeFt)) { const double kNumberator = -1.0 * kStandardGravityFtPerSecSq * - kMolarMassOfAir * (altitude - kIsaTropopauseAltitudeFt).Value(); - const double kDemoninator = kGasConstant * DegRT(DegFT(kIsaMinimumTempDegF)).Value(); - output *= std::exp(kNumberator / kDemoninator); } diff --git a/source/lob_builder.cpp b/source/lob_builder.cpp index d40e023..d910f9f 100644 --- a/source/lob_builder.cpp +++ b/source/lob_builder.cpp @@ -68,15 +68,8 @@ Builder::~Builder() { pimpl_->~Impl(); } Builder::Builder(const Builder& other) : pimpl_(new(buffer_.data()) Impl(*other.pimpl_)) {} -Builder::Builder(Builder&& other) noexcept { - if (this != &other) { - if (pimpl_ != nullptr) { - pimpl_->~Impl(); - } - pimpl_ = new (buffer_.data()) Impl(); - std::swap(pimpl_, other.pimpl_); - } -} +Builder::Builder(Builder&& other) noexcept + : pimpl_(new(buffer_.data()) Impl(std::move(*other.pimpl_))) {} Builder& Builder::operator=(const Builder& rhs) { if (this != &rhs) { @@ -93,8 +86,7 @@ Builder& Builder::operator=(Builder&& rhs) noexcept { if (pimpl_ != nullptr) { pimpl_->~Impl(); } - pimpl_ = new (buffer_.data()) Impl(); - std::swap(pimpl_, rhs.pimpl_); + pimpl_ = new (buffer_.data()) Impl(std::move(*rhs.pimpl_)); } return *this; } @@ -141,10 +133,6 @@ Builder& Builder::BCAtmosphere(AtmosphereReferenceT type) { Builder& Builder::BCDragFunction(DragFunctionT type) { switch (type) { - case DragFunctionT::kG1: { - pimpl_->pdrag_lut = &kG1Drags; - break; - } case DragFunctionT::kG2: { pimpl_->pdrag_lut = &kG2Drags; break; @@ -165,7 +153,9 @@ Builder& Builder::BCDragFunction(DragFunctionT type) { pimpl_->pdrag_lut = &kG8Drags; break; } + case DragFunctionT::kG1: default: { + pimpl_->pdrag_lut = &kG1Drags; break; } } @@ -549,6 +539,40 @@ void BuildStability(Impl* pimpl) { FpsT(pimpl->build.velocity)); } +void BuildCoriolis(Impl* pimpl) { + assert(pimpl != nullptr); + + if (!std::isnan(pimpl->azimuth_rad) && !std::isnan(pimpl->latitude_rad)) { + const DegreesT kAzimuthLimit(kDegreesPerTurn); + if (pimpl->azimuth_rad > kAzimuthLimit || + pimpl->azimuth_rad < kAzimuthLimit * -1) { + pimpl->build.error = ErrorT::kAzimuthOOR; + return; + } + const DegreesT kLatitudeLimit(90); + if (pimpl->latitude_rad > kLatitudeLimit || + pimpl->latitude_rad < kLatitudeLimit * -1) { + pimpl->build.error = ErrorT::kLatitudeOOR; + return; + } + // Coriolis Effect Page 178 of Modern Exterior Ballistics - McCoy + const double kCosL = std::cos(pimpl->latitude_rad).Value(); + const double kSinA = std::sin(pimpl->azimuth_rad).Value(); + const double kSinL = std::sin(pimpl->latitude_rad).Value(); + const double kCosA = std::cos(pimpl->azimuth_rad).Value(); + + pimpl->build.corilolis.cos_l_sin_a = + 2 * kAngularVelocityOfEarthRadPerSec * kCosL * kSinA; + pimpl->build.corilolis.sin_l = 2 * kAngularVelocityOfEarthRadPerSec * kSinL; + pimpl->build.corilolis.cos_l_cos_a = + 2 * kAngularVelocityOfEarthRadPerSec * kCosL * kCosA; + } else { + pimpl->build.corilolis.cos_l_sin_a = 0; + pimpl->build.corilolis.sin_l = 0; + pimpl->build.corilolis.cos_l_cos_a = 0; + } +} + void BuildBoatright(Impl* pimpl) { assert(pimpl != nullptr); assert(pimpl->pdrag_lut != nullptr); @@ -643,7 +667,6 @@ void BuildBoatright(Impl* pimpl) { SecT t(0.0); static const FpsT kTransonicBarrier(MachT(1.2), kSos); - while (s.V().X() > kTransonicBarrier) { assert(t < SecT(60) && "This is taking too long"); SolveStep(&s, &t, pimpl->build); @@ -701,40 +724,6 @@ void BuildLitzAerodynamicJump(Impl* pimpl) { } } -void BuildCoriolis(Impl* pimpl) { - assert(pimpl != nullptr); - - if (!std::isnan(pimpl->azimuth_rad) && !std::isnan(pimpl->latitude_rad)) { - const DegreesT kAzimuthLimit(kDegreesPerTurn); - if (pimpl->azimuth_rad > kAzimuthLimit || - pimpl->azimuth_rad < kAzimuthLimit * -1) { - pimpl->build.error = ErrorT::kAzimuthOOR; - return; - } - const DegreesT kLatitudeLimit(90); - if (pimpl->latitude_rad > kLatitudeLimit || - pimpl->latitude_rad < kLatitudeLimit * -1) { - pimpl->build.error = ErrorT::kLatitudeOOR; - return; - } - // Coriolis Effect Page 178 of Modern Exterior Ballistics - McCoy - const double kCosL = std::cos(pimpl->latitude_rad).Value(); - const double kSinA = std::sin(pimpl->azimuth_rad).Value(); - const double kSinL = std::sin(pimpl->latitude_rad).Value(); - const double kCosA = std::cos(pimpl->azimuth_rad).Value(); - - pimpl->build.corilolis.cos_l_sin_a = - 2 * kAngularVelocityOfEarthRadPerSec * kCosL * kSinA; - pimpl->build.corilolis.sin_l = 2 * kAngularVelocityOfEarthRadPerSec * kSinL; - pimpl->build.corilolis.cos_l_cos_a = - 2 * kAngularVelocityOfEarthRadPerSec * kCosL * kCosA; - } else { - pimpl->build.corilolis.cos_l_sin_a = 0; - pimpl->build.corilolis.sin_l = 0; - pimpl->build.corilolis.cos_l_cos_a = 0; - } -} - void BuildZeroAngle(Impl* pimpl) { assert(pimpl != nullptr); @@ -839,15 +828,15 @@ Input Builder::Build() { if (pimpl_->build.error != ErrorT::kNotFormed) { return pimpl_->build; } - BuildBoatright(pimpl_); + BuildCoriolis(pimpl_); if (pimpl_->build.error != ErrorT::kNotFormed) { return pimpl_->build; } - BuildLitzAerodynamicJump(pimpl_); - BuildCoriolis(pimpl_); + BuildBoatright(pimpl_); if (pimpl_->build.error != ErrorT::kNotFormed) { return pimpl_->build; } + BuildLitzAerodynamicJump(pimpl_); BuildZeroAngle(pimpl_); if (pimpl_->build.error != ErrorT::kNotFormed) { return pimpl_->build; diff --git a/source/lob_solve.cpp b/source/lob_solve.cpp index 858b9f2..279ff3e 100644 --- a/source/lob_solve.cpp +++ b/source/lob_solve.cpp @@ -44,7 +44,7 @@ Output LerpOutput(const TrajectoryStateT& s_now, const SecT t_now, void ApplyGyroscopicSpinDrift(const Input& in, Output* pouts, size_t size) { assert(pouts != nullptr); // If we can apply Boatright-Ruiz spin drift, prefer it - if (in.spindrift_factor > 0) { + if (!std::isnan(in.spindrift_factor)) { for (size_t i = 0; i < size; i++) { pouts[i].deflection += in.spindrift_factor * std::fabs(pouts[i].elevation); @@ -52,7 +52,7 @@ void ApplyGyroscopicSpinDrift(const Input& in, Output* pouts, size_t size) { return; } // If we can apply Litz spin drift, use that - if (std::fabs(in.stability_factor) > 0) { + if (std::fabs(in.stability_factor) > 0.0) { for (size_t i = 0; i < size; i++) { pouts[i].deflection += litz::CalculateGyroscopicSpinDrift(in.stability_factor, diff --git a/test/source/calc_test.cpp b/test/source/calc_test.cpp index 3f3a30b..32d68a5 100644 --- a/test/source/calc_test.cpp +++ b/test/source/calc_test.cpp @@ -17,7 +17,7 @@ namespace tests { TEST(CalcTests, CalculateTemperatureAtAltitude) { // Test data from page 167 of Modern Exterior Ballistics - McCoy - const std::vector kAltitudesFt = { + const std::vector kAltitudesFt = { 0, 500, 1000, 1500, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 15000, 20000, 25000, 30000, 35000}; const std::vector kExpectedResultsDegF = { @@ -37,7 +37,7 @@ TEST(CalcTests, CalculateTemperatureAtAltitude) { TEST(CalcTests, CalculateTemperatureAtAltitudeMcCoy) { // Test data from page 167 of Modern Exterior Ballistics - McCoy - const std::vector kAltitudesFt = { + const std::vector kAltitudesFt = { 0, 500, 1000, 1500, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 15000, 20000, 25000, 30000, 35000}; const std::vector kExpectedResultsDegF = { @@ -59,7 +59,7 @@ TEST(CalcTests, CalculateTemperatureAtAltitudeMcCoy) { TEST(CalcTests, BarometricFormula) { // Test data from page 167 of Modern Exterior Ballistics - McCoy - const std::vector kAltitudesFt = { + const std::vector kAltitudesFt = { 0, 500, 1000, 1500, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 15000, 20000, 25000, 30000, 35000}; const std::vector kExpectedResultsInHg = { @@ -77,6 +77,27 @@ TEST(CalcTests, BarometricFormula) { } } +TEST(CalcTests, BarometricFormulaStratosphere) { + // test data from + // https://www.sensorsone.com/altitude-pressure-units-conversion/ + const std::vector kAltitudesFt = {35000, 40000, 45000, 50000, 55000, + 60000, 65000, 70000, 75000, 80000, + 85000, 90000, 95000, 100000}; + const std::vector kExpectedResultsInHg = { + 7.04, 5.54, 4.36, 3.42, 2.69, 2.12, 1.67, + 1.31, 1.03, 0.82, 0.64, 0.51, 0.41, 0.32}; + const double kError = 0.025; + for (uint32_t i = 0; i < kAltitudesFt.size(); i++) { + EXPECT_NEAR( + kExpectedResultsInHg.at(i), + lob::BarometricFormula(lob::FeetT(kAltitudesFt.at(i)), + lob::InHgT(lob::kIsaSeaLevelPressureInHg), + lob::DegFT(lob::kIsaSeaLevelDegF)) + .Value(), + kError); + } +} + TEST(CalcTests, BarometricFormulaNegative) { constexpr int16_t kAltitude = -1000; constexpr double kExpectedResult = 31.02; @@ -90,7 +111,7 @@ TEST(CalcTests, BarometricFormulaNegative) { TEST(CalcTests, CalculateAirDensityAtAltitude) { // Test data from page 167 of Modern Exterior Ballistics - McCoy - const std::vector kAltitudesFt = { + const std::vector kAltitudesFt = { 0, 500, 1000, 1500, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 15000, 20000, 25000, 30000, 35000}; const double kP0 = lob::kIsaSeaLevelAirDensityLbsPerCuFt; diff --git a/test/source/lob_api_test.cpp b/test/source/lob_api_test.cpp index 30ddaac..6f54e19 100644 --- a/test/source/lob_api_test.cpp +++ b/test/source/lob_api_test.cpp @@ -191,6 +191,12 @@ TEST(LobAPITest, InchToDeg) { EXPECT_DOUBLE_EQ(kA.Value(), lob::IphyT(kB).Value()); } +TEST(LobAPITest, InchToDegZero) { + const auto kA = lob::IphyT(5); + const auto kB = lob::DegreesT(lob::InchToDeg(kA.Value(), 0.0)); + EXPECT_DOUBLE_EQ(0.0, lob::IphyT(kB).Value()); +} + TEST(LobAPITest, JToFtLbs) { const auto kA = lob::JouleT(100); const auto kB = lob::FtLbsT(lob::JToFtLbs(kA.Value())); diff --git a/test/source/lob_builder_test.cpp b/test/source/lob_builder_test.cpp index 29fdc12..c66b7a0 100644 --- a/test/source/lob_builder_test.cpp +++ b/test/source/lob_builder_test.cpp @@ -75,7 +75,6 @@ TEST_F(BuilderTestFixture, MoveConstructor) { EXPECT_EQ(kVal.velocity, kTestMuzzleVelocity); } -// Test for copy assignment operator TEST_F(BuilderTestFixture, CopyAssignmentOperator) { const double kTestBC = 0.425; const double kTestDiameter = 0.308; @@ -95,7 +94,6 @@ TEST_F(BuilderTestFixture, CopyAssignmentOperator) { EXPECT_DOUBLE_EQ(kVal2.velocity, kTestMuzzleVelocity); } -// Test for move assignment operator TEST_F(BuilderTestFixture, MoveAssignmentOperator) { const double kTestBC = 0.425; const double kTestDiameter = 0.308; @@ -156,6 +154,21 @@ TEST_F(BuilderTestFixture, BuildMissingZeroInput) { EXPECT_EQ(kResult.error, lob::ErrorT::kZeroDataRequired); } +TEST_F(BuilderTestFixture, InvalidDragFunctionIsG1) { + const double kTestBC = 1.0; + const uint16_t kTestMuzzleVelocity = 2500U; + const double kTestZeroAngle = 5.59; + const auto kInvalidDragFunction = static_cast(0xFF); + const lob::Input kResult = puut->BallisticCoefficientPsi(kTestBC) + .BCDragFunction(kInvalidDragFunction) + .InitialVelocityFps(kTestMuzzleVelocity) + .ZeroAngleMOA(kTestZeroAngle) + .Build(); + for (size_t i = 0; i < lob::kG1Drags.size(); i++) { + EXPECT_EQ(kResult.drags.at(i), lob::kG1Drags.at(i)); + } +} + TEST_F(BuilderTestFixture, BuildG1UsingCustomTable) { const double kTestBC = 1.0; const uint16_t kTestMuzzleVelocity = 2500U; diff --git a/test/source/lob_cwaj_test.cpp b/test/source/lob_cwaj_test.cpp index 569133d..8fca454 100644 --- a/test/source/lob_cwaj_test.cpp +++ b/test/source/lob_cwaj_test.cpp @@ -418,17 +418,17 @@ TEST_F(LobCWAJTestFixture, BoatrightRightHandSpinLeftwardWind) { {0, 3071, 5230, -2.00, 0.00, 0.000}, {150, 2992, 4963, 1.48, -0.15, 0.049}, {300, 2913, 4706, 3.99, -0.63, 0.100}, - {600, 2759, 4221, 5.89, -2.60, 0.206}, - {900, 2609, 3775, 3.21, -6.05, 0.318}, - {1200, 2464, 3366, -4.58, -11.09, 0.436}, - {1500, 2323, 2992, -18.10, -17.87, 0.562}, - {1800, 2187, 2652, -38.07, -26.52, 0.695}, - {2100, 2056, 2344, -65.32, -37.21, 0.836}, - {2400, 1929, 2064, -100.82, -50.11, 0.987}, - {2700, 1806, 1810, -145.65, -65.44, 1.148}, - {3000, 1687, 1579, -201.15, -83.43, 1.319}, - {4500, 1150, 734, -705.94, -225.13, 2.397}, - {6000, 949, 500, -1860.74, -455.01, 3.867}}; + {600, 2759, 4221, 5.89, -2.71, 0.206}, + {900, 2609, 3775, 3.21, -6.50, 0.318}, + {1200, 2464, 3366, -4.58, -11.92, 0.436}, + {1500, 2323, 2992, -18.10, -18.95, 0.562}, + {1800, 2187, 2652, -38.07, -27.89, 0.695}, + {2100, 2056, 2344, -65.32, -38.87, 0.836}, + {2400, 1929, 2064, -100.82, -52.10, 0.987}, + {2700, 1806, 1810, -145.65, -67.79, 1.148}, + {3000, 1687, 1579, -201.15, -86.20, 1.319}, + {4500, 1150, 734, -705.94, -231.13, 2.397}, + {6000, 949, 500, -1860.74, -466.01, 3.867}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); @@ -487,17 +487,17 @@ TEST_F(LobCWAJTestFixture, BoatrightLeftHandSpinLeftwardWind) { {0, 3071, 5230, -2.00, 0.00, 0.000}, {150, 2992, 4963, 0.42, -0.19, 0.049}, {300, 2913, 4706, 1.87, -0.75, 0.100}, - {600, 2759, 4221, 1.63, -3.07, 0.206}, - {900, 2609, 3775, -3.18, -7.09, 0.318}, - {1200, 2464, 3366, -13.09, -12.94, 0.436}, - {1500, 2323, 2992, -28.74, -20.81, 0.562}, - {1800, 2187, 2652, -50.84, -30.86, 0.695}, - {2100, 2056, 2344, -80.21, -43.30, 0.836}, - {2400, 1929, 2064, -117.84, -58.36, 0.987}, - {2700, 1806, 1810, -164.80, -76.31, 1.148}, - {3000, 1687, 1579, -222.42, -97.46, 1.319}, - {4500, 1150, 734, -737.85, -266.99, 2.397}, - {6000, 949, 500, -1903.39, -555.46, 3.868}}; + {600, 2759, 4221, 1.63, -2.87, 0.206}, + {900, 2609, 3775, -3.18, -6.63, 0.318}, + {1200, 2464, 3366, -13.09, -12.29, 0.436}, + {1500, 2323, 2992, -28.74, -19.94, 0.562}, + {1800, 2187, 2652, -50.84, -29.76, 0.695}, + {2100, 2056, 2344, -80.21, -41.94, 0.836}, + {2400, 1929, 2064, -117.84, -56.71, 0.987}, + {2700, 1806, 1810, -164.80, -74.34, 1.148}, + {3000, 1687, 1579, -222.42, -95.14, 1.319}, + {4500, 1150, 734, -737.85, -261.60, 2.397}, + {6000, 949, 500, -1903.39, -545.46, 3.868}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); @@ -555,17 +555,17 @@ TEST_F(LobCWAJTestFixture, BoatrightRightHandSpinRightwardWind) { {0, 3071, 5230, -2.00, 0.00, 0.000}, {150, 2992, 4963, 0.42, 0.19, 0.049}, {300, 2913, 4706, 1.87, 0.75, 0.100}, - {600, 2759, 4221, 1.63, 3.07, 0.206}, - {900, 2609, 3775, -3.18, 7.09, 0.318}, - {1200, 2464, 3366, -13.09, 12.94, 0.436}, - {1500, 2323, 2992, -28.74, 20.81, 0.562}, - {1800, 2187, 2652, -50.84, 30.86, 0.695}, - {2100, 2056, 2344, -80.21, 43.30, 0.836}, - {2400, 1929, 2064, -117.84, 58.36, 0.987}, - {2700, 1806, 1810, -164.80, 76.31, 1.148}, - {3000, 1687, 1579, -222.42, 97.46, 1.319}, - {4500, 1150, 734, -737.85, 266.99, 2.397}, - {6000, 949, 500, -1903.39, 555.46, 3.868}}; + {600, 2759, 4221, 1.63, 2.87, 0.206}, + {900, 2609, 3775, -3.18, 6.63, 0.318}, + {1200, 2464, 3366, -13.09, 12.29, 0.436}, + {1500, 2323, 2992, -28.74, 19.94, 0.562}, + {1800, 2187, 2652, -50.84, 29.76, 0.695}, + {2100, 2056, 2344, -80.21, 41.94, 0.836}, + {2400, 1929, 2064, -117.84, 56.71, 0.987}, + {2700, 1806, 1810, -164.80, 74.34, 1.148}, + {3000, 1687, 1579, -222.42, 95.14, 1.319}, + {4500, 1150, 734, -737.85, 261.60, 2.397}, + {6000, 949, 500, -1903.39, 545.68, 3.868}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); @@ -624,17 +624,17 @@ TEST_F(LobCWAJTestFixture, BoatrightLeftHandSpinRightwardWind) { {0, 3071, 5230, -2.00, 0.00, 0.000}, {150, 2992, 4963, 1.48, 0.15, 0.049}, {300, 2913, 4706, 3.99, 0.63, 0.100}, - {600, 2759, 4221, 5.89, 2.60, 0.206}, - {900, 2609, 3775, 3.21, 6.05, 0.318}, - {1200, 2464, 3366, -4.58, 11.09, 0.436}, - {1500, 2323, 2992, -18.10, 17.87, 0.562}, - {1800, 2187, 2652, -38.07, 26.52, 0.695}, - {2100, 2056, 2344, -65.32, 37.21, 0.836}, - {2400, 1929, 2064, -100.82, 50.11, 0.987}, - {2700, 1806, 1810, -145.65, 65.44, 1.148}, - {3000, 1687, 1579, -201.15, 83.43, 1.319}, - {4500, 1150, 734, -705.94, 225.13, 2.397}, - {6000, 949, 500, -1860.74, 455.01, 3.867}}; + {600, 2759, 4221, 5.89, 2.71, 0.206}, + {900, 2609, 3775, 3.21, 6.50, 0.318}, + {1200, 2464, 3366, -4.58, 11.92, 0.436}, + {1500, 2323, 2992, -18.10, 18.95, 0.562}, + {1800, 2187, 2652, -38.07, 27.88, 0.695}, + {2100, 2056, 2344, -65.32, 38.87, 0.836}, + {2400, 1929, 2064, -100.82, 52.10, 0.987}, + {2700, 1806, 1810, -145.65, 67.79, 1.148}, + {3000, 1687, 1579, -201.15, 86.20, 1.319}, + {4500, 1150, 734, -705.94, 231.13, 2.397}, + {6000, 949, 500, -1860.74, 466.23, 3.867}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); diff --git a/test/source/lob_spin_drift_test.cpp b/test/source/lob_spin_drift_test.cpp index 0d7cbe0..ffc1e3e 100644 --- a/test/source/lob_spin_drift_test.cpp +++ b/test/source/lob_spin_drift_test.cpp @@ -390,19 +390,19 @@ TEST_F(LobSpinTestFixture, BoatrightRightHandSpinDrift) { 1800, 2100, 2400, 2700, 3000, 4500, 6000}; const std::vector kExpected = { {0, 3071, 5230, -2.00, 0.00, 0.000}, - {150, 2992, 4963, 0.95, 0.02, 0.049}, - {300, 2913, 4706, 2.93, 0.06, 0.100}, - {600, 2759, 4221, 3.76, 0.23, 0.206}, - {900, 2609, 3775, 0.02, 0.52, 0.318}, - {1200, 2464, 3366, -8.84, 0.93, 0.436}, - {1500, 2323, 2992, -23.42, 1.47, 0.562}, - {1800, 2187, 2652, -44.45, 2.17, 0.695}, - {2100, 2056, 2344, -72.77, 3.05, 0.836}, - {2400, 1929, 2064, -109.33, 4.12, 0.987}, - {2700, 1806, 1810, -155.23, 5.44, 1.148}, - {3000, 1687, 1579, -211.78, 7.02, 1.319}, - {4500, 1150, 734, -721.84, 20.93, 2.397}, - {6000, 949, 500, -1882.01, 50.22, 3.867}}; + {150, 2992, 4963, 0.95, 0.00, 0.049}, + {300, 2913, 4706, 2.93, 0.00, 0.100}, + {600, 2759, 4221, 3.76, 0.00, 0.206}, + {900, 2609, 3775, 0.02, 0.00, 0.318}, + {1200, 2464, 3366, -8.84, 0.19, 0.436}, + {1500, 2323, 2992, -23.42, 0.49, 0.562}, + {1800, 2187, 2652, -44.45, 0.94, 0.695}, + {2100, 2056, 2344, -72.77, 1.54, 0.836}, + {2400, 1929, 2064, -109.33, 2.31, 0.987}, + {2700, 1806, 1810, -155.23, 3.27, 1.148}, + {3000, 1687, 1579, -211.78, 4.47, 1.319}, + {4500, 1150, 734, -721.84, 15.23, 2.397}, + {6000, 949, 500, -1882.01, 39.72, 3.867}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); @@ -454,19 +454,19 @@ TEST_F(LobSpinTestFixture, BoatrightRightHandSpinDriftFast) { 1800, 2100, 2400, 2700, 3000, 4500, 6000}; const std::vector kExpected = { {0, 3071, 5230, -2.00, 0.00, 0.000}, - {150, 2992, 4963, 0.95, 0.02, 0.049}, - {300, 2913, 4706, 2.93, 0.08, 0.100}, - {600, 2759, 4221, 3.76, 0.29, 0.206}, - {900, 2609, 3775, 0.02, 0.64, 0.318}, - {1200, 2464, 3366, -8.84, 1.15, 0.436}, - {1500, 2323, 2992, -23.42, 1.83, 0.562}, - {1800, 2187, 2652, -44.45, 2.70, 0.695}, - {2100, 2056, 2344, -72.77, 3.79, 0.836}, - {2400, 1929, 2064, -109.33, 5.13, 0.987}, - {2700, 1806, 1810, -155.23, 6.76, 1.148}, - {3000, 1687, 1579, -211.78, 8.72, 1.319}, - {4500, 1150, 734, -721.84, 26.01, 2.397}, - {6000, 949, 500, -1882.01, 62.42, 3.867}}; + {150, 2992, 4963, 0.95, 0.00, 0.049}, + {300, 2913, 4706, 2.93, 0.00, 0.100}, + {600, 2759, 4221, 3.76, 0.00, 0.206}, + {900, 2609, 3775, 0.02, 0.00, 0.318}, + {1200, 2464, 3366, -8.84, 0.23, 0.436}, + {1500, 2323, 2992, -23.42, 0.61, 0.562}, + {1800, 2187, 2652, -44.45, 1.15, 0.695}, + {2100, 2056, 2344, -72.77, 1.89, 0.836}, + {2400, 1929, 2064, -109.33, 2.83, 0.987}, + {2700, 1806, 1810, -155.23, 4.02, 1.148}, + {3000, 1687, 1579, -211.78, 5.49, 1.319}, + {4500, 1150, 734, -721.84, 18.70, 2.397}, + {6000, 949, 500, -1882.01, 48.77, 3.867}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); @@ -518,19 +518,19 @@ TEST_F(LobSpinTestFixture, BoatrightLeftHandSpinDrift) { 1800, 2100, 2400, 2700, 3000, 4500, 6000}; const std::vector kExpected = { {0, 3071, 5230, -2.00, 0.00, 0.000}, - {150, 2992, 4963, 0.95, -0.02, 0.049}, - {300, 2913, 4706, 2.93, -0.06, 0.100}, - {600, 2759, 4221, 3.76, -0.23, 0.206}, - {900, 2609, 3775, 0.02, -0.52, 0.318}, - {1200, 2464, 3366, -8.84, -0.93, 0.436}, - {1500, 2323, 2992, -23.42, -1.47, 0.562}, - {1800, 2187, 2652, -44.45, -2.17, 0.695}, - {2100, 2056, 2344, -72.77, -3.05, 0.836}, - {2400, 1929, 2064, -109.33, -4.12, 0.987}, - {2700, 1806, 1810, -155.23, -5.44, 1.148}, - {3000, 1687, 1579, -211.78, -7.02, 1.319}, - {4500, 1150, 734, -721.84, -20.93, 2.397}, - {6000, 949, 500, -1882.01, -50.22, 3.867}}; + {150, 2992, 4963, 0.95, -0.00, 0.049}, + {300, 2913, 4706, 2.93, -0.00, 0.100}, + {600, 2759, 4221, 3.76, -0.00, 0.206}, + {900, 2609, 3775, 0.02, -0.00, 0.318}, + {1200, 2464, 3366, -8.84, -0.19, 0.436}, + {1500, 2323, 2992, -23.42, -0.49, 0.562}, + {1800, 2187, 2652, -44.45, -0.94, 0.695}, + {2100, 2056, 2344, -72.77, -1.54, 0.836}, + {2400, 1929, 2064, -109.33, -2.31, 0.987}, + {2700, 1806, 1810, -155.23, -3.27, 1.148}, + {3000, 1687, 1579, -211.78, -4.47, 1.319}, + {4500, 1150, 734, -721.84, -15.23, 2.397}, + {6000, 949, 500, -1882.01, -39.72, 3.867}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions); @@ -582,19 +582,19 @@ TEST_F(LobSpinTestFixture, BoatrightLeftHandSpinDriftFast) { 1800, 2100, 2400, 2700, 3000, 4500, 6000}; const std::vector kExpected = { {0, 3071, 5230, -2.00, 0.00, 0.000}, - {150, 2992, 4963, 0.95, -0.02, 0.049}, - {300, 2913, 4706, 2.93, -0.08, 0.100}, - {600, 2759, 4221, 3.76, -0.29, 0.206}, - {900, 2609, 3775, 0.02, -0.64, 0.318}, - {1200, 2464, 3366, -8.84, -1.15, 0.436}, - {1500, 2323, 2992, -23.42, -1.83, 0.562}, - {1800, 2187, 2652, -44.45, -2.70, 0.695}, - {2100, 2056, 2344, -72.77, -3.79, 0.836}, - {2400, 1929, 2064, -109.33, -5.13, 0.987}, - {2700, 1806, 1810, -155.23, -6.76, 1.148}, - {3000, 1687, 1579, -211.78, -8.72, 1.319}, - {4500, 1150, 734, -721.84, -26.01, 2.397}, - {6000, 949, 500, -1882.01, -62.42, 3.867}}; + {150, 2992, 4963, 0.95, -0.00, 0.049}, + {300, 2913, 4706, 2.93, -0.00, 0.100}, + {600, 2759, 4221, 3.76, -0.00, 0.206}, + {900, 2609, 3775, 0.02, -0.00, 0.318}, + {1200, 2464, 3366, -8.84, -0.23, 0.436}, + {1500, 2323, 2992, -23.42, -0.61, 0.562}, + {1800, 2187, 2652, -44.45, -1.15, 0.695}, + {2100, 2056, 2344, -72.77, -1.89, 0.836}, + {2400, 1929, 2064, -109.33, -2.83, 0.987}, + {2700, 1806, 1810, -155.23, -4.02, 1.148}, + {3000, 1687, 1579, -211.78, -5.49, 1.319}, + {4500, 1150, 734, -721.84, -18.70, 2.397}, + {6000, 949, 500, -1882.01, -48.77, 3.867}}; std::array solutions = {}; const size_t kSize = lob::Solve(kInput, kRanges, solutions);