summaryrefslogtreecommitdiff
path: root/gui/libs/ofxAChaosLib/src/AChaosTorus.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-07-08 12:22:06 +0100
committerTim Redfern <tim@getdrop.com>2018-07-08 12:22:06 +0100
commitfb68eed64f548d090eb550047fd0d898e4e033fc (patch)
tree890fa917ca6bd88505b45e5c261d05e0c5c9b6ec /gui/libs/ofxAChaosLib/src/AChaosTorus.h
parentc10665e02e49da2d8f7e1a1eada151f17f507a21 (diff)
add altered AChaoslib
Diffstat (limited to 'gui/libs/ofxAChaosLib/src/AChaosTorus.h')
-rw-r--r--gui/libs/ofxAChaosLib/src/AChaosTorus.h50
1 files changed, 50 insertions, 0 deletions
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<string> 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