Code Monkey home page Code Monkey logo

artill's Introduction

C++ Ballistic Calculator

This program implements the external ballistic model described in this paper.

The program is written in standard C++11 with one library dependency on Dlib that is included in sources (no need to download/install it separately).

What can you do with this program

  1. Run ballistic trajectories with different options: wind, air turbulences, initial height above the Earth’s surface; even send to space or orbit around the Earth.
  2. Solve for ranges or max - the programs finds the angles (for both flat and high trajectories) for a given range.
  3. Tune the drag coefficient function given some firing table data.

You would need to

  1. Define basic parameters of the projectile: mass, diameter, length; and muzzle velocity.
  2. Define drag coefficient function. If the function is not known, there is an option to generate this function from empirical data. See section Solve.

How to build

Automatic build

First, check out src directory. Build dlad and build drag. If you have make, type make and it should build. As a direct option use make PLAT=w for Windows or make PLAT=u for Unix builds. If you do not have make, then build manually.

Unix manual build

  1. Unpack dlib.tar.bz2
  2. Place dlib directory inside dlad.
  3. Compile dlibad.cpp, e.g. g++ -std=c++14 -c dlibad.cpp
  4. Compile all cpp files (except alglib.cpp, timer_inc.cpp, timer_w.cpp) inside drag, e.g. g++ -std=c++14 -c -I ../dlad *.cpp. This example command will actually spits errors on those files not to be compiled – that is fine.
  5. Copy dlibad.o from dlad to drag
  6. Link all .o files, e.g. g++ *.o -o drag

Windows manual build

If you have gcc installed, then follow Unix build instructions. If you use MS C++ compiler, check its version – it should be 19 or above:

C:\>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.24821 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.
  1. Unpack dlib.tar.bz2
  2. Place dlib directory inside dlad.
  3. Compile dlibad.cpp, e.g. cl -EHsc -c dlibad.cpp
  4. Compile all cpp files (except alglib.cpp, timer_inc.cpp, timer_u.cpp) inside drag, e.g. cl -EHsc -c -I ../dlad *.cpp. This example command will actually spits errors on those files not to be compiled – that is fine.
  5. Copy dlibad.obj from dlad to drag
  6. Link all .obj files, e.g. cl *.obj /Fedrag

How to run

See User Guide

artill's People

Contributors

mazonka avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.