Attribute VB_Name = "Module2" '*************************************************************************** '* 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]. * '* ----------------------------------------------------------------------- * '* The program asks for order n (usually from 2 to 30) and step of * '* increase in degrees (usually from 1 to 4). * '* * '* Visual Basic release by J-P Moreau. * '* (www.jpmoreau.fr) * '*************************************************************************** Sub Bolygone() Dim arad, c1, c2, pi As Double Dim adeg, ordre, pas As Integer pas = 1 ordre = InputBox("Input order of bolygon :", _ "Bolygon") adeg = 0: pi = 3.1416: c1 = 3200: c2 = 3000 Do arad = pi * adeg / 180 Form1.Line (700 + c1 + CInt(c1 * Cos(arad)), 150 + c2 + CInt(c2 * Sin(arad))) _ -(700 + c1 + CInt(c1 * Cos(ordre * arad)), 150 + c2 + CInt(c2 * Sin(ordre * arad))) adeg = adeg + pas Loop Until adeg > 360 Form1.Text1.Text = " N = " & Str(ordre) End Sub