summaryrefslogtreecommitdiff
path: root/gui/libs/ofxAChaosLib/src/AChaosGinger.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/AChaosGinger.h
parentc10665e02e49da2d8f7e1a1eada151f17f507a21 (diff)
add altered AChaoslib
Diffstat (limited to 'gui/libs/ofxAChaosLib/src/AChaosGinger.h')
-rw-r--r--gui/libs/ofxAChaosLib/src/AChaosGinger.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/gui/libs/ofxAChaosLib/src/AChaosGinger.h b/gui/libs/ofxAChaosLib/src/AChaosGinger.h
new file mode 100644
index 0000000..53a1be2
--- /dev/null
+++ b/gui/libs/ofxAChaosLib/src/AChaosGinger.h
@@ -0,0 +1,55 @@
+/*
+ 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"
+
+class AChaosGinger : public AChaosBase {
+public:
+
+ REAL seed, nx, ny;
+
+ AChaosGinger(){}
+ ~AChaosGinger(){}
+
+ vector<string> param_labels={"seed","",""};
+
+ virtual void setup(REAL * params = NULL){
+
+ AChaosBase::init(params, 3, 2);
+ if(params==NULL){
+ //init
+ seed = 0.82f;
+ nx = 0.7f;
+ ny = 1.2f;
+
+ REAL p[3] = {seed,nx,ny};
+ set(p);
+ } else { set(params); }
+ }
+
+ void reset(){
+ seed = iv[0];
+ nx = iv[1];
+ ny = iv[2];
+ }
+
+ void calc(){
+ // ginger formulae
+ REAL x1,y1;
+
+ y1 = nx;
+ if (nx<0.) nx = -nx;
+ x1 = 1. - ny - seed*nx;
+
+ nx = x1;
+ ny = y1;
+
+ ov[0] = nx;
+ ov[1] = ny;
+ }
+}; \ No newline at end of file