Anonymous user
Fractal tree: Difference between revisions
Use library defined M_PI instead of "manual" precision.
m (→{{header|Wren}}: Changed to Wren S/H) |
imported>Qn1 (Use library defined M_PI instead of "manual" precision.) |
||
Line 551:
{{libheader|SGE}} or {{libheader|cairo}}
<syntaxhighlight lang="c" line="1">#include <SDL/SDL.h>
#ifdef WITH_CAIRO
#include <cairo.h>
Line 562:
#include <math.h>
#ifndef M_PI
#define
#endif
#define SIZE 800 // determines size of window
#define SCALE 5 // determines how quickly branches shrink (higher value means faster shrinking)
Line 627:
0.0, -1.0,
INITIAL_LENGTH,
BRANCHES);
SDL_UpdateRect(surface, 0, 0, 0, 0);
Line 664:
//--------------------------------------------------------------------------------------------------
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
//--------------------------------------------------------------------------------------------------
Line 786 ⟶ 788:
public:
fractalTree() { _ang = DegToRadian( 24.0f ); }
float DegToRadian( float degree ) { return degree * (
void create( myBitmap* bmp )
|