Skip to content

Instantly share code, notes, and snippets.

/LogisticMap Secret

Created December 6, 2015 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/304388230922386865dd to your computer and use it in GitHub Desktop.
Save anonymous/304388230922386865dd to your computer and use it in GitHub Desktop.
# include <Siv3D.hpp>
void Main()
{
Window::Resize(800, 400);
double a, x, x0;
int xa, ya;
x0 = 0.0001;
Image lm(800, 400, Palette::Black);
for (a = 1, x = x0; a < 4.0; a = a + 0.004){
xa = a * 200;
for (int i = 0; i < 400; i++){
x = a * x * (1 - x);
ya = 400 - x * 400;
lm[ya][xa] = Palette::White;
}
}
Texture texture(lm);
while (System::Update())
{
texture.draw();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment