lob 0.13.0
Exterior ballistics library — API + technical reference
Loading...
Searching...
No Matches
lob.hpp
Go to the documentation of this file.
1// Copyright (c) 2025 Joel Benway
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Please see end of file for extended copyright information
4
5#pragma once
6
7#include <array>
8#include <cstddef>
9#include <cstdint>
10
11#include "lob/lob.h"
12
13namespace lob {
14
18constexpr size_t kLobCoeffsSize = LOB_SPLINE_SEGMENTS * static_cast<size_t>(4);
21
31
40
60
62enum class ErrorT : LobErrorT {
101};
102
116struct Context {
117 double drag_coeff;
119 double mass;
123 double zero_angle;
127 double k_lapse;
128 double max_time;
129 std::array<float, kLobCoeffsSize> drags;
130 std::array<WindNode, LOB_WIND_POINTS>
134 uint16_t velocity;
135 uint16_t minimum_speed;
136 uint16_t step_size;
138 uint8_t wind_count;
139};
140
141static_assert(sizeof(Context) == sizeof(::LobContext),
142 "Context vs LobContext size mismatch");
143static_assert(alignof(Context) == alignof(::LobContext),
144 "Context vs LobContext alignment mismatch");
145static_assert(offsetof(Context, drag_coeff) ==
146 offsetof(::LobContext, drag_coeff),
147 "drag_coeff offset drift");
148static_assert(offsetof(Context, speed_of_sound) ==
149 offsetof(::LobContext, speed_of_sound),
150 "speed_of_sound offset drift");
151static_assert(offsetof(Context, mass) == offsetof(::LobContext, mass),
152 "mass offset drift");
153static_assert(offsetof(Context, optic_height) ==
154 offsetof(::LobContext, optic_height),
155 "optic_height offset drift");
156static_assert(offsetof(Context, gravity) == offsetof(::LobContext, gravity),
157 "gravity offset drift");
158static_assert(offsetof(Context, coriolis) == offsetof(::LobContext, coriolis),
159 "coriolis offset drift");
160static_assert(offsetof(Context, zero_angle) ==
161 offsetof(::LobContext, zero_angle),
162 "zero_angle offset drift");
163static_assert(offsetof(Context, stability_factor) ==
164 offsetof(::LobContext, stability_factor),
165 "stability_factor offset drift");
166static_assert(offsetof(Context, aerodynamic_jump) ==
167 offsetof(::LobContext, aerodynamic_jump),
168 "aerodynamic_jump offset drift");
169static_assert(offsetof(Context, spindrift_factor) ==
170 offsetof(::LobContext, spindrift_factor),
171 "spindrift_factor offset drift");
172static_assert(offsetof(Context, max_time) == offsetof(::LobContext, max_time),
173 "max_time offset drift");
174static_assert(offsetof(Context, drags) == offsetof(::LobContext, drags),
175 "drags offset drift");
176static_assert(offsetof(Context, wind_nodes) ==
177 offsetof(::LobContext, wind_nodes),
178 "wind_nodes offset drift");
179static_assert(offsetof(Context, wind_shear_exponent) ==
180 offsetof(::LobContext, wind_shear_exponent),
181 "wind_shear_exponent offset drift");
182static_assert(offsetof(Context, velocity) == offsetof(::LobContext, velocity),
183 "velocity offset drift");
184static_assert(offsetof(Context, minimum_speed) ==
185 offsetof(::LobContext, minimum_speed),
186 "minimum_speed offset drift");
187static_assert(offsetof(Context, step_size) == offsetof(::LobContext, step_size),
188 "step_size offset drift");
189static_assert(offsetof(Context, error) == offsetof(::LobContext, error),
190 "error offset drift");
191static_assert(offsetof(Context, wind_count) ==
192 offsetof(::LobContext, wind_count),
193 "wind_count offset drift");
194static_assert(static_cast<::LobErrorT>(ErrorT::kNone) == ::kLobErrorNone,
195 "ErrorT kNone value drift");
196static_assert(static_cast<::LobErrorT>(ErrorT::kNotFormed) ==
198 "ErrorT kNotFormed value drift");
199
203
204inline bool operator==(::LobErrorT a, ErrorT b) noexcept {
205 return a == static_cast<::LobErrorT>(b);
206}
207inline bool operator!=(::LobErrorT a, ErrorT b) noexcept {
208 return a != static_cast<::LobErrorT>(b);
209}
210inline bool operator==(ErrorT a, ::LobErrorT b) noexcept {
211 return static_cast<::LobErrorT>(a) == b;
212}
213inline bool operator!=(ErrorT a, ::LobErrorT b) noexcept {
214 return static_cast<::LobErrorT>(a) != b;
215}
216
221class Builder {
222 public:
223 Builder() : builder_{} {
224 ::LobBuilderInit(&builder_);
225 }
226 ~Builder() { ::LobBuilderDestroy(&builder_); }
227
228 Builder(const Builder& other) : builder_{} {
229 ::LobBuilderCopy(&builder_, &other.builder_);
230 }
231
232 Builder(Builder&& other) noexcept : builder_{} {
233 ::LobBuilderCopy(&builder_, &other.builder_);
234 ::LobBuilderReset(&other.builder_);
235 }
236
238 Builder& operator=(const Builder& rhs) {
239 if (this != &rhs) {
240 ::LobBuilderCopy(&builder_, &rhs.builder_);
241 }
242 return *this;
243 }
244
246 Builder& operator=(Builder&& rhs) noexcept {
247 if (this != &rhs) {
248 ::LobBuilderCopy(&builder_, &rhs.builder_);
249 ::LobBuilderReset(&rhs.builder_);
250 }
251 return *this;
252 }
253
260 ::LobBuilderBallisticCoefficientPsi(&builder_, value);
261 return *this;
262 }
263
270 ::LobBuilderBCAtmosphere(&builder_,
271 static_cast<::LobAtmosphereReferenceT>(type));
272 return *this;
273 }
274
281 ::LobBuilderBCAtmosphere(&builder_, type);
282 return *this;
283 }
284
296 static_cast<::LobDragFunctionT>(type));
297 return *this;
298 }
299
310 ::LobBuilderBCDragFunction(&builder_, type);
311 return *this;
312 }
313
319 Builder& DiameterInch(double value) {
320 ::LobBuilderDiameterInch(&builder_, value);
321 return *this;
322 }
323
330 ::LobBuilderMeplatDiameterInch(&builder_, value);
331 return *this;
332 }
333
339 Builder& BaseDiameterInch(double value) {
340 ::LobBuilderBaseDiameterInch(&builder_, value);
341 return *this;
342 }
343
349 Builder& LengthInch(double value) {
350 ::LobBuilderLengthInch(&builder_, value);
351 return *this;
352 }
353
359 Builder& NoseLengthInch(double value) {
360 ::LobBuilderNoseLengthInch(&builder_, value);
361 return *this;
362 }
363
369 Builder& TailLengthInch(double value) {
370 ::LobBuilderTailLengthInch(&builder_, value);
371 return *this;
372 }
373
379 Builder& OgiveRtR(double value) {
380 ::LobBuilderOgiveRtR(&builder_, value);
381 return *this;
382 }
383
400 Builder& MachVsDragTable(const float* pmachs, const float* pdrags,
401 size_t size) {
402 ::LobBuilderSplineFitTable(&builder_, pmachs, pdrags, size);
403 return *this;
404 }
405
422 template <size_t N>
423 Builder& MachVsDragTable(const std::array<float, N>& machs,
424 const std::array<float, N>& drags) {
425 ::LobBuilderSplineFitTable(&builder_, machs.data(), drags.data(), N);
426 return *this;
427 }
428 template <size_t N>
429 Builder& MachVsDragTable(const std::array<float, N>&& machs,
430 const std::array<float, N>& drags) = delete;
431 template <size_t N>
432 Builder& MachVsDragTable(const std::array<float, N>& machs,
433 const std::array<float, N>&& drags) = delete;
434 template <size_t N>
435 Builder& MachVsDragTable(const std::array<float, N>&& machs,
436 const std::array<float, N>&& drags) = delete;
437
454 Builder& BCVelocityBands(const float* pfps, const float* pbcvs, size_t size) {
455 ::LobBuilderBCVelocityBands(&builder_, pfps, pbcvs, size);
456 return *this;
457 }
458
476 template <size_t N>
477 Builder& BCVelocityBands(const std::array<float, N>& fps,
478 const std::array<float, N>& bcvs) {
479 ::LobBuilderBCVelocityBands(&builder_, fps.data(), bcvs.data(), N);
480 return *this;
481 }
482 template <size_t N>
483 Builder& BCVelocityBands(const std::array<float, N>&& fps,
484 const std::array<float, N>& bcvs) = delete;
485 template <size_t N>
486 Builder& BCVelocityBands(const std::array<float, N>& fps,
487 const std::array<float, N>&& bcvs) = delete;
488 template <size_t N>
489 Builder& BCVelocityBands(const std::array<float, N>&& fps,
490 const std::array<float, N>&& bcvs) = delete;
491
506 Builder& SplineCoefficients(const float* pcoefs) {
507 ::LobBuilderSplineCoefficients(&builder_, pcoefs);
508 return *this;
509 }
510
525 Builder& SplineCoefficients(const std::array<float, kLobCoeffsSize>& coefs) {
526 ::LobBuilderSplineCoefficients(&builder_, coefs.data());
527 return *this;
528 }
529 Builder& SplineCoefficients(const std::array<float, kLobCoeffsSize>&& coefs) =
530 delete;
531
537 Builder& MassGrains(double value) {
538 ::LobBuilderMassGrains(&builder_, value);
539 return *this;
540 }
541
547 Builder& InitialVelocityFps(uint16_t value) {
548 ::LobBuilderInitialVelocityFps(&builder_, value);
549 return *this;
550 }
551
557 Builder& OpticHeightInches(double value) {
558 ::LobBuilderOpticHeightInches(&builder_, value);
559 return *this;
560 }
561
569 ::LobBuilderTwistInchesPerTurn(&builder_, value);
570 return *this;
571 }
572
581 Builder& ZeroAngleMOA(double value) {
582 ::LobBuilderZeroAngleMOA(&builder_, value);
583 return *this;
584 }
585
591 Builder& ZeroDistanceYds(double value) {
592 ::LobBuilderZeroDistanceYds(&builder_, value);
593 return *this;
594 }
595
604 ::LobBuilderZeroImpactHeightInches(&builder_, value);
605 return *this;
606 }
607
614 ::LobBuilderAltitudeOfFiringSiteFt(&builder_, value);
615 return *this;
616 }
617
623 Builder& AirPressureInHg(double value) {
624 ::LobBuilderAirPressureInHg(&builder_, value);
625 return *this;
626 }
627
638 ::LobBuilderAltitudeOfBarometerFt(&builder_, value);
639 return *this;
640 }
641
647 Builder& TemperatureDegF(double value) {
648 ::LobBuilderTemperatureDegF(&builder_, value);
649 return *this;
650 }
651
662 ::LobBuilderAltitudeOfThermometerFt(&builder_, value);
663 return *this;
664 }
665
672 ::LobBuilderRelativeHumidityPercent(&builder_, value);
673 return *this;
674 }
675
683 ::LobBuilderWindHeading(&builder_, static_cast<::LobClockAngleT>(value));
684 return *this;
685 }
686
694 ::LobBuilderWindHeading(&builder_, value);
695 return *this;
696 }
697
704 Builder& WindHeadingDeg(double value) {
705 ::LobBuilderWindHeadingDeg(&builder_, value);
706 return *this;
707 }
708
714 Builder& WindSpeedFps(double value) {
715 ::LobBuilderWindSpeedFps(&builder_, value);
716 return *this;
717 }
718
724 Builder& WindSpeedMph(double value) {
725 ::LobBuilderWindSpeedMph(&builder_, value);
726 return *this;
727 }
728
745 Builder& WindProfile(const LobWindPoint* ppoints, size_t count) {
746 ::LobBuilderWindProfile(&builder_, ppoints, count);
747 return *this;
748 }
749
765 template <size_t N>
766 Builder& WindProfile(const std::array<LobWindPoint, N>& points) {
767 ::LobBuilderWindProfile(&builder_, points.data(), points.size());
768 return *this;
769 }
770 template <size_t N>
771 Builder& WindProfile(const std::array<LobWindPoint, N>&& points) = delete;
772
783 Builder& WindShearExponent(double value) {
784 ::LobBuilderWindShearExponent(&builder_, value);
785 return *this;
786 }
787
794 Builder& AzimuthDeg(double value) {
795 ::LobBuilderAzimuthDeg(&builder_, value);
796 return *this;
797 }
798
805 Builder& LatitudeDeg(double value) {
806 ::LobBuilderLatitudeDeg(&builder_, value);
807 return *this;
808 }
809
815 Builder& RangeAngleDeg(double value) {
816 ::LobBuilderRangeAngleDeg(&builder_, value);
817 return *this;
818 }
819
826 Builder& MinimumSpeed(uint16_t value) {
827 ::LobBuilderMinimumSpeed(&builder_, value);
828 return *this;
829 }
830
837 Builder& MinimumEnergy(uint16_t value) {
838 ::LobBuilderMinimumEnergy(&builder_, value);
839 return *this;
840 }
841
848 Builder& MaximumTime(double value) {
849 ::LobBuilderMaximumTime(&builder_, value);
850 return *this;
851 }
852
859 Builder& StepSize(uint16_t value) {
860 ::LobBuilderStepSize(&builder_, value);
861 return *this;
862 }
863
868 Builder& Reset() noexcept {
869 ::LobBuilderReset(&builder_);
870 return *this;
871 }
872
878 Context result{};
879 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
880 ::LobBuilderBuild(&builder_, reinterpret_cast<::LobContext*>(&result));
881 return result;
882 }
883
884 private:
885 ::LobBuilder builder_;
886};
887
899inline size_t Solve(const Context& ctx, const uint32_t* pranges, Output* pouts,
900 size_t size) {
901 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
902 return ::LobSolve(reinterpret_cast<const ::LobContext*>(&ctx), pranges, pouts,
903 size);
904}
905
915template <size_t N>
916inline size_t Solve(const Context& ctx, const std::array<uint32_t, N>& ranges,
917 std::array<Output, N>* pouts) {
918 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
919 return ::LobSolve(reinterpret_cast<const ::LobContext*>(&ctx), ranges.data(),
920 pouts->data(), N);
921}
922
931inline size_t Solve(const Context& ctx, uint32_t range, Output* pout) {
932 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
933 return ::LobSolve(reinterpret_cast<const ::LobContext*>(&ctx), &range, pout,
934 1);
935}
936
949inline size_t FastInverse(const Context& ctx, Output* pouts, size_t size) {
950 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
951 return ::LobFastInverse(reinterpret_cast<const ::LobContext*>(&ctx), pouts,
952 size);
953}
954
965template <size_t N>
966inline size_t FastInverse(const Context& ctx, std::array<Output, N>* pouts) {
967 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
968 return ::LobFastInverse(reinterpret_cast<const ::LobContext*>(&ctx),
969 pouts->data(), N);
970}
971
979inline size_t FastInverse(const Context& ctx, Output* pout) {
980 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
981 return ::LobFastInverse(reinterpret_cast<const ::LobContext*>(&ctx), pout, 1);
982}
983
999inline size_t SolveInverse(const Context& ctx, const uint32_t* pranges,
1000 Output* pouts, size_t size) {
1001 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
1002 return ::LobSolveInverse(reinterpret_cast<const ::LobContext*>(&ctx), pranges,
1003 pouts, size);
1004}
1005
1015template <size_t N>
1016inline size_t SolveInverse(const Context& ctx,
1017 const std::array<uint32_t, N>& ranges,
1018 std::array<Output, N>* pouts) {
1019 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
1020 return ::LobSolveInverse(reinterpret_cast<const ::LobContext*>(&ctx),
1021 ranges.data(), pouts->data(), N);
1022}
1023
1032inline size_t SolveInverse(const Context& ctx, uint32_t range, Output* pout) {
1033 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
1034 return ::LobSolveInverse(reinterpret_cast<const ::LobContext*>(&ctx), &range,
1035 pout, 1);
1036}
1037
1042inline const char* Version() { return ::LobVersion(); }
1043
1049inline double MoaToMil(double value) { return ::LobMoaToMil(value); }
1055inline double MoaToDeg(double value) { return ::LobMoaToDeg(value); }
1061inline double MoaToIphy(double value) { return ::LobMoaToIphy(value); }
1069inline double MoaToInch(double value, double range_ft) {
1070 return ::LobMoaToInch(value, range_ft);
1071}
1072
1078inline double MilToMoa(double value) { return ::LobMilToMoa(value); }
1084inline double MilToDeg(double value) { return ::LobMilToDeg(value); }
1090inline double MilToIphy(double value) { return ::LobMilToIphy(value); }
1098inline double MilToInch(double value, double range_ft) {
1099 return ::LobMilToInch(value, range_ft);
1100}
1101
1107inline double DegToMoa(double value) { return ::LobDegToMoa(value); }
1113inline double DegToMil(double value) { return ::LobDegToMil(value); }
1114
1121inline double InchToMoa(double value, double range_ft) {
1122 return ::LobInchToMoa(value, range_ft);
1123}
1124
1130inline double InchToMil(double value, double range_ft) {
1131 return ::LobInchToMil(value, range_ft);
1132}
1133
1139inline double InchToDeg(double value, double range_ft) {
1140 return ::LobInchToDeg(value, range_ft);
1141}
1142
1148inline double JToFtLbs(double value) { return ::LobJToFtLbs(value); }
1154inline double FtLbsToJ(double value) { return ::LobFtLbsToJ(value); }
1155
1161inline double MToYd(double value) { return ::LobMToYd(value); }
1162
1168inline double YdToFt(double value) { return ::LobYdToFt(value); }
1174inline double MToFt(double value) { return ::LobMToFt(value); }
1180inline double FtToIn(double value) { return ::LobFtToIn(value); }
1186inline double MmToIn(double value) { return ::LobMmToIn(value); }
1192inline double CmToIn(double value) { return ::LobCmToIn(value); }
1198inline double YdToM(double value) { return ::LobYdToM(value); }
1204inline double FtToM(double value) { return ::LobFtToM(value); }
1210inline double FtToYd(double value) { return ::LobFtToYd(value); }
1216inline double InToMm(double value) { return ::LobInToMm(value); }
1222inline double InToCm(double value) { return ::LobInToCm(value); }
1228inline double InToFt(double value) { return ::LobInToFt(value); }
1229
1235inline double PaToInHg(double value) { return ::LobPaToInHg(value); }
1241inline double MbarToInHg(double value) { return ::LobMbarToInHg(value); }
1247inline double PsiToInHg(double value) { return ::LobPsiToInHg(value); }
1248
1254inline double LbsToGrain(double value) { return ::LobLbsToGrain(value); }
1260inline double GToGrain(double value) { return ::LobGToGrain(value); }
1266inline double KgToGrain(double value) { return ::LobKgToGrain(value); }
1267
1273inline double KgSqMToPmsi(double value) { return ::LobKgSqMToPmsi(value); }
1274
1280inline double FpsToMps(double value) { return ::LobFpsToMps(value); }
1286inline double MpsToFps(double value) { return ::LobMpsToFps(value); }
1292inline double KphToMph(double value) { return ::LobKphToMph(value); }
1298inline double KnToMph(double value) { return ::LobKnToMph(value); }
1299
1305inline double MsToS(double value) { return ::LobMsToS(value); }
1311inline double UsToS(double value) { return ::LobUsToS(value); }
1317inline double SToMs(double value) { return ::LobSToMs(value); }
1323inline double SToUs(double value) { return ::LobSToUs(value); }
1324
1330inline double DegCToDegF(double value) { return ::LobDegCToDegF(value); }
1331
1332} // namespace lob
1333
1334// This file is part of lob.
1335//
1336// lob is free software: you can redistribute it and/or modify it under the
1337// terms of the GNU General Public License as published by the Free Software
1338// Foundation, either version 3 of the License, or (at your option) any later
1339// version.
1340//
1341// lob is distributed in the hope that it will be useful, but WITHOUT ANY
1342// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1343// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1344//
1345// You should have received a copy of the GNU General Public License along with
1346// lob. If not, see <https://www.gnu.org/licenses/>.
Context Build()
Builds the Context object with the configured parameters.
Definition lob.hpp:877
Builder & WindHeadingDeg(double value)
Sets the wind heading in degrees.
Definition lob.hpp:704
Builder & LengthInch(double value)
Sets the projectile length in inches.
Definition lob.hpp:349
Builder & TemperatureDegF(double value)
Sets the temperature in degrees Fahrenheit.
Definition lob.hpp:647
Builder & ZeroAngleMOA(double value)
Sets the angle between the sight and launch angle used to achieve zero.
Definition lob.hpp:581
Builder & operator=(const Builder &rhs)
Copy assignment operator.
Definition lob.hpp:238
Builder & BCVelocityBands(const std::array< float, N > &&fps, const std::array< float, N > &&bcvs)=delete
Builder & BCAtmosphere(LobAtmosphereReferenceT type)
Sets the atmosphere reference associated with ballistic coefficient.
Definition lob.hpp:280
Builder & MachVsDragTable(const std::array< float, N > &&machs, const std::array< float, N > &&drags)=delete
Builder & MaximumTime(double value)
Sets the maximum time of flight for the solver.
Definition lob.hpp:848
Builder & MassGrains(double value)
Sets the projectile mass in grains.
Definition lob.hpp:537
Builder & AzimuthDeg(double value)
Sets the azimuth (bearing) of the target in degrees.
Definition lob.hpp:794
Builder & BCVelocityBands(const std::array< float, N > &&fps, const std::array< float, N > &bcvs)=delete
Builder & TailLengthInch(double value)
Sets the projectile tail length in inches.
Definition lob.hpp:369
Builder & operator=(Builder &&rhs) noexcept
Move assignment operator.
Definition lob.hpp:246
Builder & BCVelocityBands(const std::array< float, N > &fps, const std::array< float, N > &bcvs)
Loads ballistic coefficients measured at multiple velocities.
Definition lob.hpp:477
Builder & SplineCoefficients(const float *pcoefs)
Loads precomputed native spline coefficients for the drag curve.
Definition lob.hpp:506
Builder & InitialVelocityFps(uint16_t value)
Sets the initial velocity of the projectile in feet per second.
Definition lob.hpp:547
Builder & WindProfile(const std::array< LobWindPoint, N > &&points)=delete
Builder & AltitudeOfFiringSiteFt(double value)
Sets the altitude of the firing site in feet.
Definition lob.hpp:613
Builder & MeplatDiameterInch(double value)
Sets the projectile meplat diameter in inches.
Definition lob.hpp:329
Builder & MinimumEnergy(uint16_t value)
Sets the minimum energy threshold for the solver.
Definition lob.hpp:837
Builder & BallisticCoefficientPsi(double value)
Sets the ballistic coefficient (Psi).
Definition lob.hpp:259
Builder & AirPressureInHg(double value)
Sets the air pressure in inches of mercury (inHg).
Definition lob.hpp:623
~Builder()
Destructor.
Definition lob.hpp:226
Builder & SplineCoefficients(const std::array< float, kLobCoeffsSize > &coefs)
Loads precomputed native spline coefficients for the drag curve.
Definition lob.hpp:525
Builder & WindProfile(const LobWindPoint *ppoints, size_t count)
Loads a downrange wind profile for the projectile.
Definition lob.hpp:745
Builder & DiameterInch(double value)
Sets the projectile diameter (caliber) in inches.
Definition lob.hpp:319
Builder & WindHeading(LobClockAngleT value)
Sets the wind heading using a clock angle.
Definition lob.hpp:693
Builder & MachVsDragTable(const std::array< float, N > &&machs, const std::array< float, N > &drags)=delete
Builder & WindHeading(ClockAngleT value)
Sets the wind heading using a clock angle.
Definition lob.hpp:682
Builder & MachVsDragTable(const std::array< float, N > &machs, const std::array< float, N > &drags)
Loads a custom Mach vs Drag table for the projectile.
Definition lob.hpp:423
Builder & LatitudeDeg(double value)
Sets the latitude of the firing location in degrees.
Definition lob.hpp:805
Builder & OpticHeightInches(double value)
Sets the height of the optic above the bore in inches.
Definition lob.hpp:557
Builder & BCAtmosphere(AtmosphereReferenceT type)
Sets the atmosphere reference associated with ballistic coefficient.
Definition lob.hpp:269
Builder & BCVelocityBands(const float *pfps, const float *pbcvs, size_t size)
Loads ballistic coefficients measured at multiple velocities.
Definition lob.hpp:454
Builder & Reset() noexcept
Resets the builder state by re-initializing.
Definition lob.hpp:868
Builder & ZeroDistanceYds(double value)
Sets the zero distance in yards.
Definition lob.hpp:591
Builder()
Default constructor.
Definition lob.hpp:223
Builder & MinimumSpeed(uint16_t value)
Sets the minimum speed threshold for the solver.
Definition lob.hpp:826
Builder & WindShearExponent(double value)
Sets the Hellmann shear exponent for wind profile height scaling.
Definition lob.hpp:783
Builder & RangeAngleDeg(double value)
Sets the range angle (inclination) to the target in degrees.
Definition lob.hpp:815
Builder & MachVsDragTable(const std::array< float, N > &machs, const std::array< float, N > &&drags)=delete
Builder(const Builder &other)
Definition lob.hpp:228
Builder & WindSpeedMph(double value)
Sets the wind speed in miles per hour.
Definition lob.hpp:724
Builder & BCDragFunction(DragFunctionT type)
Sets the drag function associated with ballistic coefficient.
Definition lob.hpp:294
Builder & BCVelocityBands(const std::array< float, N > &fps, const std::array< float, N > &&bcvs)=delete
Builder & ZeroImpactHeightInches(double value)
Sets the zero impact height in inches.
Definition lob.hpp:603
Builder(Builder &&other) noexcept
Definition lob.hpp:232
Builder & NoseLengthInch(double value)
Sets the projectile nose length in inches.
Definition lob.hpp:359
Builder & AltitudeOfBarometerFt(double value)
Sets the altitude of the location where air pressure was taken in feet.
Definition lob.hpp:637
Builder & SplineCoefficients(const std::array< float, kLobCoeffsSize > &&coefs)=delete
Builder & OgiveRtR(double value)
Sets the Rt/R ratio of the projectile ogive.
Definition lob.hpp:379
Builder & TwistInchesPerTurn(double value)
Sets the twist rate of the barrel in inches per turn.
Definition lob.hpp:568
Builder & WindSpeedFps(double value)
Sets the wind speed in feet per second.
Definition lob.hpp:714
Builder & StepSize(uint16_t value)
Sets the step size for the numerical solver.
Definition lob.hpp:859
Builder & MachVsDragTable(const float *pmachs, const float *pdrags, size_t size)
Loads a custom Mach vs Drag table for the projectile.
Definition lob.hpp:400
Builder & BaseDiameterInch(double value)
Sets the projectile base diameter in inches.
Definition lob.hpp:339
Builder & WindProfile(const std::array< LobWindPoint, N > &points)
Loads a downrange wind profile for the projectile.
Definition lob.hpp:766
Builder & RelativeHumidityPercent(double value)
Sets the relative humidity at the firing site in percent.
Definition lob.hpp:671
Builder & BCDragFunction(LobDragFunctionT type)
Sets the drag function associated with ballistic coefficient.
Definition lob.hpp:309
Builder & AltitudeOfThermometerFt(double value)
Sets the altitude of the location where temperature was taken in feet.
Definition lob.hpp:661
LobBuilder * LobBuilderAzimuthDeg(LobBuilder *pbuilder, double value)
Sets the azimuth (bearing) of the target in degrees.
void LobBuilderInit(LobBuilder *pbuilder)
Initializes a builder to default state. No-op if pbuilder is null.
LobBuilder * LobBuilderWindSpeedFps(LobBuilder *pbuilder, double value)
Sets the wind speed in feet per second.
LobBuilder * LobBuilderTemperatureDegF(LobBuilder *pbuilder, double value)
Sets the temperature in degrees Fahrenheit.
LobBuilder * LobBuilderTailLengthInch(LobBuilder *pbuilder, double value)
Sets the projectile tail length in inches.
LobBuilder * LobBuilderOpticHeightInches(LobBuilder *pbuilder, double value)
Sets the height of the optic above the bore in inches.
#define LOB_BUILDER_BUFFER_SIZE
The size in bytes of the builder buffer.
Definition lob.h:21
LobBuilder * LobBuilderAirPressureInHg(LobBuilder *pbuilder, double value)
Sets the air pressure in inches of mercury (inHg).
LobBuilder * LobBuilderMinimumEnergy(LobBuilder *pbuilder, uint16_t value)
Sets the minimum energy threshold for the solver.
LobBuilder * LobBuilderRelativeHumidityPercent(LobBuilder *pbuilder, double value)
Sets the relative humidity at the firing site in percent.
uint8_t LobClockAngleT
Clock angle positions for wind direction.
Definition lob.h:45
LobBuilder * LobBuilderDiameterInch(LobBuilder *pbuilder, double value)
Sets the projectile diameter (caliber) in inches.
LobBuilder * LobBuilderBCAtmosphere(LobBuilder *pbuilder, LobAtmosphereReferenceT type)
Sets the atmosphere reference associated with ballistic coefficient.
#define LOB_WIND_POINTS
Total wind profile points, muzzle point included.
Definition lob.h:23
LobBuilder * LobBuilderLengthInch(LobBuilder *pbuilder, double value)
Sets the projectile length in inches.
LobBuilder * LobBuilderTwistInchesPerTurn(LobBuilder *pbuilder, double value)
Sets the twist rate of the barrel in inches per turn.
LobBuilder * LobBuilderBCVelocityBands(LobBuilder *pbuilder, const float *pfps, const float *pbcs, size_t size)
Loads ballistic coefficients measured at multiple velocities.
uint8_t LobAtmosphereReferenceT
Atmosphere reference type.
Definition lob.h:37
LobBuilder * LobBuilderSplineCoefficients(LobBuilder *pbuilder, const float *pcoefs)
Loads precomputed native spline coefficients for the drag curve.
LobBuilder * LobBuilderReset(LobBuilder *pbuilder)
Resets a builder state by re-initializing. No-op if pbuilder is null.
LobBuilder * LobBuilderLatitudeDeg(LobBuilder *pbuilder, double value)
Sets the latitude of the firing location in degrees.
LobBuilder * LobBuilderBCDragFunction(LobBuilder *pbuilder, LobDragFunctionT type)
Sets the drag function associated with ballistic coefficient.
LobBuilder * LobBuilderMaximumTime(LobBuilder *pbuilder, double value)
Sets the maximum time of flight for the solver.
@ kLobDragFunctionG2
G2 drag function.
Definition lob.h:29
@ kLobDragFunctionG1
G1 drag function.
Definition lob.h:28
@ kLobDragFunctionG7
G7 drag function.
Definition lob.h:32
@ kLobDragFunctionG6
G6 drag function.
Definition lob.h:31
@ kLobDragFunctionG8
G8 drag function.
Definition lob.h:33
@ kLobDragFunctionG5
G5 drag function.
Definition lob.h:30
LobBuilder * LobBuilderOgiveRtR(LobBuilder *pbuilder, double value)
Sets the Rt/R ratio of the projectile ogive.
@ kLobErrorDiameterOOR
Definition lob.h:76
@ kLobErrorNotFormed
Definition lob.h:89
@ kLobErrorMeplatDiameterOOR
Definition lob.h:87
@ kLobErrorMachDragTableNotMonotonic
Definition lob.h:83
@ kLobErrorBaseDiameterOOR
Definition lob.h:72
@ kLobErrorLatitudeOOR
Definition lob.h:80
@ kLobErrorInternalError
Definition lob.h:79
@ kLobErrorNoseLengthOOR
Definition lob.h:88
@ kLobErrorBallisticCoefficientOOR
Definition lob.h:70
@ kLobErrorZeroAngleOOR
Definition lob.h:98
@ kLobErrorLengthOOR
Definition lob.h:81
@ kLobErrorZeroUnreachable
Definition lob.h:101
@ kLobErrorOgiveRtROOR
Definition lob.h:90
@ kLobErrorMachDragTableTooShort
Definition lob.h:84
@ kLobErrorWindProfileInvalid
Definition lob.h:95
@ kLobErrorRangeAngleOOR
Definition lob.h:91
@ kLobErrorZeroDataRequired
Definition lob.h:99
@ kLobErrorSplineCoefsInvalid
Definition lob.h:92
@ kLobErrorMaximumTimeOOR
Definition lob.h:86
@ kLobErrorTailLengthOOR
Definition lob.h:93
@ kLobErrorBallisticCoefficientRequired
Definition lob.h:71
@ kLobErrorBcBandsInvalid
Definition lob.h:73
@ kLobErrorAirPressureOOR
Definition lob.h:65
@ kLobErrorInitialVelocityRequired
Definition lob.h:78
@ kLobErrorNone
Definition lob.h:64
@ kLobErrorHumidityOOR
Definition lob.h:77
@ kLobErrorAzimuthOOR
Definition lob.h:69
@ kLobErrorMassOOR
Definition lob.h:85
@ kLobErrorZeroDistanceOOR
Definition lob.h:100
@ kLobErrorWindHeadingOOR
Definition lob.h:94
@ kLobErrorWindProfileTooLong
Definition lob.h:97
@ kLobErrorAltitudeOfThermometerOOR
Definition lob.h:68
@ kLobErrorBcBandsTooShort
Definition lob.h:75
@ kLobErrorMachDragTableInvalid
Definition lob.h:82
@ kLobErrorBcBandsNotMonotonic
Definition lob.h:74
@ kLobErrorAltitudeOfBarometerOOR
Definition lob.h:66
@ kLobErrorAltitudeOfFiringSiteOOR
Definition lob.h:67
@ kLobErrorWindProfileNotMonotonic
Definition lob.h:96
LobBuilder * LobBuilderZeroAngleMOA(LobBuilder *pbuilder, double value)
Sets the angle between the sight and launch angle used to achieve zero.
#define LOB_SPLINE_SEGMENTS
The number of spline pieces comprising a drag function.
Definition lob.h:19
LobBuilder * LobBuilderAltitudeOfThermometerFt(LobBuilder *pbuilder, double value)
Sets the altitude of the location where temperature was taken in feet.
@ kLobClockAngleVIII
eight o'clock
Definition lob.h:54
@ kLobClockAngleIV
four o'clock
Definition lob.h:50
@ kLobClockAngleV
five o'clock
Definition lob.h:51
@ kLobClockAngleI
one o'clock
Definition lob.h:47
@ kLobClockAngleVI
six o'clock
Definition lob.h:52
@ kLobClockAngleXI
eleven o'clock
Definition lob.h:57
@ kLobClockAngleVII
seven o'clock
Definition lob.h:53
@ kLobClockAngleII
two o'clock
Definition lob.h:48
@ kLobClockAngleIII
three o'clock
Definition lob.h:49
@ kLobClockAngleXII
twelve o'clock
Definition lob.h:58
@ kLobClockAngleX
ten o'clock
Definition lob.h:56
@ kLobClockAngleIX
nine o'clock
Definition lob.h:55
uint8_t LobDragFunctionT
Drag function type.
Definition lob.h:26
@ kLobAtmosphereReferenceArmyStandardMetro
Army Standard Metro.
Definition lob.h:39
@ kLobAtmosphereReferenceIcao
International Civil Aviation Organization (ICAO)
Definition lob.h:40
LobBuilder * LobBuilderSplineFitTable(LobBuilder *pbuilder, const float *pmachs, const float *pdrags, size_t size)
Loads a custom Mach vs Drag table for the projectile.
void LobBuilderBuild(LobBuilder *pbuilder, LobContext *presult)
Builds the LobContext object with the configured parameters.
LobBuilder * LobBuilderRangeAngleDeg(LobBuilder *pbuilder, double value)
Sets the range angle (inclination) to the target in degrees.
LobBuilder * LobBuilderStepSize(LobBuilder *pbuilder, uint16_t value)
Sets the step size for the numerical solver.
LobBuilder * LobBuilderZeroImpactHeightInches(LobBuilder *pbuilder, double value)
Sets the zero impact height in inches.
uint8_t LobErrorT
Error codes returned by the builder.
Definition lob.h:62
LobBuilder * LobBuilderBallisticCoefficientPsi(LobBuilder *pbuilder, double value)
Sets the ballistic coefficient (Psi).
LobBuilder * LobBuilderWindProfile(LobBuilder *pbuilder, const LobWindPoint *ppoints, size_t count)
Sets the downrange wind profile points.
LobBuilder * LobBuilderAltitudeOfFiringSiteFt(LobBuilder *pbuilder, double value)
Sets the altitude of the firing site in feet.
LobBuilder * LobBuilderMinimumSpeed(LobBuilder *pbuilder, uint16_t value)
Sets the minimum speed threshold for the solver.
LobBuilder * LobBuilderZeroDistanceYds(LobBuilder *pbuilder, double value)
Sets the zero distance in yards.
LobBuilder * LobBuilderNoseLengthInch(LobBuilder *pbuilder, double value)
Sets the projectile nose length in inches.
LobBuilder * LobBuilderInitialVelocityFps(LobBuilder *pbuilder, uint16_t value)
Sets the initial velocity of the projectile in feet per second.
LobBuilder * LobBuilderMeplatDiameterInch(LobBuilder *pbuilder, double value)
Sets the projectile meplat diameter in inches.
LobBuilder * LobBuilderWindHeadingDeg(LobBuilder *pbuilder, double value)
Sets the wind heading in degrees.
LobBuilder * LobBuilderAltitudeOfBarometerFt(LobBuilder *pbuilder, double value)
Sets the altitude of the location where air pressure was taken in feet.
LobBuilder * LobBuilderMassGrains(LobBuilder *pbuilder, double value)
Sets the projectile mass in grains.
LobBuilder * LobBuilderWindHeading(LobBuilder *pbuilder, LobClockAngleT value)
Sets the wind heading using a clock angle.
void LobBuilderCopy(LobBuilder *dst, const LobBuilder *src)
Copies builder state from src to dst. No-op if either is null.
LobBuilder * LobBuilderBaseDiameterInch(LobBuilder *pbuilder, double value)
Sets the projectile base diameter in inches.
void LobBuilderDestroy(LobBuilder *pbuilder)
Destroys a builder and releases resources. No-op if pbuilder is null.
LobBuilder * LobBuilderWindSpeedMph(LobBuilder *pbuilder, double value)
Sets the wind speed in miles per hour.
LobBuilder * LobBuilderWindShearExponent(LobBuilder *pbuilder, double value)
Sets the Hellmann shear exponent for wind profile height scaling.
Definition lob.hpp:13
size_t FastInverse(const Context &ctx, Output *pouts, size_t size)
Converts forward-solution output to inverse-solution adjustments.
Definition lob.hpp:949
double MilToDeg(double value)
Converts milliradians (MIL) to degrees.
Definition lob.hpp:1084
constexpr size_t kLobWindPoints
Total wind profile points, muzzle point included.
Definition lob.hpp:20
double InToMm(double value)
Converts inches to millimeters.
Definition lob.hpp:1216
::LobWindNode WindNode
Solver-ready wind profile node. See LobWindNode for details.
Definition lob.hpp:108
double YdToFt(double value)
Converts yards to feet.
Definition lob.hpp:1168
double GToGrain(double value)
Converts grams to grains.
Definition lob.hpp:1260
bool operator==(::LobErrorT a, ErrorT b) noexcept
Definition lob.hpp:204
double MoaToMil(double value)
Converts minutes of angle (MOA) to milliradians (MIL).
Definition lob.hpp:1049
double KgToGrain(double value)
Converts kilograms to grains.
Definition lob.hpp:1266
double KnToMph(double value)
Converts Knots to miles per hour.
Definition lob.hpp:1298
double DegCToDegF(double value)
Converts degrees celsius to degrees fahrenheit.
Definition lob.hpp:1330
double KgSqMToPmsi(double value)
Converts kilograms per square meter to pounds mass per square inch.
Definition lob.hpp:1273
double JToFtLbs(double value)
Converts joules to foot-pounds.
Definition lob.hpp:1148
AtmosphereReferenceT
Enumerates the supported atmosphere reference types.
Definition lob.hpp:33
@ kArmyStandardMetro
Army Standard Metro.
Definition lob.hpp:34
@ kIcao
International Civil Aviation Organization (ICAO)
Definition lob.hpp:37
double KphToMph(double value)
Converts kilometers per hour to miles per hour.
Definition lob.hpp:1292
double LbsToGrain(double value)
Converts pounds to grains.
Definition lob.hpp:1254
double PsiToInHg(double value)
Converts pounds per square inch (PSI) to inches of mercury.
Definition lob.hpp:1247
double PaToInHg(double value)
Converts pascals to inches of mercury.
Definition lob.hpp:1235
::LobCoriolis Coriolis
Coriolis effect parameters. See LobCoriolis for member details.
Definition lob.hpp:110
double CmToIn(double value)
Converts centimeters to inches.
Definition lob.hpp:1192
double MToYd(double value)
Converts meters to yards.
Definition lob.hpp:1161
::LobOutput Output
Structure holding output results. See LobOutput for member details.
Definition lob.hpp:202
double MmToIn(double value)
Converts millimeters to inches.
Definition lob.hpp:1186
double MbarToInHg(double value)
Converts millibars to inches of mercury.
Definition lob.hpp:1241
double MoaToDeg(double value)
Converts minutes of angle (MOA) to degrees.
Definition lob.hpp:1055
::LobGravity Gravity
Gravity vector. See LobGravity for member details.
Definition lob.hpp:104
double FtToYd(double value)
Converts feet to yards.
Definition lob.hpp:1210
double MilToIphy(double value)
Converts milliradians (MIL) to inches per hundred yards (IPHY).
Definition lob.hpp:1090
double MpsToFps(double value)
Converts meters per second to feet per second.
Definition lob.hpp:1286
ErrorT
Error codes returned by the builder.
Definition lob.hpp:62
@ kOgiveRtROOR
Definition lob.hpp:89
@ kBaseDiameterOOR
Definition lob.hpp:71
@ kMeplatDiameterOOR
Definition lob.hpp:86
@ kZeroDistanceOOR
Definition lob.hpp:99
@ kAzimuthOOR
Definition lob.hpp:68
@ kMachDragTableTooShort
Definition lob.hpp:83
@ kNotFormed
Definition lob.hpp:88
@ kBallisticCoefficientOOR
Definition lob.hpp:69
@ kNone
Definition lob.hpp:63
@ kTailLengthOOR
Definition lob.hpp:92
@ kMaximumTimeOOR
Definition lob.hpp:85
@ kMachDragTableNotMonotonic
Definition lob.hpp:82
@ kAltitudeOfBarometerOOR
Definition lob.hpp:65
@ kHumidityOOR
Definition lob.hpp:76
@ kBcBandsTooShort
Definition lob.hpp:74
@ kWindHeadingOOR
Definition lob.hpp:93
@ kBcBandsNotMonotonic
Definition lob.hpp:73
@ kInitialVelocityRequired
Definition lob.hpp:77
@ kDiameterOOR
Definition lob.hpp:75
@ kLengthOOR
Definition lob.hpp:80
@ kWindProfileNotMonotonic
Definition lob.hpp:95
@ kWindProfileTooLong
Definition lob.hpp:96
@ kAltitudeOfThermometerOOR
Definition lob.hpp:67
@ kAltitudeOfFiringSiteOOR
Definition lob.hpp:66
@ kBallisticCoefficientRequired
Definition lob.hpp:70
@ kNoseLengthOOR
Definition lob.hpp:87
@ kMassOOR
Definition lob.hpp:84
@ kZeroUnreachable
Definition lob.hpp:100
@ kZeroDataRequired
Definition lob.hpp:98
@ kZeroAngleOOR
Definition lob.hpp:97
@ kRangeAngleOOR
Definition lob.hpp:90
@ kAirPressureOOR
Definition lob.hpp:64
@ kSplineCoefsInvalid
Definition lob.hpp:91
@ kWindProfileInvalid
Definition lob.hpp:94
@ kLatitudeOOR
Definition lob.hpp:79
@ kMachDragTableInvalid
Definition lob.hpp:81
@ kInternalError
Definition lob.hpp:78
@ kBcBandsInvalid
Definition lob.hpp:72
double InToCm(double value)
Converts inches to centimeters.
Definition lob.hpp:1222
double MoaToInch(double value, double range_ft)
Converts minutes of angle (MOA) to projected inches at a given range in feet.
Definition lob.hpp:1069
double InchToMil(double value, double range_ft)
Inches of projection at a given range to milliradians (MIL).
Definition lob.hpp:1130
double FtToM(double value)
Converts feet to meters.
Definition lob.hpp:1204
ClockAngleT
Enumerates clock angle positions.
Definition lob.hpp:46
@ kX
ten o'clock
Definition lob.hpp:56
@ kI
one o'clock
Definition lob.hpp:47
@ kXI
eleven o'clock
Definition lob.hpp:57
@ kVII
seven o'clock
Definition lob.hpp:53
@ kVIII
eight o'clock
Definition lob.hpp:54
@ kV
five o'clock
Definition lob.hpp:51
@ kVI
six o'clock
Definition lob.hpp:52
@ kIV
four o'clock
Definition lob.hpp:50
@ kIII
three o'clock
Definition lob.hpp:49
@ kIX
nine o'clock
Definition lob.hpp:55
@ kXII
twelve o'clock
Definition lob.hpp:58
@ kII
two o'clock
Definition lob.hpp:48
size_t Solve(const Context &ctx, const uint32_t *pranges, Output *pouts, size_t size)
Solves the exterior ballistics problem for a given set of ranges. Results contain a forward-solution.
Definition lob.hpp:899
double DegToMil(double value)
Converts degrees to milliradians (MIL).
Definition lob.hpp:1113
double MilToMoa(double value)
Converts milliradians (MIL) to minutes of angle (MOA).
Definition lob.hpp:1078
DragFunctionT
Enumerates the supported drag functions.
Definition lob.hpp:23
@ kG2
G2 drag function.
Definition lob.hpp:25
@ kG5
G5 drag function.
Definition lob.hpp:26
@ kG1
G1 drag function.
Definition lob.hpp:24
@ kG8
G8 drag function.
Definition lob.hpp:29
@ kG7
G7 drag function.
Definition lob.hpp:28
@ kG6
G6 drag function.
Definition lob.hpp:27
double InToFt(double value)
Converts inches to feet.
Definition lob.hpp:1228
double FtToIn(double value)
Converts feet to inches.
Definition lob.hpp:1180
double FtLbsToJ(double value)
Converts foot-pounds to joules.
Definition lob.hpp:1154
bool operator!=(::LobErrorT a, ErrorT b) noexcept
Definition lob.hpp:207
double SToUs(double value)
Converts seconds to microseconds.
Definition lob.hpp:1323
double InchToMoa(double value, double range_ft)
Inches of projection at a given range to minutes of angle (MOA).
Definition lob.hpp:1121
double MsToS(double value)
Converts milliseconds to seconds.
Definition lob.hpp:1305
double YdToM(double value)
Converts yards to meters.
Definition lob.hpp:1198
double MilToInch(double value, double range_ft)
Converts milliradians (MIL) to projected inches at a given range in feet.
Definition lob.hpp:1098
double InchToDeg(double value, double range_ft)
Inches of projection at a given range to degrees.
Definition lob.hpp:1139
::LobWindPoint WindPoint
Downrange wind profile point. See LobWindPoint for details.
Definition lob.hpp:106
constexpr size_t kLobCoeffsSize
The size of spline coeffs in Context.
Definition lob.hpp:18
const char * Version()
Gets the library version in major.minor.patch format.
Definition lob.hpp:1042
constexpr size_t kLobBuilderBufferSize
The size in bytes of the builder buffer.
Definition lob.hpp:16
double SToMs(double value)
Converts seconds to milliseconds.
Definition lob.hpp:1317
size_t SolveInverse(const Context &ctx, const uint32_t *pranges, Output *pouts, size_t size)
Solves the exterior ballistics problem for a given set of ranges. Results contain an inverse-solution...
Definition lob.hpp:999
double UsToS(double value)
Converts microseconds to seconds.
Definition lob.hpp:1311
double MoaToIphy(double value)
Converts minutes of angle (MOA) to inches per hundred yards (IPHY).
Definition lob.hpp:1061
double MToFt(double value)
Converts meters to feet.
Definition lob.hpp:1174
double FpsToMps(double value)
Converts feet per second to meters per second.
Definition lob.hpp:1280
double DegToMoa(double value)
Converts degrees to minutes of angle (MOA).
Definition lob.hpp:1107
Opaque builder type for constructing LobContext objects.
Definition lob.h:178
Structure of parameters consumed by the solver.
Definition lob.h:139
Coriolis effect parameters.
Definition lob.h:128
Gravity vector.
Definition lob.h:106
Structure holding the output results of a ballistic calculation.
Definition lob.h:165
Solver-ready wind profile node with frame-resolved components.
Definition lob.h:120
Downrange wind profile point (horizontal-plane wind).
Definition lob.h:112
Structure of parameters consumed by the solver.
Definition lob.hpp:116
double speed_of_sound
The local speed of sound in Fps.
Definition lob.hpp:118
double stability_factor
Miller stability factor.
Definition lob.hpp:124
double mass
Mass of the projectile in pounds.
Definition lob.hpp:119
double zero_angle
Angle between sight and trajectory.
Definition lob.hpp:123
double spindrift_factor
Spin drift factor.
Definition lob.hpp:126
std::array< float, kLobCoeffsSize > drags
Drag curve coefficients.
Definition lob.hpp:129
uint16_t minimum_speed
Minimum speed for solver.
Definition lob.hpp:135
double optic_height
Height of the optic above the bore.
Definition lob.hpp:120
uint16_t velocity
Initial velocity of projectile in Fps.
Definition lob.hpp:134
Gravity gravity
Gravity vector.
Definition lob.hpp:121
double aerodynamic_jump
Aerodynamic jump effect in Moa.
Definition lob.hpp:125
uint16_t step_size
Solver step size in inches.
Definition lob.hpp:136
double wind_shear_exponent
Hellmann exponent alpha; scaling is always active, 0 disables it exactly.
Definition lob.hpp:132
std::array< WindNode, 8 > wind_nodes
Frame-resolved nodes; [0] is muzzle.
Definition lob.hpp:131
double k_lapse
Projected linear density lapse coeff.
Definition lob.hpp:127
Coriolis coriolis
Coriolis effect parameters.
Definition lob.hpp:122
double max_time
Max time of flight for solver.
Definition lob.hpp:128
double drag_coeff
Drag coefficient scaling factor.
Definition lob.hpp:117
uint8_t wind_count
Total wind points, 1..LOB_WIND_POINTS.
Definition lob.hpp:138
ErrorT error
Error status after build.
Definition lob.hpp:137