From fb68eed64f548d090eb550047fd0d898e4e033fc Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 8 Jul 2018 12:22:06 +0100 Subject: add altered AChaoslib --- gui/libs/ofxAChaosLib/src/AChaosTorus.h | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 gui/libs/ofxAChaosLib/src/AChaosTorus.h (limited to 'gui/libs/ofxAChaosLib/src/AChaosTorus.h') diff --git a/gui/libs/ofxAChaosLib/src/AChaosTorus.h b/gui/libs/ofxAChaosLib/src/AChaosTorus.h new file mode 100644 index 0000000..4426f4a --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosTorus.h @@ -0,0 +1,50 @@ +/* + 32/64 bits A-Chaos Lib in openFrameworks + (c) s373.net/x 2004, 2012, 2015 + http://s373.net/code/A-Chaos-Lib/A-Chaos.html + programmed by Andre Sier, revised 2015 + License: MIT +*/ +#pragma once +#include "AChaosBase.h" +#define pi 3.14159265358979323846264338327950288419716939937510f +#define twopi 2.*pi +class AChaosTorus : public AChaosBase { +public: + + REAL x0, y0, cr; + + vector param_labels={"nx","ny","cr"}; + + AChaosTorus(){} + ~AChaosTorus(){} + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 3, 2); + if(params==NULL){ + //init + x0 = 0.777f; + y0 = 1.2f; + cr = 1.26f; + + REAL p[3] = {x0,y0,cr}; + set(p); + } else { set(params); } + + } + + void reset(){ + x0 = iv[0]; + y0 = iv[1]; + cr = iv[2]; + } + + void calc(){ + x0 = fmodf((x0+cr*SIN(y0)), twopi); + y0 = fmodf((x0+y0), twopi); + + ov[0] = x0; + ov[1] = y0; + } +}; \ No newline at end of file -- cgit v1.2.3