Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I was messing around in C++, making an image where the pixels change depending on the the rectangle's dimensions and whether or not the space bar is down, and I formed this image:

enter image description here Could anyone explain why such a drastic change exists between the bottom left corner area and the rest?

I've never seen a fractal where a region is so unlike the rest (since after all, most fractals are have similar structures throughout and always repeat upon sufficient magnifications).

Also, forgive me if this image does not count as a fractal. Calling it a fractal is the only thing I can think to call it, due to the repetitive nature of the top right corner area.

Code:

#include "Game.h"
#include <math.h>

Game::Game( HWND hWnd,const KeyboardServer& kServer )
:   gfx ( hWnd ),
kbd( kServer ),
r(100), 
g(100),
b(100),
boxX(1),
boxY(1),
boxW(600),
boxH(300)



 {}

void Game::Go()
{
        gfx.BeginFrame();
    ComposeFrame();
    gfx.EndFrame();
}

void Game::ComposeFrame()
{
    int y = boxY;
    while (y < boxY+boxW)
    {
        int x = boxX;
        while(x < boxX + boxW + 200)
        {
            gfx.PutPixel(x, y, r/(45)*(x%y*(50-x)+25/x*y), g*(32)/(y%x*(y+23)+76*y/x), b/(32)*(x%y*(42-x)+75/x*y));
            x++;
        }
        y++;
    }
    if(kbd.SpaceIsPressed())
    {
        int x = boxX;
        int y = boxY;
        r = r/(45)*(x%y*(50-x)+25/x*y);
        g = g/(45)*(x%y*(50-x)+25/x*y);
        b = b/(45)*(x%y*(50-x)+25/x*y);

        if(r == 0 && g == 0 && b == 0)
        {
            r = 100;
            b = 100;
            g = 100;

        }
    }
    if(kbd.RightIsPressed())
    {

        boxX = boxX + 8;
    }
    if(kbd.LeftIsPressed())
    {
        boxX = boxX - 8;
    }
    if(kbd.UpIsPressed())
    {
        boxY = boxY - 8;
    }
    if(kbd.DownIsPressed())
    {
        boxY = boxY + 8;
    }
}
share|improve this question
1  
Please post the associated sourcecode. –  meh Mar 13 '13 at 5:28
    
I was weary about doing that since we're not on stack overflow but okay. –  ThroatOfWinter57 Mar 13 '13 at 5:29
    
I don't think it's a fractal. –  Kaster Mar 13 '13 at 5:31
    
I think the lack of total self similarity fails it too. Also, sorry for the poor organization and overall messiness of the code. I was fooling around. –  ThroatOfWinter57 Mar 13 '13 at 5:36
3  
Some cellular automata have output that looks like this: google.com/search?q=cellular+automata –  Qiaochu Yuan Mar 13 '13 at 5:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.