ballistic 1.1.0 copy "ballistic: ^1.1.0" to clipboard
ballistic: ^1.1.0 copied to clipboard

Calculation of the bullet trajectory in flight, bullet drop, bullet path, bullet velocity, wind deflection, and terminal velocity in a 2D environment. |

example/main.dart

import 'package:ballistic/ballistic.dart';

void main() {
  var bc = createBallisticCoefficient(0.223, DragTableId.g1);
  var projectile = Projectile(bc, Weight(168, WeightUnit.grain));
  var ammo = Ammunition(projectile, Velocity(2750, VelocityUnit.fps));
  var zero = ZeroInfo.createZeroInfo(Distance(100, DistanceUnit.yard));
  var weapon = Weapon.createWeapon(Distance(2, DistanceUnit.inch), zero);
  var atmosphere = Atmosphere.createDefaultAtmosphere();
  var shotInfo = ShotParameters.createShotParameters(
      Angular(0.001228, AngularUnit.radian),
      Distance(1000, DistanceUnit.yard),
      Distance(100, DistanceUnit.yard));
  var wind = createOnlyWindInfo(Velocity(5, VelocityUnit.mph),
      Angular(-45, AngularUnit.degree));

  var calc = TrajectoryCalculator(
      maximumCalculatorStepSize: Distance(
          1, DistanceUnit.foot));
  var data = calc.trajectory(ammo, weapon, atmosphere, shotInfo, wind);

  for (var trajectoryData in data) {
    print("Bullet drops after ${trajectoryData.travelDistance.into(DistanceUnit.meter).toString()}");
    print(trajectoryData.drop.into(DistanceUnit.inch).toString());
  }
}
1
likes
160
points
53
downloads

Documentation

API reference

Publisher

verified publisherdeicon.de

Weekly Downloads

Calculation of the bullet trajectory in flight, bullet drop, bullet path, bullet velocity, wind deflection, and terminal velocity in a 2D environment. |

Repository (GitHub)
View/report issues

License

LGPL-3.0 (license)

Dependencies

matcher

More

Packages that depend on ballistic