Pursuit Curve Problem
This snippet of code visualizes the Pursuit Curves between different moving objects, either with an image or an animation. Simulation method has been used instead of mathematical formulation, using the pyglet library for rendering the images.
You can check my blog entry on the problem: Rotpunkt Blog, Pursuit Curves
Clone this repository on your local disk by executing the line below. Be aware you will download other small projects as well
git clone https://github.com/kokomero/miscelanea/
Install numpy and pyglet packages, these are available in the Python pip repository
Run the script passing as argument an input file with the description of the problem. Several files are provided for now for different problems. See .cfg files for scenario examples. In the configuration file you can easily setup the initial position of each of the moving object as well as their speed. Likewise, you choose whether you want an animated version of the problem of the resulting final image, as well as setting up parameters such as screen refreshing time.
python object_pursuit_curve.py -i four_body_problem.cfg
The simulation can be ended by pressing ESC key or closing the window.
Just copy the files in a local directory, make sure the required libraries are installed and execute the script following above instructions.
- Implement antialiasing
- Move line width and colors to the configuration file. Each moving object could have lines linking pursuers and leaders in different colors
- Define scenarios in 3D space, and be able to rotate the image in 3D
- Be able to define parametric velocity vector for a leader so that we can implement circular movements
- Wikipedia: Pursuit Curves, in English
- Wikipedia: Pursuit Curves, in French
- Universidad Complutense de Madrid: Page on Pursuit Curves, in Spanish
- Wolfram Research: entry for Pursuit Curves, in English
- Wikipedia: Envelope curves, in English
Feel free to contribute to this piece of code
- Victor Montiel - Initial work - Personal website
No licence for this project
- pyglet library