13#include "lob/lob_export.hpp"
63enum class LOB_EXPORT
ErrorT : uint8_t {
90template <
typename T =
double>
92 static_assert(std::is_floating_point<T>::value,
93 "NaN() only supports floating-point types");
94 return std::numeric_limits<T>::quiet_NaN();
104 std::array<uint16_t, kTableSize>
drags{};
243 const std::array<float, N>& drags) {
448 static constexpr
size_t kBufferSize{536};
453 alignas(AlignmentT) std::array<uint8_t, kBufferSize> buffer_{};
454 Impl* pimpl_{
nullptr};
489size_t Solve(
const Input& in,
const std::array<uint32_t, N>& pranges,
490 std::array<Output, N>& pouts) {
491 return Solve(in, pranges.data(), pouts.data(), N);
522LOB_EXPORT
double MoaToInch(
double value,
double range_ft);
552LOB_EXPORT
double MilToInch(
double value,
double range_ft);
574LOB_EXPORT
double InchToMoa(
double value,
double range_ft);
582LOB_EXPORT
double InchToMil(
double value,
double range_ft);
590LOB_EXPORT
double InchToDeg(
double value,
double range_ft);
611LOB_EXPORT
double MtoYd(
double value);
625LOB_EXPORT
double MToFt(
double value);
653LOB_EXPORT
double YdToM(
double value);
660LOB_EXPORT
double FtToM(
double value);
772LOB_EXPORT
double MsToS(
double value);
779LOB_EXPORT
double UsToS(
double value);
786LOB_EXPORT
double SToMs(
double value);
793LOB_EXPORT
double SToUs(
double value);
Builder & WindHeadingDeg(double value)
Sets the wind heading in degrees.
Builder & LengthInch(double value)
Sets the projectile length in inches.
Builder & TemperatureDegF(double value)
Sets the temperature in degrees Fahrenheit.
Builder & ZeroAngleMOA(double value)
Sets the angle between the sight and launch angle used to achieve zero.
Builder & operator=(const Builder &rhs)
Move constructor.
Builder & MaximumTime(double value)
Sets the maximum time of flight for the solver.
Input Build()
Builds the Input object with the configured parameters.
Builder & MassGrains(double value)
Sets the projectile mass in grains.
Builder & AzimuthDeg(double value)
Sets the azimuth (bearing) of the target in degrees.
Builder & TailLengthInch(double value)
Sets the projectile tail length in inches.
Builder & operator=(Builder &&rhs) noexcept
Copy assignment constructor.
Builder & InitialVelocityFps(uint16_t value)
Sets the initial velocity of the projectile in feet per second.
Builder & AltitudeOfFiringSiteFt(double value)
Sets the altitude of the firing site in feet.
Builder & MeplatDiameterInch(double value)
Sets the projectile meplat diameter in inches.
Builder & MinimumEnergy(uint16_t value)
Sets the minimum energy threshold for the solver.
Builder & BallisticCoefficientPsi(double value)
Move assignment constructor.
Builder & AirPressureInHg(double value)
Sets the air pressure in inches of mercury (inHg).
~Builder()
Default constructor.
Builder & DiameterInch(double value)
Sets the projectile diameter (caliber) in inches.
Builder & WindHeading(ClockAngleT value)
Sets the wind heading using a clock angle.
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:242
Builder & LatitudeDeg(double value)
Sets the latitude of the firing location in degrees.
Builder & OpticHeightInches(double value)
Sets the height of the optic above the bore in inches.
Builder & BCAtmosphere(AtmosphereReferenceT type)
Sets the atmosphere reference associated with ballistic coefficient.
Builder & Reset() noexcept
Resets the builder state by creating a fresh Impl object.
Builder & ZeroDistanceYds(double value)
Sets the zero distance in yards.
Builder & MinimumSpeed(uint16_t value)
Sets the minimum speed threshold for the solver.
Builder & RangeAngleDeg(double value)
Sets the range angle (inclination) to the target in degrees.
Builder(const Builder &other)
Default destructor.
Builder & WindSpeedMph(double value)
Sets the wind speed in miles per hour.
Builder & BCDragFunction(DragFunctionT type)
Sets the drag function associated with ballistic coefficient.
Builder & ZeroImpactHeightInches(double value)
Sets the zero impact height in inches.
Builder(Builder &&other) noexcept
Copy constructor.
Builder & NoseLengthInch(double value)
Sets the projectile nose length in inches.
Builder & AltitudeOfBarometerFt(double value)
Sets the altitude of the location where air pressure was taken in feet.
Builder & OgiveRtR(double value)
Sets the Rt/R ratio of the projectile ogive.
Builder & TwistInchesPerTurn(double value)
Sets the twist rate of the barrel in inches per turn.
Builder & WindSpeedFps(double value)
Sets the wind speed in feet per second.
Builder & StepSize(uint16_t value)
Sets the step size for the numerical solver.
Builder & MachVsDragTable(const float *pmachs, const float *pdrags, size_t size)
Loads a custom Mach vs Drag table for the projectile.
Builder & BaseDiameterInch(double value)
Sets the projectile base diameter in inches.
Builder & RelativeHumidityPercent(double value)
Sets the relative humidity at the firing site in percent.
Builder & AltitudeOfThermometerFt(double value)
Sets the altitude of the location where temperature was taken in feet.
LOB_EXPORT double PsiToInHg(double value)
Converts pounds per square inch (PSI) to inches of mercury.
enum LOB_EXPORT kLength
Definition lob.hpp:74
LOB_EXPORT double SToMs(double value)
Converts seconds to milliseconds.
enum LOB_EXPORT kBaseDiameter
Definition lob.hpp:69
constexpr T NaN()
Not-a-Number for floating-point values.
Definition lob.hpp:91
enum LOB_EXPORT kG7
G6 drag function.
Definition lob.hpp:31
enum LOB_EXPORT kMeplatDiameter
Definition lob.hpp:78
enum LOB_EXPORT DragFunctionT
Enumerates the supported drag functions.
Definition lob.hpp:26
LOB_EXPORT double JToFtLbs(double value)
Converts joules to foot-pounds.
LOB_EXPORT double SToUs(double value)
Converts seconds to microseconds.
enum LOB_EXPORT ErrorT
Definition lob.hpp:63
enum LOB_EXPORT kVI
five o'clock
Definition lob.hpp:54
enum LOB_EXPORT kWindHeading
Definition lob.hpp:83
enum LOB_EXPORT kNotFormed
Definition lob.hpp:87
enum LOB_EXPORT kV
four o'clock
Definition lob.hpp:53
LOB_EXPORT double MmToIn(double value)
Converts millimeters to inches.
enum LOB_EXPORT kBallisticCoefficient
Definition lob.hpp:68
enum LOB_EXPORT kX
nine o'clock
Definition lob.hpp:58
LOB_EXPORT double KphToMph(double value)
Converts kilometers per hour to miles per hour.
enum LOB_EXPORT kTailLength
Definition lob.hpp:82
LOB_EXPORT double InchToMil(double value, double range_ft)
Inches of projection at a given range to milliradians (MIL)
enum LOB_EXPORT kVII
six o'clock
Definition lob.hpp:55
LOB_EXPORT double MtoYd(double value)
Converts meters to yards.
enum LOB_EXPORT kAirPressure
Definition lob.hpp:65
enum LOB_EXPORT AtmosphereReferenceT
Enumerates the supported atmosphere reference types.
Definition lob.hpp:38
enum LOB_EXPORT kII
one o'clock
Definition lob.hpp:50
enum LOB_EXPORT kMaximumTime
Definition lob.hpp:77
LOB_EXPORT double YdToM(double value)
Converts yards to meters.
LOB_EXPORT double InToFt(double value)
Converts inches to feet.
LOB_EXPORT double DegToMoa(double value)
Converts degrees to minutes of angle (MOA).
LOB_EXPORT double UsToS(double value)
Converts microseconds to seconds.
LOB_EXPORT double MoaToDeg(double value)
Converts minutes of angle (MOA) to degrees.
enum LOB_EXPORT kG2
G1 drag function.
Definition lob.hpp:28
enum LOB_EXPORT kG8
G7 drag function.
Definition lob.hpp:32
enum LOB_EXPORT kMachDragTable
Definition lob.hpp:75
LOB_EXPORT double MoaToInch(double value, double range_ft)
Converts minutes of angle (MOA) to projected inches at a given range in feet.
enum LOB_EXPORT kVIII
seven o'clock
Definition lob.hpp:56
LOB_EXPORT double PaToInHg(double value)
Converts pascals to inches of mercury.
LOB_EXPORT double DegCToDegF(double value)
Converts degrees celsius to degrees fahrenheit.
LOB_EXPORT const char * Version()
Gets the library version in major.minor.patch format.
enum LOB_EXPORT kIcao
Army Standard Metro.
Definition lob.hpp:41
enum LOB_EXPORT kInitialVelocity
Definition lob.hpp:72
LOB_EXPORT double CmToIn(double value)
Converts centimeters to inches.
enum LOB_EXPORT kZeroDistance
Definition lob.hpp:85
LOB_EXPORT double KnToMph(double value)
Converts Knots to miles per hour.
enum LOB_EXPORT kLatitude
Definition lob.hpp:73
LOB_EXPORT size_t Solve(const Input &in, const uint32_t *pranges, Output *pouts, size_t size)
Solves the exterior ballistics problem for a given set of ranges.
enum LOB_EXPORT kG5
G2 drag function.
Definition lob.hpp:29
enum LOB_EXPORT kIV
three o'clock
Definition lob.hpp:52
enum LOB_EXPORT kRangeAngle
Definition lob.hpp:81
LOB_EXPORT double InchToMoa(double value, double range_ft)
Inches of projection at a given range to minutes of angle (MOA)
LOB_EXPORT double MToFt(double value)
Converts meters to feet.
LOB_EXPORT double InToMm(double value)
Converts inches to millimeters.
LOB_EXPORT double InchToDeg(double value, double range_ft)
Inches of projection at a given range to degrees.
LOB_EXPORT double GToGrain(double value)
Converts grams to grains.
enum LOB_EXPORT kMass
Definition lob.hpp:76
enum LOB_EXPORT kG6
G5 drag function.
Definition lob.hpp:30
LOB_EXPORT double KgSqMToPmsi(double value)
Converts kilograms per square meter to pounds mass per square inch.
enum LOB_EXPORT kIX
eight o'clock
Definition lob.hpp:57
LOB_EXPORT double MoaToIphy(double value)
Converts minutes of angle (MOA) to inches per hundred yards (IPHY).
LOB_EXPORT double MbarToInHg(double value)
Converts millibars to inches of mercury.
LOB_EXPORT double MsToS(double value)
Converts milliseconds to seconds.
LOB_EXPORT double MpsToFps(double value)
Converts meters per second to feet per second.
LOB_EXPORT double FtLbsToJ(double value)
Converts foot-pounds to joules.
enum LOB_EXPORT kNoseLength
Definition lob.hpp:79
LOB_EXPORT double MilToMoa(double value)
Converts milliradians (MIL) to minutes of angle (MOA).
LOB_EXPORT double DegToMil(double value)
Converts degrees to milliradians (MIL).
LOB_EXPORT double LbsToGrain(double value)
Converts pounds to grains.
LOB_EXPORT double FtToIn(double value)
Converts feet to inches.
enum LOB_EXPORT kAzimuth
Definition lob.hpp:67
LOB_EXPORT double FtToM(double value)
Converts feet to meters.
enum LOB_EXPORT kIII
two o'clock
Definition lob.hpp:51
enum LOB_EXPORT kZeroAngle
Definition lob.hpp:84
enum LOB_EXPORT kOgiveRtR
Definition lob.hpp:80
LOB_EXPORT double YdToFt(double value)
Converts yards to feet.
enum LOB_EXPORT kAltitude
Definition lob.hpp:66
LOB_EXPORT double KgToGrain(double value)
Converts kilograms to grains.
LOB_EXPORT double MilToInch(double value, double range_ft)
Converts milliradians (MIL) to projected inches at a given range in feet.
LOB_EXPORT double InToCm(double value)
Converts inches to centimeters.
enum LOB_EXPORT kHumidity
Definition lob.hpp:71
enum LOB_EXPORT ClockAngleT
Enumerates clock angle positions.
Definition lob.hpp:48
LOB_EXPORT double MilToIphy(double value)
Converts milliradians (MIL) to inches per hundred yards (IPHY).
LOB_EXPORT double FtToYd(double value)
Converts feet to yards.
LOB_EXPORT double MoaToMil(double value)
Converts minutes of angle (MOA) to milliradians (MIL).
enum LOB_EXPORT kXI
ten o'clock
Definition lob.hpp:59
LOB_EXPORT double MilToDeg(double value)
Converts milliradians (MIL) to degrees.
enum LOB_EXPORT kDiameter
Definition lob.hpp:70
LOB_EXPORT double FpsToMps(double value)
Converts feet per second to meters per second.
enum LOB_EXPORT kXII
eleven o'clock
Definition lob.hpp:61
Structure holding the output results of the ballistic calculation.
Definition lob.hpp:460
double elevation
Calculated energy in foot-pounds.
Definition lob.hpp:464
uint32_t range
Definition lob.hpp:461
double time_of_flight
Calculated windage deflection in inches.
Definition lob.hpp:466
uint16_t velocity
Associated range in yards.
Definition lob.hpp:462
uint32_t energy
Calculated velocity in feet per second.
Definition lob.hpp:463
double deflection
Calculated elevation change in inches.
Definition lob.hpp:465