/************************************************************************** * * Copyright (c) 2000 Microsoft Corporation * * Module Name: * * Cycloid Drawing. * * Abstract: * * Routines for computing and drawing cycloids. * * Created: * * 06/11/2000 asecchia * Created it. * **************************************************************************/ #include "drawcycloid.hpp" /************************************************************************** * * Function Description: * * Test function to draw an example cycloid. * * Created: * * 06/11/2000 asecchia * Created it. * **************************************************************************/ void DrawTestCycloid(Graphics *g, int a, int b, int width, int height) { #define _2PI 2*3.141592653689 // Compute the center point for the cycle. float fXo=static_cast(width)/2.0f; float fYo=static_cast(height)/2.0f; float ScaleX = fXo/( (a>b)?a:a+b ); float ScaleY = fYo/( (a>b)?a:a+b ); int cycle=b/gcf(a,b); //number of times round the outer circle int Num = cycle*30; PointF *points = new PointF[Num]; // Compute the points tracking the cycloid path. for(int i=0; iDrawPolygon(&myPen, points, Num); #undef _2PI }