/************************************************************************ * PLANETS.CPP Version 1.0 (Visual C++) 09/05/2000 * * --------------------------------------------------------------------- * * This program calculates the motions of N bodies submitted to their * * gravity attractions. The integration of motions is made by a Runge- * * Kutta method with controled time step to satisfy a required precision.* * * * C++ version by J-P Moreau * * (from a DOS program in pascal by J-P Dumont) * * (www.jpmoreau.fr) * * * * Uses: Planets.mak and Gr2d.cpp * ************************************************************************/ #include #include #include HDC hdc; RECT rect; //Functions of module Gr2D.cpp void Fenetre(double,double,double,double); void Cloture(int,int,int,int); void Bordure(); void Cercle(double,double,double,int); //"home made" graphic commands for hdc environment used by above functions void DrawPixel(int ix,int iy) { //sorry, no other available command found Rectangle(hdc,rect.left+ix,rect.top+iy, rect.left+ix+2,rect.top+iy+1); } void Swap(int *i1,int *i2) { int it; it=*i1; *i1=*i2; *i2=it; } void DrawLine(int ix1,int iy1,int ix2,int iy2) { int i,il,ix,iy; float dx,dy; if (ix2