diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-07-08 12:22:06 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-07-08 12:22:06 +0100 |
| commit | fb68eed64f548d090eb550047fd0d898e4e033fc (patch) | |
| tree | 890fa917ca6bd88505b45e5c261d05e0c5c9b6ec /gui/libs | |
| parent | c10665e02e49da2d8f7e1a1eada151f17f507a21 (diff) | |
add altered AChaoslib
Diffstat (limited to 'gui/libs')
27 files changed, 1588 insertions, 0 deletions
diff --git a/gui/libs/ofxAChaosLib/LICENSE b/gui/libs/ofxAChaosLib/LICENSE new file mode 100644 index 0000000..3538376 --- /dev/null +++ b/gui/libs/ofxAChaosLib/LICENSE @@ -0,0 +1,11 @@ +The MIT License (MIT) + +Copyright (c) 2004,2015 André Sier +Copyright (c) 1996 Richard Dudas + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/README.md b/gui/libs/ofxAChaosLib/README.md new file mode 100644 index 0000000..4916cd6 --- /dev/null +++ b/gui/libs/ofxAChaosLib/README.md @@ -0,0 +1,71 @@ +/* + 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 +*/ + +This A-Chaos Lib extends a tiny bit Richard Dudas' original "ChaosCollectionFAT" from October 1996 on the Max Programming Environment. + +A-Chaos Lib 1.01 +(a chaotic library for max systems / march 2004 (ppc+9) / jan 2005 (win)/ jun 2006 (ub)) + + +A-Chaos Lib is a library of non-linear strange attractors for the max programming environment extended from Richard Dudas' Chaos Collection, including the source. + + +(24 dynamic non-linear systems :: a-baker, a-clifford, a-collatz, a-duffing, a-fibonacci, a-ginger, a-henon-heilles, a-henon, a-henonf, a-henonphase, a-ikeda, a-jong, a-logistic, a-logistic1, a-lorenz, a-lorenz.e,a-lyapunov, a-navier-stokes, a-navier-stokes.e, a-rossler, a-stein, a-stein1, a-torus and a-verhulst) + +A-Chaos Lib web page +http://s373.net/code/A-Chaos-Lib/A-Chaos.html + + +Below you can find the original README from Richard Dudas. I asked Richard Dudas for permission to extend his collection, circa 2003+, after being immersed doing c.( ) (a 2h movie and an audio cd, still unreleased). + +http://andre-sier.com/projects/c-lv-copy/ +http://andre-sier.com/projects/c/ + +-AndrĂ© Sier (astronaut@s373.net) + + + + Chaos Collection (first release October 1996) + + The Chaos Collection is a suite of Max (Macintosh) External Objects which generate numeric values according to theories of certain non-linear dynamic systems: iterations of recursive equations and solutions of differential equations. These objects are "Fat" - they contain code for both 68k and PowerPC versions of Max. + + Those who are familiar with IRCAM's software "PatchWork" will recognize that these objects correspond to those included in the Orbitals section of PatchWork's Chaos Library written by Mikhail Malt. It was Mikhail's enthusiasm and support for my desire to convert this library to the real-time environment of Max that helped get the initial project off the ground. + + Many of the objects include abstraction versions (denoted bu the suffix ".a"). These versions are not intended to be used in practical situations, but rather to be studied; they are provided as an aid to understanding the computational processes on which the external objects are based. In general, the abstraction versions function similarly to the actual external objects which they represent, but may contain slight differences such as the messages they accept, the order of the inlets, etc... + + The objects and abstractions share a similar naming convention: + their names all begin with "chaos-" + + The External Objects themselves share a common interface: + a "bang" in the left inlet calculates an iteration of the equation + the equation's initial values may be set by sending an int or float to any one of the inlets + (a number in the leftmost inlet will also trigger the calculation) + the "set" message in the left inlet may also be used to set the initial values + (the "set" message will not trigger the calculation) + the "reset" message in the left inlet will reset the object's last initial values + the "info" message will display all current and initial valuers in the Max window + + The .help files provided also share a common user-interface. + a "metro" object is used to trigger a stream of calculations + The calculations are displayed graphically - so there's no sound !! + (the object's output is sent to a multislider or lcd depending on the object) + The lcd object may be cleared using the "clear" message provided. + (in some cases the scale of the display may be changed) + + Many of the equations used are very sensitive and require numbers within a specific range. No attempt has been made to prevent you from throwing these chaotic systems out of balance. + So, if one set of values doesn't work, try another! + A larger, more informative manual will hopefully be provided with the next release of the Chaos Collection. (You may want to refer to the PatchWork Chaos Library's documentation.) + + Caveats: + You may want to disable overdrive or change the speed of the metro when using Max 3.0 or earlier!!! The lcd object provided with these versions of Max tends to crash on fast machines. This problem has been fixed in the lcd which comes with Max 3.5. + + Although these objects are provided "as-is", bug reports are most certainly welcome. + + -Richard Dudas (dudas@ircam.fr) + + diff --git a/gui/libs/ofxAChaosLib/src/AChaosBaker.h b/gui/libs/ofxAChaosLib/src/AChaosBaker.h new file mode 100644 index 0000000..c0586c3 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosBaker.h @@ -0,0 +1,64 @@ +/* + 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 AChaosBaker : public AChaosBase { +public: + + REAL eval, init; + bool fold_cut; + + AChaosBaker(){} + ~AChaosBaker(){} + + vector<string> param_labels={"","init"}; + + virtual void setup(REAL * params = NULL){ + AChaosBase::init(params, 2, 1); + + if(params==NULL){ + eval = 0.85f; + init = 0.85f; + fold_cut = false; + REAL p[2] = {init,(REAL)fold_cut}; + set(p); + } else { + set(params); + } + + } + + void reset(){ + init = iv[0]; + fold_cut = iv[1] > 0.0f; + eval = init; + } + + void calc(){ + + if (!fold_cut) /* fold */ + { + if (eval > 0.5) + eval = 2. - (eval*2.); + else + eval *= 2.; + } + else /* cut */ + { + if (eval < 0.5) + eval *= 2.; + else + eval = (eval*2.) - 1.; + } + + ov[0] = eval; + + } +}; diff --git a/gui/libs/ofxAChaosLib/src/AChaosBase.h b/gui/libs/ofxAChaosLib/src/AChaosBase.h new file mode 100644 index 0000000..2a8b1d0 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosBase.h @@ -0,0 +1,69 @@ +/* + 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 + +// comment for 64bits version (not all objects support) +#define ACHAOS32 + +#ifdef ACHAOS32 +// 32bit + typedef float REAL; + #define SIN sinf + #define COS cosf + +#else +// 64bit + typedef double REAL; + #define SIN sin + #define COS cos + +#endif + + + +class AChaosBase { +public: + AChaosBase(){}; + ~AChaosBase(){} + + vector<REAL> iv; + vector<REAL> ov; + virtual void setup(REAL * params = NULL)=0; + + vector<string> param_labels; + + void init(REAL * params = NULL, int numiv=1, int numov=1){ + iv.clear(); + ov.clear(); + for(int i=0; i<numiv; i++){ + iv.push_back(0.0f); + } + for(int i=0; i<numov; i++){ + ov.push_back(0.0f); + } + cout << "A-Chaos Lib (c) Richard Dudas 1996, (c) Andre Sier 2004, 2012, 2015 " << __DATE__ << " " __TIME__ << endl; + } + virtual void reset(){cout << "reset base" << endl;} + void set(vector<REAL> ¶ms){ + iv.clear(); + for(int i=0; i<params.size();i++){ + iv.push_back( params[i] ); + } + reset(); + } + void set(REAL * params){ + for(int i=0; i<iv.size();i++){ + iv[i] = params[i] ; + } + reset(); + } + REAL * update(){ calc(); return get(); } + virtual void calc(){cout << "calc base" << endl;} + REAL * get(){ return &ov[0];} + vector<REAL> & getVec(){return ov;} +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosClifford.h b/gui/libs/ofxAChaosLib/src/AChaosClifford.h new file mode 100755 index 0000000..1bee069 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosClifford.h @@ -0,0 +1,65 @@ +/* + 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 clif_calc(a,b,c,d) (SIN((a)*(b))+(c)*COS((a)*(d))) + +class AChaosClifford : public AChaosBase { +public: + + REAL a, b, c, d, nx, ny; + + AChaosClifford(){} + ~AChaosClifford(){} + + vector<string> param_labels={"a","b","c","d","",""}; + + virtual void setup(REAL * params = NULL){ + + ofLog()<<"inherited setup for Baker "; + + AChaosBase::init(params, 6,2); + if(params==NULL){ + //init + a = -1.4f; + b = 1.6f; + c = 1.0f; + d = 0.7f; + //do not init x and y for more chaotic results + nx = 0.0f; + ny = 0.0f; + + REAL p[6] = {a,b,c,d,nx,ny}; + set(p); + } else { + set(params); + } + + } + + void reset(){ + a = iv[0]; + b = iv[1]; + c = iv[2]; + d = iv[3]; + nx = iv[4]; + ny = iv[5]; + } + + void calc(){ + // clifford attractor + // lx1 = sin (a*ny) + c*cos(a*nx); + // ly1 = sin (b*nx) + d*cos(b*ny); + nx = clif_calc(a, ny, c, nx); + ny = clif_calc(b, nx, d, ny); + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosCollatz.h b/gui/libs/ofxAChaosLib/src/AChaosCollatz.h new file mode 100644 index 0000000..f57d7b7 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosCollatz.h @@ -0,0 +1,58 @@ +/* + 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 AChaosCollatz : public AChaosBase { +public: + + long value, offset; + bool mode; + + + AChaosCollatz(){} + ~AChaosCollatz(){} + + vector<string> param_labels={"","offset"}; + + virtual void setup(REAL * params = NULL){ + AChaosBase::init(params, 3, 1); + + if(params==NULL){ + //init + value = offset = 0; + mode = 0; + + REAL p[3] = {(REAL)value,(REAL)offset,(REAL)mode}; + set(p); + } else { set(params); } + } + + void reset(){ + value = (long) iv[0]; + offset = (long) iv[1]; + mode = iv[2]>0; + } + + void calc(){ + + short int stub = value % 2; //par ou impar + + if(!mode) { // L.Collatz collatz mode + if (!stub) value /= 2; //par ]e metade + else value = 3*value+1; //impar ]e 3n+1 + } + else if (mode) { // Terras collatz mode + if (!stub) value /= 2; //par ]e metade + else value = 0.5*(3*value+1); //impar ]e 1/2(3n+1) + } + + ov[0] = (REAL)value; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosDuffing.h b/gui/libs/ofxAChaosLib/src/AChaosDuffing.h new file mode 100644 index 0000000..338c324 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosDuffing.h @@ -0,0 +1,57 @@ +/* + 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 AChaosDuffing : public AChaosBase { +public: + + REAL a, b, w, t, dt, nx, ny; + + AChaosDuffing(){} + ~AChaosDuffing(){} + + vector<string> param_labels={"a","b","w","t","dt","",""}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 7, 2); + if(params==NULL){ + //init + a = 0.25f; + b = 0.3f; + w = 1.0f; + nx = 0.0f; + ny = 0.0f; + dt = 0.01f; + t = 0.0f; + REAL p[7] = {a,b,w,nx,ny,dt,t}; + set(p); + } else { set(params); } + + } + + void reset(){ + a = iv[0]; + b = iv[1]; + w = iv[2]; + nx = iv[3]; + ny = iv[4]; + dt = iv[5]; + t = iv[6]; + } + + void calc(){ + t += dt; + nx = ny; + ny = nx-(nx*nx*nx)-(a*ny)+(b*COS(w*t)); + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file 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 diff --git a/gui/libs/ofxAChaosLib/src/AChaosHenon.h b/gui/libs/ofxAChaosLib/src/AChaosHenon.h new file mode 100644 index 0000000..cd42d8d --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosHenon.h @@ -0,0 +1,52 @@ +/* + 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 AChaosHenon : public AChaosBase { +public: + + REAL a, b, nx, ny; + + vector<string> param_labels={"a","b","",""}; + + AChaosHenon(){} + ~AChaosHenon(){} + + virtual void setup(REAL * params = NULL){ + AChaosBase::init(params, 4,2); + if(params==NULL){ + //init + a = 1.4f; + b = 0.3f; + nx = 1.0f; + ny = 1.0f; + + REAL p[4] = {a,b,nx,ny}; + set(p); + } else { + set(params); + } + } + + void reset(){ + a = iv[0]; + b = iv[1]; + nx = iv[2]; + ny = iv[3]; + } + + void calc(){ + // henon + nx = (ny + 1) - (a * (nx*nx)); + ny = b * nx; + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosHenonF.h b/gui/libs/ofxAChaosLib/src/AChaosHenonF.h new file mode 100644 index 0000000..384a6ab --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosHenonF.h @@ -0,0 +1,75 @@ +/* + 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 AChaosHenonF : public AChaosBase { +public: + + REAL a, b, nx, ny, dt, t; + + AChaosHenonF(){} + ~AChaosHenonF(){} + + vector<string> param_labels={"a","b","","","dt","t"}; + + + virtual void setup(REAL * params = NULL){ + AChaosBase::init(params, 5,2); + if(params==NULL){ + //init + a = 1.4f; + b = 0.3f; + nx = 1.0f; + ny = 1.0f; + dt = 0.01f; + t=0.0f; + REAL p[5] = {nx,ny,a,b,dt}; + set(p); + } else { + set(params); + } + } + + + void reset(){ + nx = iv[0]; + ny = iv[1]; + a = iv[2]; + b = iv[3]; + dt = iv[4]; + } + + void calc(){ + // Henon Phase Diagrams + REAL cosa=COS(a),sina=SIN(a), lx1, ly1, nx2=nx*nx; + + //henon calc + lx1 = (ny + 1) - (a * nx2); + ly1 = b * nx; + + //advance 'a' by dt _AFTER_ calculating henon + t += dt; + a *= t; + + //henon phase + nx = nx*cosa - (ny -nx2)*sina; + ny = nx*sina - (ny -nx2)*cosa; + + +/* + // henonf attractor + + lx1 = nx*cos (a) - (ny - (nx*nx))*sin(a); + ly1 = nx*sin(a) - (ny - (nx*nx))*cos(a); +*/ + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosHenonHeilles.h b/gui/libs/ofxAChaosLib/src/AChaosHenonHeilles.h new file mode 100644 index 0000000..c1aeb98 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosHenonHeilles.h @@ -0,0 +1,61 @@ +/* + 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 AChaosHenonHeilles : public AChaosBase { +public: + + REAL nx, ny, nxdot, nydot, e, dt; + + AChaosHenonHeilles(){} + ~AChaosHenonHeilles(){} + + vector<string> param_labels={"","","","","e","dt"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 5, 4); + if(params==NULL){ + //init + nx = 1.0f; + ny = 1.0f; + nydot = 1.4f; + e = 0.125f; + dt = 0.02; + REAL p[5] = {nx,ny, nydot,e,dt}; + set(p); + } else { set(params); } + + } + + void reset(){ + nx = iv[0]; + ny = iv[1]; + nydot = iv[2]; + e = iv[3]; + dt = iv[4]; + } + + void calc(){ + // henon_heilles_calc + REAL xdd,ydd; + + xdd = -nx-(2*nx*ny); + ydd = ny*ny -ny -(nx*nx); + nxdot += xdd*dt; + nydot += ydd*dt; + nx += nxdot*dt; + ny += nydot*dt; + + ov[0] = nx; + ov[1] = ny; + ov[2] = nxdot; + ov[3] = nydot; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosHenonPhase.h b/gui/libs/ofxAChaosLib/src/AChaosHenonPhase.h new file mode 100644 index 0000000..b5ffc42 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosHenonPhase.h @@ -0,0 +1,58 @@ +/* + 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 AChaosHenonPhase : public AChaosBase { +public: + + REAL a, b, nx, ny, dt, t; + + AChaosHenonPhase(){} + ~AChaosHenonPhase(){} + + vector<string> param_labels={"a","b","","","dt","t"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 5, 2); + if(params==NULL){ + //init + a = 1.4f; + b = 0.3f; + nx = 1.0f; + ny = 1.0f; + dt = 0.01f; + t=0.0f; + REAL p[5] = {nx,ny, a,b,dt}; + set(p); + } else { set(params); } + + } + + + + void reset(){ + nx = iv[0]; + ny = iv[1]; + a = iv[2]; + b = iv[3]; + dt = iv[4]; + } + + void calc(){ + // Henon Phase Diagrams + REAL cosa=COS(a),sina=SIN(a); + + nx = nx*cosa-(ny-nx*nx)*sina; + ny = nx*sina-(ny-nx*nx)*cosa; + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosIkeda.h b/gui/libs/ofxAChaosLib/src/AChaosIkeda.h new file mode 100644 index 0000000..105271b --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosIkeda.h @@ -0,0 +1,62 @@ +/* + 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 AChaosIkeda : public AChaosBase { +public: + + REAL a, b, k, p, nx, ny; + + AChaosIkeda(){} + ~AChaosIkeda(){} + + vector<string> param_labels={"a","b","k","p","",""}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 6, 2); + if(params==NULL){ + //init + a=0.85; + b=0.9; + k=0.4; + p=7.7; + nx=0; + ny=0; + REAL pa[6] = {nx,ny,a,b,k,p}; + set(pa); + } else { set(params); } + + } + + void reset(){ + nx = iv[0]; + ny = iv[1]; + a = iv[2]; + b = iv[3]; + k = iv[4]; + p = iv[5]; + } + + void calc(){ + REAL x0 = nx, y0 = ny; + REAL temp = (p/(1+x0*x0+y0*y0)); + REAL cosx = (COS(b-temp)); + REAL sinx = (SIN(b-temp)); + /* + xn+1 = a + k*( x0*cos(b-(p/(1+x0*x0+y0*y0))) - y0*sin(b-(p/(1*x0*x0+y0*y0))) ) + yn+1 = k*( x0*sin(b-(p/(1+x0*x0+y0*y0))) - y0*cos(b-(p/(1*x0*x0+y0*y0))) ) + */ + nx = a + k*(x0*cosx)-y0*sinx; + ny = k*sinx -y0*cosx; + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosJong.h b/gui/libs/ofxAChaosLib/src/AChaosJong.h new file mode 100644 index 0000000..6fe0f2b --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosJong.h @@ -0,0 +1,63 @@ +/* + 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 AChaosJong : public AChaosBase { +public: + + REAL a, b, c, d, nx, ny; + + vector<string> param_labels={"a","b","c","d","",""}; + + AChaosJong(){} + ~AChaosJong(){} + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 6, 2); + if(params==NULL){ + //init + a = 1.4f; + b = -2.3f; + c = 2.4f; + d = -2.1f; + nx = 0.0f; + ny = 0.0f; + REAL p[6] = {a,b,c,d,nx,ny}; + set(p); + } else { set(params); } + + } + + void reset(){ + a = iv[0]; + b = iv[1]; + c = iv[2]; + d = iv[3]; + nx = iv[4]; + ny = iv[5]; + } + + void calc(){ + // Peter de Jong attractor + // lx1 = sin(a*ny)-cos(b*nx); + // ly1 = sin(c*nx)-cos(d*ny); + + nx = SIN(a*ny)-COS(b*nx); + ny = SIN(c*nx)-COS(d*ny); + + ov[0] = nx; + ov[1] = ny; + + } + + + +}; diff --git a/gui/libs/ofxAChaosLib/src/AChaosLogistic.h b/gui/libs/ofxAChaosLib/src/AChaosLogistic.h new file mode 100644 index 0000000..c54cebd --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosLogistic.h @@ -0,0 +1,43 @@ +/* + 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 AChaosLogistic : public AChaosBase { +public: + + REAL seed, lambda; + + AChaosLogistic(){} + ~AChaosLogistic(){} + + vector<string> param_labels={"seed","lambda"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 2, 1); + if(params==NULL){ + //init + seed = 0.777f; + lambda = 3.9f; + REAL p[2] = {seed,lambda}; + set(p); + } else { set(params); } + } + + void reset(){ + seed = iv[0]; + lambda = iv[1]; + } + + void calc(){ + seed = lambda * seed * (1.0-seed); + + ov[0] = seed; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosLogistic1.h b/gui/libs/ofxAChaosLib/src/AChaosLogistic1.h new file mode 100644 index 0000000..488ca38 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosLogistic1.h @@ -0,0 +1,45 @@ +/* + 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 AChaosLogistic1 : public AChaosBase { +public: + + REAL seed, lambda, gamma; + + AChaosLogistic1(){} + ~AChaosLogistic1(){} + + vector<string> param_labels={"seed","lambda","gamma"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 3, 1); + if(params==NULL){ + //init + seed = 0.777f; + lambda = 3.9f; + gamma = 3.43f; + REAL p[3] = {seed,lambda,gamma}; + set(p); + } else { set(params); } + } + + void reset(){ + seed = iv[0]; + lambda = iv[1]; + gamma = iv[2]; + } + + void calc(){ + seed = (seed*lambda) -(gamma*seed*seed); + + ov[0] = seed; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosLorenz.h b/gui/libs/ofxAChaosLib/src/AChaosLorenz.h new file mode 100644 index 0000000..72e1efb --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosLorenz.h @@ -0,0 +1,83 @@ +/* + 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 lorx(x, y, a) (a) * ((y) - (x)); +#define lory(x, y, z, a) ((x) * ((r) - (z))) - (y); +#define lorz(x, y, z, c) ((x) * (y)) - ((z) * (c)); + +class AChaosLorenz : public AChaosBase { +public: + + REAL a, r, c, nx, ny, nz,dt; //eq variables + + vector<string> param_labels={"a","r","c","nx","ny","nz","dt"}; + + AChaosLorenz(){} + ~AChaosLorenz(){} + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 7, 3); + if(params==NULL){ + //classic lorenz + a=10.0; + r=28.0; + c= 2.67; + nx=0.1; + ny=0.1; + nz=0.1; + dt=0.01; + REAL p[7] = {nx,ny,nz,a,r,c,dt}; + set(p); + } else { set(params); } + + } + + + + void reset(){ + nx = iv[0]; + ny = iv[1]; + nz = iv[2]; + a = iv[3]; + r = iv[4]; + c = iv[5]; + dt = iv[6]; + } + + void calc(){ + + REAL dt2, fx, fy, fz, + ffx, ffy, ffz, + dtfx, dtfy, dtfz; + + dt2 = dt/2.; + + fx = lorx (nx,ny,a); + fz = lorz(nx,ny,nz,c); + fy = lory(nx,ny,nz,r); + + dtfx = nx + (dt*fx); + dtfy = ny + (dt*fy); + dtfz = nz + (dt*fz); + + ffx = lorx (dtfx,dtfy,a); + ffz = lorz(dtfx,dtfy,dtfz,c); + ffy = lory(dtfx,dtfy,dtfz,r); + + nx += (dt2*(fx+ffx)); + ny += (dt2*(fy+ffy)); + nz += (dt2*(fz+ffz)); + + ov[0] = nx; + ov[1] = ny; + ov[2] = nz; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosLorenzEuler.h b/gui/libs/ofxAChaosLib/src/AChaosLorenzEuler.h new file mode 100644 index 0000000..d23889d --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosLorenzEuler.h @@ -0,0 +1,69 @@ +/* + 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 lorx(x, y, a) (a) * ((y) - (x)); +#define lory(x, y, z, a) ((x) * ((r) - (z))) - (y); +#define lorz(x, y, z, c) ((x) * (y)) - ((z) * (c)); + +class AChaosLorenzEuler : public AChaosBase { +public: + + REAL a, r, c, nx, ny, nz,dt; //eq variables + + AChaosLorenzEuler(){} + ~AChaosLorenzEuler(){} + + vector<string> param_labels={"a","r","c","nx","ny","nz","dt"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 7, 3); + if(params==NULL){ + //classic lorenz + a=10.0; + r=28.0; + c= 2.67; + nx=0.1; + ny=0.1; + nz=0.1; + dt=0.01; + REAL p[7] = {nx,ny,nz,a,r,c,dt}; + set(p); + } else { set(params); } + + } + + + void reset(){ + nx = iv[0]; + ny = iv[1]; + nz = iv[2]; + a = iv[3]; + r = iv[4]; + c = iv[5]; + dt = iv[6]; + } + + void calc(){ + REAL dx, dy, dz; + + dx = ((ny*a)-(nx*a))*dt; + dy = ((nx*r)-ny-(nx*nz))*dt; + dz = ((nx*ny)-(nz*c))*dt; + + nx += dx; + ny += dy; + nz += dz; + + ov[0] = nx; + ov[1] = ny; + ov[2] = nz; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosLyapunov.h b/gui/libs/ofxAChaosLib/src/AChaosLyapunov.h new file mode 100644 index 0000000..b894ecd --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosLyapunov.h @@ -0,0 +1,69 @@ +/* + 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 lorx(x, y, a) (a) * ((y) - (x)); +#define lory(x, y, z, a) ((x) * ((r) - (z))) - (y); +#define lorz(x, y, z, c) ((x) * (y)) - ((z) * (c)); + +class AChaosLyapunov : public AChaosBase { +public: + + REAL a[6], b[6], nx, ny; + + vector<string> param_labels={"a1","a2","a3","a4","a5","a6","b1","b2","b3","b4","b5","b6","nx","ny"}; + + AChaosLyapunov(){} + ~AChaosLyapunov(){} + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 14, 2); + if(params==NULL){ + + a[0] = -1.4f; + a[1] = 0.7f; + a[2] = -0.16f; + a[3] = -1.21f; + a[4] = 1.11f; + a[5] = -1.46f; + b[0] = -0.19f; + b[1] = 0.04f; + b[2] = 1.59f; + b[3] = 1.3f; + b[4] = 1.68f; + b[5] = 1.76f; + nx = ny = 0.0f; + REAL p[14] = {a[0],a[1],a[2],a[3],a[4],a[5], + b[0],b[1],b[2],b[3],b[4],b[5],nx,ny}; + set(p); + } else { set(params); } + + } + + void reset(){ + nx = iv[12]; + ny = iv[13]; + for(int i=0; i<6; i++){ + a[i] = iv[i]; + } + for(int i=0; i<6; i++){ + b[i] = iv[i+6]; + } + } + + void calc(){ + // maybe lyapunov attractor : quadratic eq + nx = a[0] + a[1]*nx + a[2]*nx*nx + a[3]*nx*ny + a[4]*ny + a[5]*ny*ny; + ny = b[0] + b[1]*nx + b[2]*nx*nx + b[3]*nx*ny + b[4]*ny + b[5]*ny*ny; + + ov[0] = nx; + ov[1] = ny; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosNavierStokes.h b/gui/libs/ofxAChaosLib/src/AChaosNavierStokes.h new file mode 100644 index 0000000..885379e --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosNavierStokes.h @@ -0,0 +1,93 @@ +/* + 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 AChaosNavierStokes : public AChaosBase { +public: + + REAL a, b, c, d, e, r, dt; + + vector<string> param_labels={"nv","nw","nx","ny","nz","r","dt"}; + + AChaosNavierStokes(){} + ~AChaosNavierStokes(){} + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 7, 5); + + if(params==NULL){ + //classic navierstokes + a = 1.0; + b = 1.0; + c = 1.0; + d = 1.0; + e = 1.0; + r = 28.0; + dt = 0.01; + REAL p[7] = {a,b,c,d,e,r,dt}; + set(p); + } else { set(params); } + + } + + void reset(){ + a = iv[0]; + b = iv[1]; + c = iv[2]; + d = iv[3]; + e = iv[4]; + r = iv[5]; + dt = iv[6]; + } + +#define nava(a, b, c, d, e) ((-2*(a)) + (4*(b)*(c)) + (4*(d)*(e))) +#define navb(a, b, c) ((-9*(b)) + (3*(a)*(c))) +#define navc(a, b, c, r) ((-5*(c)) + (-7*(a)*(b)) + (r)) +#define navd(a, d, e) ((-5*(d)) - ((a)*(e))) +#define nave(a, d, e) ((-3*(a)*(d)) - (e)) + + void calc(){ + + REAL dt2=dt/2., afa, bfb, cfc, dfd, efe; + REAL fa, fb, fc, fd, fe; + REAL ffa, ffb, ffc, ffd, ffe; + + fa=nava(a, b, c, d, e); + fb=navb(a, b, c); + fc=navc(a, b, c, r); + fd=navd(a, d, e); + fe=nave(a, d, e); + + afa = a +(dt*fa); + bfb = b +(dt*fb); + cfc = c +(dt*fc); + dfd = d +(dt*fd); + efe = e +(dt*fe); + + ffa = nava(afa,bfb,cfc,dfd,efe); + ffb = navb(afa,bfb,cfc); + ffc = navc(afa,bfb,cfc,r); + ffd = navd(afa,dfd,efe); + ffe = nave(afa,dfd,efe); + + a += (dt2*(fa+ffa)); + b += (dt2*(fb+ffb)); + c += (dt2*(fc+ffc)); + d += (dt2*(fd+ffd)); + e += (dt2*(fe+ffe)); + + ov[0] = a; + ov[1] = b; + ov[2] = c; + ov[3] = d; + ov[4] = e; + + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosNavierStokesEuler.h b/gui/libs/ofxAChaosLib/src/AChaosNavierStokesEuler.h new file mode 100644 index 0000000..9018ce4 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosNavierStokesEuler.h @@ -0,0 +1,73 @@ +/* + 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 AChaosNavierStokesEuler : public AChaosBase { +public: + + REAL a, b, c, d, e, r, dt; + + AChaosNavierStokesEuler(){} + ~AChaosNavierStokesEuler(){} + + vector<string> param_labels={"nv","nw","nx","ny","nz","r","dt"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 7, 5); + if(params==NULL){ + //classic navierstokes + a = 1.0; + b = 1.0; + c = 1.0; + d = 1.0; + e = 1.0; + r = 28.0; + dt = 0.01; + REAL p[7] = {a,b,c,d,e,r,dt}; + set(p); + } else { set(params); } + + } + + void reset(){ + a = iv[0]; + b = iv[1]; + c = iv[2]; + d = iv[3]; + e = iv[4]; + r = iv[5]; + dt = iv[6]; + } + + + void calc(){ + + REAL da, db, dc, dd, de; + + da=((a * -2) + (4 * b * c) + (4 * d * e))*dt; + db=((b * -9) + (3 * a * c))*dt; + dc=((c * -5) + (-7 * a * b) + r)*dt; + dd=((d * -5) - (a * e))*dt; + de=((a * d * -3) - e)*dt; + + a += da; + b += db; + c += dc; + d += dd; + e += de; + + ov[0] = a; + ov[1] = b; + ov[2] = c; + ov[3] = d; + ov[4] = e; + + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosRossler.h b/gui/libs/ofxAChaosLib/src/AChaosRossler.h new file mode 100644 index 0000000..3bbbc42 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosRossler.h @@ -0,0 +1,74 @@ +/* + 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 rosx(y,z) -((y)+(z)) +#define rosy(x,y,a) (x)+((a)*(y)) +#define rosz(x,z,b,c) (b)+((x)*(z))-((c)*(z)) + +class AChaosRossler : public AChaosBase { +public: + + REAL a, b, c, nx, ny, nz,dt; + + vector<string> param_labels={"a","b","c","","","","dt"}; + + AChaosRossler(){} + ~AChaosRossler(){} + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 7, 3); + if(params==NULL){ + //classic rossler + a = 0.2; + b = 0.2; + c = 5.7; + nx = 1; + ny = 1; + nz = 1; + dt = 0.01; + REAL p[7] = {a,b,c,nx,ny,nz,dt}; + set(p); + } else { set(params); } + + } + + void reset(){ + a = iv[0]; + b = iv[1]; + c = iv[2]; + nx = iv[3]; + ny = iv[4]; + nz = iv[5]; + dt = iv[6]; + } + + + void calc(){ + REAL fx, fy, fz, ffx, ffy, ffz, dt2 = dt/2.; + REAL dtfx, dtfy, dtfz; + + fx = rosx(ny,nz); + fy = rosy(nx,ny,a); + fz = rosz(nx,nz,b,c); + + ffx = rosx((ny+dt*fy), (nz+(dt*fz))); + ffy = rosy((nx+dt*nx), (ny+dt*ny), a); + ffz = rosz((nx+dt*fx), (nz+dt*nz), b, c); + + nx += (dt2*(fx+ffx)); + ny += (dt2*(fy+ffy)); + nz += (dt2*(fz+ffz)); + + ov[0] = nx; + ov[1] = ny; + ov[2] = nz; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosStein.h b/gui/libs/ofxAChaosLib/src/AChaosStein.h new file mode 100644 index 0000000..f720bca --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosStein.h @@ -0,0 +1,46 @@ +/* + 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 pie 3.14159265358979323846 + +class AChaosStein : public AChaosBase { +public: + + REAL seed, lambda; + + AChaosStein(){} + ~AChaosStein(){} + + vector<string> param_labels={"seed","lambda"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 2, 1); + if(params==NULL){ + //init + seed = 0.777f; + lambda = 1.7f; + + REAL p[2] = {seed, lambda}; + set(p); + } else { set(params); } + } + + + void reset(){ + seed = iv[0]; + lambda = iv[1]; + } + + void calc(){ + seed = lambda * SIN(pie*seed); + + ov[0] = seed; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/AChaosStein1.h b/gui/libs/ofxAChaosLib/src/AChaosStein1.h new file mode 100644 index 0000000..df51da9 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosStein1.h @@ -0,0 +1,44 @@ +/* + 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 pie 3.14159265358979323846 +class AChaosStein1 : public AChaosBase { +public: + + REAL seed, lambda; + + AChaosStein1(){} + ~AChaosStein1(){} + + vector<string> param_labels={"","lambda"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 2, 1); + if(params==NULL){ + //init + seed = 0.87f; + lambda = 2.25f; + + REAL p[2] = {seed, lambda}; + set(p); + } else { set(params); } + } + + void reset(){ + seed = iv[0]; + lambda = iv[1]; + } + + void calc(){ + seed = lambda * seed * seed * SIN(pie*seed); + + ov[0] = seed; + } +};
\ No newline at end of file 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 diff --git a/gui/libs/ofxAChaosLib/src/AChaosVerhulst.h b/gui/libs/ofxAChaosLib/src/AChaosVerhulst.h new file mode 100644 index 0000000..78f5b32 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/AChaosVerhulst.h @@ -0,0 +1,46 @@ +/* + 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 AChaosVerhulst : public AChaosBase { +public: + + REAL seed, lambda; + + AChaosVerhulst(){} + ~AChaosVerhulst(){} + + vector<string> param_labels={"seed","lambda"}; + + virtual void setup(REAL * params = NULL){ + + AChaosBase::init(params, 2, 1); + if(params==NULL){ + //init + seed = 0.5f; + lambda = 2.89f; + + REAL p[2] = {seed,lambda}; + set(p); + } else { set(params); } + + + } + + void reset(){ + seed = iv[0]; + lambda = iv[1]; + } + + void calc(){ + seed = seed + (seed * lambda * (1.0-seed)); + + ov[0] = seed; + } +};
\ No newline at end of file diff --git a/gui/libs/ofxAChaosLib/src/ofxAChaosLib.h b/gui/libs/ofxAChaosLib/src/ofxAChaosLib.h new file mode 100644 index 0000000..3c3d712 --- /dev/null +++ b/gui/libs/ofxAChaosLib/src/ofxAChaosLib.h @@ -0,0 +1,32 @@ +/* + 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 "AChaosBaker.h" +#include "AChaosClifford.h" +#include "AChaosCollatz.h" +#include "AChaosDuffing.h" +#include "AChaosGinger.h" +#include "AChaosHenon.h" +#include "AChaosHenonF.h" +#include "AChaosHenonHeilles.h" +#include "AChaosHenonPhase.h" +#include "AChaosIkeda.h" +#include "AChaosJong.h" +#include "AChaosLogistic.h" +#include "AChaosLogistic1.h" +#include "AChaosLorenz.h" +#include "AChaosLorenzEuler.h" +#include "AChaosLyapunov.h" +#include "AChaosNavierStokes.h" +#include "AChaosNavierStokesEuler.h" +#include "AChaosRossler.h" +#include "AChaosStein.h" +#include "AChaosStein1.h" +#include "AChaosTorus.h" +#include "AChaosVerhulst.h" |
