Swarm-NG  1.1
parabolic_collision.cpp File Reference

Create test case for collision. More...

#include "swarm/swarm.h"
#include <iostream>

Go to the source code of this file.

Variables

const double xpos [4] = { -2.0, +2.0, -4.0, +4.0 }
 For first two, the collision should be at 1.8856 at 3.77125 they end up at each others position.
 
const double mu = 1
 mu = GM , but we have set both G and M to 1.
 
const double R = 1
 the minimum distance of the planets to the star on the parabolic orbit
 

Detailed Description

Create test case for collision.

Put two planets on a collision course in a parabolic orbit

If we place the star at (0,0,0) then a parabola in XY plane will be of the equation y = x^2/4r -r where r is the minimum distance of the planet to the star on Y axis.

the tangent line is (1, x/2r) which should be normalized.

The planets are put at x=-2 and x=+2. on the parabola and they are set to meet at the bottom of the parabola. They meet at (-1,0) at t=1.8856 .

Definition in file parabolic_collision.cpp.