Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
Loading...
Searching...
No Matches
spirograph.cpp File Reference

Implementation of Spirograph More...

#include <array>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
Include dependency graph for spirograph.cpp:

Namespaces

namespace  spirograph
 

Macros

#define _USE_MATH_DEFINES
 

Functions

template<std::size_t N>
void spirograph::spirograph (std::array< std::pair< double, double >, N > *points, double l, double k, double rot)
 
void spirograph::test ()
 Test function to save resulting points to a CSV file.
 
int main (int argc, char **argv)
 

Detailed Description

Implementation of Spirograph

Author
Krishna Vedala

Implementation of the program is based on the geometry shown in the figure below:

Spirograph geometry from Wikipedia

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

required for MSVC compiler

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Main function

268 {
270
271#ifdef USE_GLUT
272 glutInit(&argc, argv);
273 glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
274 glutCreateWindow("Spirograph");
275 glutInitWindowSize(400, 400);
276 // glutIdleFunc(glutPostRedisplay);
277 glutTimerFunc(spirograph::animation_speed, spirograph::timer_cb, 0);
278 glutKeyboardFunc(spirograph::keyboard_cb);
279 glutDisplayFunc(spirograph::test2);
280 glutMainLoop();
281#endif
282
283 return 0;
284}
void test()
Test function to save resulting points to a CSV file.
Definition spirograph.cpp:93
Here is the call graph for this function: