Skip to content

A repository for an in-class livecoding session implementing a numerical integrator. Also used as a starting point for Assignment 1, with solutions included in the `a1-solutions` branch.

License

timtro/livecode-projectile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

livecode-projectile


A simple implementation of an Euler integrator for projectile motion. This program was written (mostly) live, in lecture for SOFE-2850U in Fall 2017.

Next week, we will add drag and stopping conditions. The drag will make the output more interesting. Implementing stopping conditions in a generic way force us to introduce lambdas and templates.

Compilation

Compile with

clang++ -std=c++14 -o projectile projectile.cpp

or

g++ -std=c++14 -o projectile projectile.cpp

and run as

./projectile

and watch your terminal fill with numbers.

Output

The output will be six columns of numbers with the following order:

time [s], x-position [m], y-position [m], x-speed [m/s], y-speed [m/s]

Plot the, you get the familiar parabolic trajectory, which will depend on your constants:

About

A repository for an in-class livecoding session implementing a numerical integrator. Also used as a starting point for Assignment 1, with solutions included in the `a1-solutions` branch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages