|
lob 0.11.0
Exterior ballistics library — API + technical reference
|
#include <stddef.h>#include <stdint.h>#include "lob/lob_export.hpp"Go to the source code of this file.
Classes | |
| struct | LobGravity |
| Gravity vector. More... | |
| struct | LobWind |
| Wind vector. More... | |
| struct | LobCoriolis |
| Coriolis effect parameters. More... | |
| struct | LobContext |
| Structure of parameters consumed by the solver. More... | |
| struct | LobOutput |
| Structure holding the output results of a ballistic calculation. More... | |
| struct | LobBuilder |
| Opaque builder type for constructing LobContext objects. More... | |
Macros | |
| #define | LOB_SPLINE_SEGMENTS 15 |
| The number of spline pieces comprising a drag function. | |
| #define | LOB_BUILDER_BUFFER_SIZE 272 |
| The size in bytes of the builder buffer. | |
Typedefs | |
| typedef uint8_t | LobDragFunctionT |
| Drag function type. | |
| typedef uint8_t | LobAtmosphereReferenceT |
| Atmosphere reference type. | |
| typedef uint8_t | LobClockAngleT |
| Clock angle positions for wind direction. | |
| typedef uint8_t | LobErrorT |
| Error codes returned by the builder. | |
Functions | |
| const char * | LobVersion (void) |
| Gets the library version in major.minor.patch format. | |
| void | LobBuilderInit (LobBuilder *pbuilder) |
| Initializes a builder to default state. No-op if pbuilder is null. | |
| void | LobBuilderDestroy (LobBuilder *pbuilder) |
| Destroys a builder and releases resources. No-op if pbuilder is null. | |
| void | LobBuilderCopy (LobBuilder *dst, const LobBuilder *src) |
| Copies builder state from src to dst. No-op if either is null. | |
| LobBuilder * | LobBuilderReset (LobBuilder *pbuilder) |
| Resets a builder state by re-initializing. No-op if pbuilder is null. | |
| LobBuilder * | LobBuilderBallisticCoefficientPsi (LobBuilder *pbuilder, double value) |
| Sets the ballistic coefficient (Psi). | |
| LobBuilder * | LobBuilderBCAtmosphere (LobBuilder *pbuilder, LobAtmosphereReferenceT type) |
| Sets the atmosphere reference associated with ballistic coefficient. | |
| LobBuilder * | LobBuilderBCDragFunction (LobBuilder *pbuilder, LobDragFunctionT type) |
| Sets the drag function associated with ballistic coefficient. | |
| LobBuilder * | LobBuilderDiameterInch (LobBuilder *pbuilder, double value) |
| Sets the projectile diameter (caliber) in inches. | |
| LobBuilder * | LobBuilderMeplatDiameterInch (LobBuilder *pbuilder, double value) |
| Sets the projectile meplat diameter in inches. | |
| LobBuilder * | LobBuilderBaseDiameterInch (LobBuilder *pbuilder, double value) |
| Sets the projectile base diameter in inches. | |
| LobBuilder * | LobBuilderLengthInch (LobBuilder *pbuilder, double value) |
| Sets the projectile length in inches. | |
| LobBuilder * | LobBuilderNoseLengthInch (LobBuilder *pbuilder, double value) |
| Sets the projectile nose length in inches. | |
| LobBuilder * | LobBuilderTailLengthInch (LobBuilder *pbuilder, double value) |
| Sets the projectile tail length in inches. | |
| LobBuilder * | LobBuilderOgiveRtR (LobBuilder *pbuilder, double value) |
| Sets the Rt/R ratio of the projectile ogive. | |
| LobBuilder * | LobBuilderSplineFitTable (LobBuilder *pbuilder, const float *pmachs, const float *pdrags, size_t size) |
| Loads a custom Mach vs Drag table for the projectile. | |
| LobBuilder * | LobBuilderBCVelocityBands (LobBuilder *pbuilder, const float *pfps, const float *pbcs, size_t size) |
| Loads ballistic coefficients measured at multiple velocities. | |
| LobBuilder * | LobBuilderMassGrains (LobBuilder *pbuilder, double value) |
| Sets the projectile mass in grains. | |
| LobBuilder * | LobBuilderInitialVelocityFps (LobBuilder *pbuilder, uint16_t value) |
| Sets the initial velocity of the projectile in feet per second. | |
| LobBuilder * | LobBuilderOpticHeightInches (LobBuilder *pbuilder, double value) |
| Sets the height of the optic above the bore in inches. | |
| LobBuilder * | LobBuilderTwistInchesPerTurn (LobBuilder *pbuilder, double value) |
| Sets the twist rate of the barrel in inches per turn. | |
| LobBuilder * | LobBuilderZeroAngleMOA (LobBuilder *pbuilder, double value) |
| Sets the angle between the sight and launch angle used to achieve zero. | |
| LobBuilder * | LobBuilderZeroDistanceYds (LobBuilder *pbuilder, double value) |
| Sets the zero distance in yards. | |
| LobBuilder * | LobBuilderZeroImpactHeightInches (LobBuilder *pbuilder, double value) |
| Sets the zero impact height in inches. | |
| LobBuilder * | LobBuilderAltitudeOfFiringSiteFt (LobBuilder *pbuilder, double value) |
| Sets the altitude of the firing site in feet. | |
| LobBuilder * | LobBuilderAirPressureInHg (LobBuilder *pbuilder, double value) |
| Sets the air pressure in inches of mercury (inHg). | |
| LobBuilder * | LobBuilderAltitudeOfBarometerFt (LobBuilder *pbuilder, double value) |
| Sets the altitude of the location where air pressure was taken in feet. | |
| LobBuilder * | LobBuilderTemperatureDegF (LobBuilder *pbuilder, double value) |
| Sets the temperature in degrees Fahrenheit. | |
| LobBuilder * | LobBuilderAltitudeOfThermometerFt (LobBuilder *pbuilder, double value) |
| Sets the altitude of the location where temperature was taken in feet. | |
| LobBuilder * | LobBuilderRelativeHumidityPercent (LobBuilder *pbuilder, double value) |
| Sets the relative humidity at the firing site in percent. | |
| LobBuilder * | LobBuilderWindHeading (LobBuilder *pbuilder, LobClockAngleT value) |
| Sets the wind heading using a clock angle. | |
| LobBuilder * | LobBuilderWindHeadingDeg (LobBuilder *pbuilder, double value) |
| Sets the wind heading in degrees. | |
| LobBuilder * | LobBuilderWindSpeedFps (LobBuilder *pbuilder, double value) |
| Sets the wind speed in feet per second. | |
| LobBuilder * | LobBuilderWindSpeedMph (LobBuilder *pbuilder, double value) |
| Sets the wind speed in miles per hour. | |
| LobBuilder * | LobBuilderAzimuthDeg (LobBuilder *pbuilder, double value) |
| Sets the azimuth (bearing) of the target in degrees. | |
| LobBuilder * | LobBuilderLatitudeDeg (LobBuilder *pbuilder, double value) |
| Sets the latitude of the firing location in degrees. | |
| LobBuilder * | LobBuilderRangeAngleDeg (LobBuilder *pbuilder, double value) |
| Sets the range angle (inclination) to the target in degrees. | |
| LobBuilder * | LobBuilderMinimumSpeed (LobBuilder *pbuilder, uint16_t value) |
| Sets the minimum speed threshold for the solver. | |
| LobBuilder * | LobBuilderMinimumEnergy (LobBuilder *pbuilder, uint16_t value) |
| Sets the minimum energy threshold for the solver. | |
| LobBuilder * | LobBuilderMaximumTime (LobBuilder *pbuilder, double value) |
| Sets the maximum time of flight for the solver. | |
| LobBuilder * | LobBuilderStepSize (LobBuilder *pbuilder, uint16_t value) |
| Sets the step size for the numerical solver. | |
| void | LobBuilderBuild (LobBuilder *pbuilder, LobContext *presult) |
| Builds the LobContext object with the configured parameters. | |
| size_t | LobSolve (const LobContext *pctx, const uint32_t *pranges, LobOutput *pouts, size_t size) |
| Solves the exterior ballistics problem for a given set of ranges. Results contain a forward-solution. | |
| size_t | LobFastInverse (const LobContext *pctx, LobOutput *pouts, size_t size) |
| Converts forward-solution output to inverse-solution adjustments. | |
| size_t | LobSolveInverse (const LobContext *pctx, const uint32_t *pranges, LobOutput *pouts, size_t size) |
| Solves the exterior ballistics problem for a given set of ranges. Results contain an inverse-solution. | |
| double | LobMoaToMil (double value) |
| Converts minutes of angle (MOA) to milliradians (MIL). | |
| double | LobMoaToDeg (double value) |
| Converts minutes of angle (MOA) to degrees. | |
| double | LobMoaToIphy (double value) |
| Converts minutes of angle (MOA) to inches per hundred yards (IPHY). | |
| double | LobMoaToInch (double value, double range_ft) |
| Converts minutes of angle (MOA) to projected inches at a given range in feet. | |
| double | LobMilToMoa (double value) |
| Converts milliradians (MIL) to minutes of angle (MOA). | |
| double | LobMilToDeg (double value) |
| Converts milliradians (MIL) to degrees. | |
| double | LobMilToIphy (double value) |
| Converts milliradians (MIL) to inches per hundred yards (IPHY). | |
| double | LobMilToInch (double value, double range_ft) |
| Converts milliradians (MIL) to projected inches at a given range in feet. | |
| double | LobDegToMoa (double value) |
| Converts degrees to minutes of angle (MOA). | |
| double | LobDegToMil (double value) |
| Converts degrees to milliradians (MIL). | |
| double | LobInchToMoa (double value, double range_ft) |
| Inches of projection at a given range to minutes of angle (MOA). | |
| double | LobInchToMil (double value, double range_ft) |
| Inches of projection at a given range to milliradians (MIL). | |
| double | LobInchToDeg (double value, double range_ft) |
| Inches of projection at a given range to degrees. | |
| double | LobJToFtLbs (double value) |
| Converts joules to foot-pounds. | |
| double | LobFtLbsToJ (double value) |
| Converts foot-pounds to joules. | |
| double | LobMToYd (double value) |
| Converts meters to yards. | |
| double | LobYdToFt (double value) |
| Converts yards to feet. | |
| double | LobMToFt (double value) |
| Converts meters to feet. | |
| double | LobFtToIn (double value) |
| Converts feet to inches. | |
| double | LobMmToIn (double value) |
| Converts millimeters to inches. | |
| double | LobCmToIn (double value) |
| Converts centimeters to inches. | |
| double | LobYdToM (double value) |
| Converts yards to meters. | |
| double | LobFtToM (double value) |
| Converts feet to meters. | |
| double | LobFtToYd (double value) |
| Converts feet to yards. | |
| double | LobInToMm (double value) |
| Converts inches to millimeters. | |
| double | LobInToCm (double value) |
| Converts inches to centimeters. | |
| double | LobInToFt (double value) |
| Converts inches to feet. | |
| double | LobPaToInHg (double value) |
| Converts pascals to inches of mercury. | |
| double | LobMbarToInHg (double value) |
| Converts millibars to inches of mercury. | |
| double | LobPsiToInHg (double value) |
| Converts pounds per square inch (PSI) to inches of mercury. | |
| double | LobLbsToGrain (double value) |
| Converts pounds to grains. | |
| double | LobGToGrain (double value) |
| Converts grams to grains. | |
| double | LobKgToGrain (double value) |
| Converts kilograms to grains. | |
| double | LobKgSqMToPmsi (double value) |
| Converts kilograms per square meter to pounds mass per square inch. | |
| double | LobFpsToMps (double value) |
| Converts feet per second to meters per second. | |
| double | LobMpsToFps (double value) |
| Converts meters per second to feet per second. | |
| double | LobKphToMph (double value) |
| Converts kilometers per hour to miles per hour. | |
| double | LobKnToMph (double value) |
| Converts Knots to miles per hour. | |
| double | LobMsToS (double value) |
| Converts milliseconds to seconds. | |
| double | LobUsToS (double value) |
| Converts microseconds to seconds. | |
| double | LobSToMs (double value) |
| Converts seconds to milliseconds. | |
| double | LobSToUs (double value) |
| Converts seconds to microseconds. | |
| double | LobDegCToDegF (double value) |
| Converts degrees celsius to degrees fahrenheit. | |
| #define LOB_BUILDER_BUFFER_SIZE 272 |
The size in bytes of the builder buffer.
| #define LOB_SPLINE_SEGMENTS 15 |
The number of spline pieces comprising a drag function.
| typedef uint8_t LobAtmosphereReferenceT |
Atmosphere reference type.
| typedef uint8_t LobClockAngleT |
Clock angle positions for wind direction.
| typedef uint8_t LobDragFunctionT |
Drag function type.
| typedef uint8_t LobErrorT |
Error codes returned by the builder.
| anonymous enum |
| anonymous enum |
| anonymous enum |
| anonymous enum |
|
extern |
Sets the air pressure in inches of mercury (inHg).
| pbuilder | Pointer to the builder. |
| value | The air pressure in inHg. |
|
extern |
Sets the altitude of the location where air pressure was taken in feet.
| pbuilder | Pointer to the builder. |
| value | The altitude in feet. |
|
extern |
Sets the altitude of the firing site in feet.
| pbuilder | Pointer to the builder. |
| value | The altitude in feet. |
|
extern |
Sets the altitude of the location where temperature was taken in feet.
| pbuilder | Pointer to the builder. |
| value | The altitude in feet. |
|
extern |
Sets the azimuth (bearing) of the target in degrees.
| pbuilder | Pointer to the builder. |
| value | The azimuth in degrees. |
|
extern |
Sets the ballistic coefficient (Psi).
| pbuilder | Pointer to the builder. |
| value | The ballistic coefficient value. |
|
extern |
Sets the projectile base diameter in inches.
| pbuilder | Pointer to the builder. |
| value | The base diameter in inches. |
|
extern |
Sets the atmosphere reference associated with ballistic coefficient.
| pbuilder | Pointer to the builder. |
| type | The atmosphere reference type. |
|
extern |
Sets the drag function associated with ballistic coefficient.
| pbuilder | Pointer to the builder. |
| type | The drag function type. |
|
extern |
Loads ballistic coefficients measured at multiple velocities.
A projectile's effective BC varies with velocity. Supplying BCs at several velocities tailors the drag function set via LobBuilderBCDragFunction to better fit the projectile's actual velocity-dependent drag. A constant BC across all bands reproduces the result of LobBuilderBallisticCoefficientPsi with that BC.
| pbuilder | Pointer to the builder. |
| pfps | Pointer to an array of velocity values in feet per second. |
| pbcs | Pointer to an array of associated ballistic coefficients. |
| size | The number of velocity-bc pairs. 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. |
|
extern |
Builds the LobContext object with the configured parameters.
| pbuilder | Pointer to the builder. |
| presult | Pointer to the LobContext to populate. Null pointers are ignored (the call is a no-op). |
|
extern |
Copies builder state from src to dst. No-op if either is null.
|
extern |
Destroys a builder and releases resources. No-op if pbuilder is null.
|
extern |
Sets the projectile diameter (caliber) in inches.
| pbuilder | Pointer to the builder. |
| value | The diameter in inches. |
|
extern |
Initializes a builder to default state. No-op if pbuilder is null.
|
extern |
Sets the initial velocity of the projectile in feet per second.
| pbuilder | Pointer to the builder. |
| value | The initial velocity in fps. |
|
extern |
Sets the latitude of the firing location in degrees.
| pbuilder | Pointer to the builder. |
| value | The latitude in degrees. |
|
extern |
Sets the projectile length in inches.
| pbuilder | Pointer to the builder. |
| value | The length in inches. |
|
extern |
Sets the projectile mass in grains.
| pbuilder | Pointer to the builder. |
| value | The mass in grains. |
|
extern |
Sets the maximum time of flight for the solver.
| pbuilder | Pointer to the builder. |
| value | The maximum time in seconds after which the solver will stop calculations. |
|
extern |
Sets the projectile meplat diameter in inches.
| pbuilder | Pointer to the builder. |
| value | The meplat in inches. |
|
extern |
Sets the minimum energy threshold for the solver.
| pbuilder | Pointer to the builder. |
| value | The minimum energy in foot-pounds (ft*lbf) at which the solver will stop calculations. |
|
extern |
Sets the minimum speed threshold for the solver.
| pbuilder | Pointer to the builder. |
| value | The minimum speed in feet per second (fps) at which the solver will stop calculations. |
|
extern |
Sets the projectile nose length in inches.
| pbuilder | Pointer to the builder. |
| value | The nose length in inches. |
|
extern |
Sets the Rt/R ratio of the projectile ogive.
| pbuilder | Pointer to the builder. |
| value | The Rt/R ratio. |
|
extern |
Sets the height of the optic above the bore in inches.
| pbuilder | Pointer to the builder. |
| value | The optic height in inches. |
|
extern |
Sets the range angle (inclination) to the target in degrees.
| pbuilder | Pointer to the builder. |
| value | The range angle in degrees. |
|
extern |
Sets the relative humidity at the firing site in percent.
| pbuilder | Pointer to the builder. |
| value | The relative humidity in percent. |
|
extern |
Resets a builder state by re-initializing. No-op if pbuilder is null.
|
extern |
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.
| pbuilder | Pointer to the builder. |
| 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. |
|
extern |
Sets the step size for the numerical solver.
| pbuilder | Pointer to the builder. |
| value | The spatial step size in inches. 0 = default. |
|
extern |
Sets the projectile tail length in inches.
| pbuilder | Pointer to the builder. |
| value | The tail length in inches. |
|
extern |
Sets the temperature in degrees Fahrenheit.
| pbuilder | Pointer to the builder. |
| value | The temperature in degrees F. |
|
extern |
Sets the twist rate of the barrel in inches per turn.
| pbuilder | Pointer to the builder. |
| value | The twist rate in inches per turn. |
|
extern |
Sets the wind heading using a clock angle.
| pbuilder | Pointer to the builder. |
| value | The wind heading as a clock angle. |
|
extern |
Sets the wind heading in degrees.
| pbuilder | Pointer to the builder. |
| value | The wind heading in degrees. |
|
extern |
Sets the wind speed in feet per second.
| pbuilder | Pointer to the builder. |
| value | The wind speed in fps. |
|
extern |
Sets the wind speed in miles per hour.
| pbuilder | Pointer to the builder. |
| value | The wind speed in mph. |
|
extern |
Sets the angle between the sight and launch angle used to achieve zero.
| pbuilder | Pointer to the builder. |
| value | The zero angle in MOA. |
|
extern |
Sets the zero distance in yards.
| pbuilder | Pointer to the builder. |
| value | The zero distance in yards. |
|
extern |
Sets the zero impact height in inches.
| pbuilder | Pointer to the builder. |
| value | The zero impact height in inches. |
|
extern |
Converts centimeters to inches.
| value | Length in centimeters. |
|
extern |
Converts degrees celsius to degrees fahrenheit.
| value | Temperature in degrees celsius. |
|
extern |
Converts degrees to milliradians (MIL).
| value | Angle in degrees. |
|
extern |
Converts degrees to minutes of angle (MOA).
| value | Angle in degrees. |
|
extern |
Converts forward-solution output to inverse-solution adjustments.
| pctx | Pointer to context parameters for the calculation. |
| pouts | Pointer to an array of forward-solution outputs to convert in place. |
| size | The number of outputs to convert. |
|
extern |
Converts feet per second to meters per second.
| value | Speed in feet per second. |
|
extern |
Converts foot-pounds to joules.
| value | Energy in foot-pounds. |
|
extern |
Converts feet to inches.
| value | Length in feet. |
|
extern |
Converts feet to meters.
| value | Length in feet. |
|
extern |
Converts feet to yards.
| value | Length in feet. |
|
extern |
Converts grams to grains.
| value | Mass in grams. |
|
extern |
Inches of projection at a given range to degrees.
| value | Projected inches. |
| range_ft | Range in feet. |
|
extern |
Inches of projection at a given range to milliradians (MIL).
| value | Projected inches. |
| range_ft | Range in feet. |
|
extern |
Inches of projection at a given range to minutes of angle (MOA).
| value | Projected inches. |
| range_ft | Range in feet. |
|
extern |
Converts inches to centimeters.
| value | Length in inches. |
|
extern |
Converts inches to feet.
| value | Length in inches. |
|
extern |
Converts inches to millimeters.
| value | Length in inches. |
|
extern |
Converts joules to foot-pounds.
| value | Energy in joules. |
|
extern |
Converts kilograms per square meter to pounds mass per square inch.
| value | Sectional density in Kg/m^2. |
|
extern |
Converts kilograms to grains.
| value | Mass in kilograms. |
|
extern |
Converts Knots to miles per hour.
| value | Speed in Knots. |
|
extern |
Converts kilometers per hour to miles per hour.
| value | Speed in kilometers per hour. |
|
extern |
Converts pounds to grains.
| value | Mass in pounds. |
|
extern |
Converts millibars to inches of mercury.
| value | Pressure in millibars. |
|
extern |
Converts milliradians (MIL) to degrees.
| value | Angle in MIL. |
|
extern |
Converts milliradians (MIL) to projected inches at a given range in feet.
| value | Angle in MIL. |
| range_ft | Range in feet. |
|
extern |
Converts milliradians (MIL) to inches per hundred yards (IPHY).
| value | Angle in MIL. |
|
extern |
Converts milliradians (MIL) to minutes of angle (MOA).
| value | Angle in MIL. |
|
extern |
Converts millimeters to inches.
| value | Length in millimeters. |
|
extern |
Converts minutes of angle (MOA) to degrees.
| value | Angle in MOA. |
|
extern |
Converts minutes of angle (MOA) to projected inches at a given range in feet.
| value | Angle in MOA. |
| range_ft | Range in feet. |
|
extern |
Converts minutes of angle (MOA) to inches per hundred yards (IPHY).
| value | Angle in MOA. |
|
extern |
Converts minutes of angle (MOA) to milliradians (MIL).
| value | Angle in MOA. |
|
extern |
Converts meters per second to feet per second.
| value | Speed in meters per second. |
|
extern |
Converts milliseconds to seconds.
| value | Time in milliseconds. |
|
extern |
Converts meters to feet.
| value | Length in meters. |
|
extern |
Converts meters to yards.
| value | Length in meters. |
|
extern |
Converts pascals to inches of mercury.
| value | Pressure in pascals. |
|
extern |
Converts pounds per square inch (PSI) to inches of mercury.
| value | Pressure in PSI. |
|
extern |
Solves the exterior ballistics problem for a given set of ranges. Results contain a forward-solution.
| pctx | Pointer to context parameters for the calculation. |
| pranges | Pointer to an array of ranges (in feet) to solve for. |
| pouts | Pointer to an array where the output results will be stored. |
| size | The number of ranges to solve for. |
|
extern |
Solves the exterior ballistics problem for a given set of ranges. Results contain an inverse-solution.
| pctx | Pointer to context parameters for the calculation. |
| pranges | Pointer to an array of ranges (in feet) to solve for. |
| pouts | Pointer to an array where the output results will be stored. |
| size | The number of ranges to solve for. |
|
extern |
Converts seconds to milliseconds.
| value | Time in seconds. |
|
extern |
Converts seconds to microseconds.
| value | Time in seconds. |
|
extern |
Converts microseconds to seconds.
| value | Time in microseconds. |
|
extern |
Gets the library version in major.minor.patch format.
|
extern |
Converts yards to feet.
| value | Length in yards. |
|
extern |
Converts yards to meters.
| value | Length in yards. |