/************************************************************************** * THE BOLYGONES * * A "bolygone" is a mathematical equivalent of a game for kids consisting * * in creating nice figures with a piece of string around nails on a * * wooden board. Let be a circle with a radius=1, centered at point 0,0. * * Let us consider an angle at centre i varying from 0 to 360 degrees * * with a given step p. The bolygone of order n is the envelope of all the * * cords joining each angle i to the angle n.i, where n is an integer > 1. * * ----------------------------------------------------------------------- * * From "Graphisme dans le plan et dans l'espace avec Turbo Pascal 4.0 * * By R. Dony - MASSON, Paris 1990 page 49" [BIBLI 12]. * * * * Microsoft C++ version in API WINDOWS style by J-P Moreau * * (Program to use with Bolygone.mak and Gr2D.cpp) * * (www.jpmoreau.fr) * **************************************************************************/ #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 MoveXY(double,double); void LineXY(double,double); //"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