|
lob 0.13.0
Exterior ballistics library — API + technical reference
|
Builder class for constructing Context objects with a friendly interface. More...
#include <lob.hpp>
Public Member Functions | |
| Builder () | |
| Default constructor. | |
| ~Builder () | |
| Destructor. | |
| Builder (const Builder &other) | |
| Builder (Builder &&other) noexcept | |
| Builder & | operator= (const Builder &rhs) |
| Copy assignment operator. | |
| Builder & | operator= (Builder &&rhs) noexcept |
| Move assignment operator. | |
| Builder & | BallisticCoefficientPsi (double value) |
| Sets the ballistic coefficient (Psi). | |
| Builder & | BCAtmosphere (AtmosphereReferenceT type) |
| Sets the atmosphere reference associated with ballistic coefficient. | |
| Builder & | BCAtmosphere (LobAtmosphereReferenceT type) |
| Sets the atmosphere reference associated with ballistic coefficient. | |
| Builder & | BCDragFunction (DragFunctionT type) |
| Sets the drag function associated with ballistic coefficient. | |
| Builder & | BCDragFunction (LobDragFunctionT type) |
| Sets the drag function associated with ballistic coefficient. | |
| Builder & | DiameterInch (double value) |
| Sets the projectile diameter (caliber) in inches. | |
| Builder & | MeplatDiameterInch (double value) |
| Sets the projectile meplat diameter in inches. | |
| Builder & | BaseDiameterInch (double value) |
| Sets the projectile base diameter in inches. | |
| Builder & | LengthInch (double value) |
| Sets the projectile length in inches. | |
| Builder & | NoseLengthInch (double value) |
| Sets the projectile nose length in inches. | |
| Builder & | TailLengthInch (double value) |
| Sets the projectile tail length in inches. | |
| Builder & | OgiveRtR (double value) |
| Sets the Rt/R ratio of the projectile ogive. | |
| Builder & | MachVsDragTable (const float *pmachs, const float *pdrags, size_t size) |
| Loads a custom Mach vs Drag table for the projectile. | |
| template<size_t N> | |
| Builder & | MachVsDragTable (const std::array< float, N > &machs, const std::array< float, N > &drags) |
| Loads a custom Mach vs Drag table for the projectile. | |
| template<size_t N> | |
| Builder & | MachVsDragTable (const std::array< float, N > &&machs, const std::array< float, N > &drags)=delete |
| template<size_t N> | |
| Builder & | MachVsDragTable (const std::array< float, N > &machs, const std::array< float, N > &&drags)=delete |
| template<size_t N> | |
| Builder & | MachVsDragTable (const std::array< float, N > &&machs, const std::array< float, N > &&drags)=delete |
| Builder & | BCVelocityBands (const float *pfps, const float *pbcvs, size_t size) |
| Loads ballistic coefficients measured at multiple velocities. | |
| template<size_t N> | |
| Builder & | BCVelocityBands (const std::array< float, N > &fps, const std::array< float, N > &bcvs) |
| Loads ballistic coefficients measured at multiple velocities. | |
| template<size_t N> | |
| Builder & | BCVelocityBands (const std::array< float, N > &&fps, const std::array< float, N > &bcvs)=delete |
| template<size_t N> | |
| Builder & | BCVelocityBands (const std::array< float, N > &fps, const std::array< float, N > &&bcvs)=delete |
| template<size_t N> | |
| Builder & | BCVelocityBands (const std::array< float, N > &&fps, const std::array< float, N > &&bcvs)=delete |
| Builder & | SplineCoefficients (const float *pcoefs) |
| Loads precomputed native spline coefficients for the drag curve. | |
| Builder & | SplineCoefficients (const std::array< float, kLobCoeffsSize > &coefs) |
| Loads precomputed native spline coefficients for the drag curve. | |
| Builder & | SplineCoefficients (const std::array< float, kLobCoeffsSize > &&coefs)=delete |
| Builder & | MassGrains (double value) |
| Sets the projectile mass in grains. | |
| Builder & | InitialVelocityFps (uint16_t value) |
| Sets the initial velocity of the projectile in feet per second. | |
| Builder & | OpticHeightInches (double value) |
| Sets the height of the optic above the bore in inches. | |
| Builder & | TwistInchesPerTurn (double value) |
| Sets the twist rate of the barrel in inches per turn. | |
| Builder & | ZeroAngleMOA (double value) |
| Sets the angle between the sight and launch angle used to achieve zero. | |
| Builder & | ZeroDistanceYds (double value) |
| Sets the zero distance in yards. | |
| Builder & | ZeroImpactHeightInches (double value) |
| Sets the zero impact height in inches. | |
| Builder & | AltitudeOfFiringSiteFt (double value) |
| Sets the altitude of the firing site in feet. | |
| Builder & | AirPressureInHg (double value) |
| Sets the air pressure in inches of mercury (inHg). | |
| Builder & | AltitudeOfBarometerFt (double value) |
| Sets the altitude of the location where air pressure was taken in feet. | |
| Builder & | TemperatureDegF (double value) |
| Sets the temperature in degrees Fahrenheit. | |
| Builder & | AltitudeOfThermometerFt (double value) |
| Sets the altitude of the location where temperature was taken in feet. | |
| Builder & | RelativeHumidityPercent (double value) |
| Sets the relative humidity at the firing site in percent. | |
| Builder & | WindHeading (ClockAngleT value) |
| Sets the wind heading using a clock angle. | |
| Builder & | WindHeading (LobClockAngleT value) |
| Sets the wind heading using a clock angle. | |
| Builder & | WindHeadingDeg (double value) |
| Sets the wind heading in degrees. | |
| Builder & | WindSpeedFps (double value) |
| Sets the wind speed in feet per second. | |
| Builder & | WindSpeedMph (double value) |
| Sets the wind speed in miles per hour. | |
| Builder & | WindProfile (const LobWindPoint *ppoints, size_t count) |
| Loads a downrange wind profile for the projectile. | |
| template<size_t N> | |
| Builder & | WindProfile (const std::array< LobWindPoint, N > &points) |
| Loads a downrange wind profile for the projectile. | |
| template<size_t N> | |
| Builder & | WindProfile (const std::array< LobWindPoint, N > &&points)=delete |
| Builder & | WindShearExponent (double value) |
| Sets the Hellmann shear exponent for wind profile height scaling. | |
| Builder & | AzimuthDeg (double value) |
| Sets the azimuth (bearing) of the target in degrees. | |
| Builder & | LatitudeDeg (double value) |
| Sets the latitude of the firing location in degrees. | |
| Builder & | RangeAngleDeg (double value) |
| Sets the range angle (inclination) to the target in degrees. | |
| Builder & | MinimumSpeed (uint16_t value) |
| Sets the minimum speed threshold for the solver. | |
| Builder & | MinimumEnergy (uint16_t value) |
| Sets the minimum energy threshold for the solver. | |
| Builder & | MaximumTime (double value) |
| Sets the maximum time of flight for the solver. | |
| Builder & | StepSize (uint16_t value) |
| Sets the step size for the numerical solver. | |
| Builder & | Reset () noexcept |
| Resets the builder state by re-initializing. | |
| Context | Build () |
| Builds the Context object with the configured parameters. | |
|
inline |
Default constructor.
|
inline |
Destructor.
|
inline |
<Copy constructor
|
inlinenoexcept |
<Move constructor
|
inline |
Sets the air pressure in inches of mercury (inHg).
| value | The air pressure in inHg. |
|
inline |
Sets the altitude of the location where air pressure was taken in feet.
| value | The altitude in feet. |
|
inline |
Sets the altitude of the firing site in feet.
| value | The altitude in feet. |
|
inline |
Sets the altitude of the location where temperature was taken in feet.
| value | The altitude in feet. |
|
inline |
Sets the azimuth (bearing) of the target in degrees.
| value | The azimuth in degrees. |
|
inline |
Sets the ballistic coefficient (Psi).
| value | The ballistic coefficient value. |
|
inline |
Sets the projectile base diameter in inches.
| value | The base diameter in inches. |
|
inline |
Sets the atmosphere reference associated with ballistic coefficient.
| type | The atmosphere reference type. |
|
inline |
Sets the atmosphere reference associated with ballistic coefficient.
| type | The atmosphere reference type. |
|
inline |
Sets the drag function associated with ballistic coefficient.
| type | The drag function type. |
|
inline |
Sets the drag function associated with ballistic coefficient.
| type | The drag function type. |
|
inline |
Loads ballistic coefficients measured at multiple velocities.
A projectile's effective BC varies with velocity. Supplying BCs at several velocities tailors the reference drag function to better fit the projectile's actual velocity-dependent drag.
| pfps | Pointer to an array of velocity values in fps. |
| pbcvs | Pointer to an array of associated BC values. |
| size | The number of fps-BC pairs in the table. Must be at least 2 and at most 16; velocities must be positive and strictly increasing, BCs positive, and the highest velocity below Mach 5. |
|
delete |
|
delete |
|
delete |
|
inline |
Loads ballistic coefficients measured at multiple velocities.
A projectile's effective BC varies with velocity. Supplying BCs at several velocities tailors the reference drag function to better fit the projectile's actual velocity-dependent drag.
| N | The number of fps-BC pairs in the table. Must be at least 2 and at most 16; velocities must be positive and strictly increasing, BCs positive, and the highest velocity below Mach 5. |
| fps | Reference to an array of velocity values in fps. |
| bcvs | Reference to an array of associated BC values. |
|
inline |
|
inline |
Sets the projectile diameter (caliber) in inches.
| value | The diameter in inches. |
|
inline |
Sets the initial velocity of the projectile in feet per second.
| value | The initial velocity in fps. |
|
inline |
Sets the latitude of the firing location in degrees.
| value | The latitude in degrees. |
|
inline |
Sets the projectile length in inches.
| value | The length in inches. |
|
inline |
Loads a custom Mach vs Drag table for the projectile.
This is a direct alternative to using a ballistic coefficient and a reference drag function.
| pmachs | Pointer to an array of mach values. |
| pdrags | Pointer to an array of associated drag values. |
| size | The number of mach-drag pairs in the table. |
|
delete |
|
delete |
|
delete |
|
inline |
Loads a custom Mach vs Drag table for the projectile.
This is a direct alternative to using a ballistic coefficient and a reference drag function.
| N | The number of mach-drag pairs in the table. |
| machs | Reference to an array of mach values. |
| drags | Reference to an array of associated drag values. |
|
inline |
Sets the projectile mass in grains.
| value | The mass in grains. |
|
inline |
Sets the maximum time of flight for the solver.
| value | The maximum time in seconds after which the solver will stop calculations. |
|
inline |
Sets the projectile meplat diameter in inches.
| value | The meplat in inches. |
|
inline |
Sets the minimum energy threshold for the solver.
| value | The minimum energy in foot-pounds (ft*lbf) at which the solver will stop calculations. |
|
inline |
Sets the minimum speed threshold for the solver.
| value | The minimum speed in feet per second (fps) at which the solver will stop calculations. |
|
inline |
Sets the projectile nose length in inches.
| value | The nose length in inches. |
|
inline |
Sets the Rt/R ratio of the projectile ogive.
| value | The Rt/R ratio. |
|
inline |
Sets the height of the optic above the bore in inches.
| value | The optic height in inches. |
|
inline |
Sets the range angle (inclination) to the target in degrees.
| value | The range angle in degrees. |
|
inline |
Sets the relative humidity at the firing site in percent.
| value | The relative humidity in percent. |
|
inlinenoexcept |
Resets the builder state by re-initializing.
|
inline |
Loads precomputed native spline coefficients for the drag curve.
Directly sets the 60 coefficients used by the solver, bypassing Mach-vs-drag table fitting and BC scaling. This is the lowest-level drag input, useful for round-tripping a previously built context or importing coefficients from another lob instance. The array is drags as stored in LobContext.drags.
Reset to return to a standard drag function. pcoefs valid until Build is called. The builder copies no data; the pointer is referenced during Build(). | pcoefs | Pointer to an array of kLobCoeffsSize coefficients. |
|
delete |
|
inline |
Loads precomputed native spline coefficients for the drag curve.
Directly sets the 60 coefficients used by the solver, bypassing Mach-vs-drag table fitting and BC scaling. This is the lowest-level drag input, useful for round-tripping a previously built context or importing coefficients from another lob instance. The array is drags as stored in LobContext.drags.
Reset to return to a standard drag function. Build is called; temporaries are rejected at compile time. | coefs | Reference to an array of kLobCoeffsSize coefficients. |
|
inline |
Sets the step size for the numerical solver.
| value | The spatial step size in inches. 0 = default. |
|
inline |
Sets the projectile tail length in inches.
| value | The tail length in inches. |
|
inline |
Sets the temperature in degrees Fahrenheit.
| value | The temperature in degrees F. |
|
inline |
Sets the twist rate of the barrel in inches per turn.
| value | The twist rate in inches per turn. |
|
inline |
Sets the wind heading using a clock angle.
| value | The wind heading as a clock angle. |
|
inline |
Sets the wind heading using a clock angle.
| value | The wind heading as a clock angle. |
|
inline |
Sets the wind heading in degrees.
| value | The wind heading in degrees. |
|
inline |
Loads a downrange wind profile for the projectile.
Point 0 sets the muzzle wind; all points are validated, normalized to the fixed 1-ft reference, resolved into the shooting frame, and stored as solver-ready nodes. A NaN measurement height assumes measurement at the 1-ft reference. The last wind-setting call wins: this overrides any uniform wind heading/speed, and those override this.
| ppoints | Pointer to an array of wind profile points. First range must be 0 with strictly increasing whole-foot ranges; headings finite degrees, speeds finite mph, heights positive or NaN. |
| count | The number of points. Must be 1..LOB_WIND_POINTS. |
|
delete |
|
inline |
Loads a downrange wind profile for the projectile.
Point 0 sets the muzzle wind; all points are validated, normalized to the fixed 1-ft reference, resolved into the shooting frame, and stored as solver-ready nodes. A NaN measurement height assumes measurement at the 1-ft reference. The last wind-setting call wins: this overrides any uniform wind heading/speed, and those override this.
| N | The number of wind profile points. Must be 1..LOB_WIND_POINTS. |
| points | Reference to an array of wind profile points. |
|
inline |
Sets the Hellmann shear exponent for wind profile height scaling.
Wind shear follows the power law with this exponent; scaling is off unless opted in with a nonzero value (0 disables it exactly). Defaults to 0 when unset. Typical values when enabling: open water 0.10, open grassland 0.143, farmland/crops 0.20, suburban 0.25, forest/urban 0.30.
| value | The shear exponent in [0, 1]. |
|
inline |
Sets the wind speed in feet per second.
| value | The wind speed in fps. |
|
inline |
Sets the wind speed in miles per hour.
| value | The wind speed in mph. |
|
inline |
Sets the angle between the sight and launch angle used to achieve zero.
| value | The zero angle in MOA. |
|
inline |
Sets the zero distance in yards.
| value | The zero distance in yards. |
|
inline |
Sets the zero impact height in inches.
| value | The zero impact height in inches. |