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/AChaosHenonPhase.h | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 gui/libs/ofxAChaosLib/src/AChaosHenonPhase.h (limited to 'gui/libs/ofxAChaosLib/src/AChaosHenonPhase.h') 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 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 -- cgit v1.2.3