turn all the follwoing strange attractor equations into hlsl functions of this form:
float3 DadrasAttractor(in float3 xyz)
{
float x = xyz.x;
float y = xyz.y;
float z = xyz.z;
float dx = y - 3x + 2.7yz;
float dy = 1.7y - xz +z;
float dz = 2xy - 9z;
return float3(dx,dy,dz);
}
here are the equations :
const attractors = {
lorenz: attractor( 10.0 * (y - x), x * (28.0 - z) - y, x * y - 8.0 / 3.0 * z ),
lorenzmod1: attractor( -0.1 * x + y * y - z * z + 0.1 * 14.0, x * (y - 4.0 * z) + 0.08, z + x * (4.0 * y + z) , {dt: 0.5, shift: 28, scale: 0.5}),
lorenzmod2: attractor( -0.9 * x + y * y - z * z + 0.9 * 9.9, x * (y - 5.0 * z) + 1.0, -z + x * (5.0 * y + z) , {dt: 0.3, shift: 28, scale: 1, clip: 1000}),
rossler: attractor( 28.0 - z - y, x + 0.1 * y, 0.1 + (z - 28.0) * (x - 14.0) , {dt: 4}),
chua: attractor( 40.0 * (y - x), -12.0 * x - x * z + 28.0 * y, x * y - 3.0 * z , {dt: 0.3, zscale: 1.5}),
arneodo: attractor( y, z, 5.5 * x - 3.5 * y - z - x * x * x , {dt: 2, shift: 28, clip: 1000, scale: 3}),
chenlee: attractor( 5.0 * x - y * z, -10.0 * y + x * z, -0.38 * z + x * y / 3.0 , {shift: 28}),
coullet: attractor( y, z, 0.8 * x - 1.1 * y - 0.45 * z - x * x * x , {dt: 4, shift: 28, scale: 10, clip: 1000}),
dadras: attractor( y - 3.0 * x + 2.7 * y * z, 1.7 * y - x * z + z, 2.0 * x * y - 9.0 * z , {dt: 1, shift: 28, scale: 2}),
thomas: attractor( -0.19 * x + sin(y), -0.19 * y + sin(z), -0.19 * z + sin(x) , {dt: 8, shift: 28, scale: 5}),
tsucs1: attractor( 40.0 * (y - x) + 0.5 * x * z, 20.0 * y - x * z, 0.833 * z + x * y - 0.65 * x * x , {dt: 0.25, shift: 10, scale: 0.5, clip: 1000}),
tsucs2: attractor( 40.0 * (y - x) + 0.16 * x * z, 55.0 * x - x * z + 20.0 * y, 1.833 * z + x * y - 0.65 * x * x , {dt: 0.1, shift: 12, scale: 0.15}),
aizawa: attractor( (z - 0.7) * x - 3.5 * y, 3.5 * x + (z - 0.7) * y, 0.6 + 0.95 * z - (z * z * z / 3.0) - (x * x + y * y) * (1.0 + 0.25 * z) + 0.1 * z * (x * x * x) , {dt: 1.5, shift: 20, scale: 15, clip: 1000}),
nosehoover: attractor( y, -x + y * z, 1.5 - y * y , {dt: 4, shift: 28, scale: 6}),
yuwang: attractor( 10.0 * (y - x), 40.0 * x - 2.0 * x * z, exp(x * y) - 2.5 * z , {dt: 0.3, scale: 6.0, clip: 1000, zscale: 0.25, shift: -5}),
fourwing: attractor( 0.2 * x + y * z, -0.01 * x - 0.4 * y - x * z, -z - x * y , {dt: 4, shift: 28, scale: 10}),
liuchen: attractor( 0.4 * x - y * z, -12.0 * y + x * z, -5.0 * z + x * y , {dt: 2, shift: 28, scale: 2, clip: 1000}),
genesiotesi: attractor( y, z, -x - 1.1 * y - 0.44 * z + x * x , {dt: 4, shift: 28, scale: 30, clip: 100}),
newtonleipnik: attractor( 0.4 * x + y + 10.0 * y * z, -x - 0.4 * y + 5.0 * x * z, 0.175 * z - 5.0 * x * y , {dt: 0.05, shift: 28, scale: 0.5, clip: 1000}),
luchen: attractor( -4.0 * x + z * y, -10.0 * y + z * x, (10.0 * 4.0 * z) / 14.0 - y * x + 18.1 , {dt: 0.5, shift: 23, scale: 1.3}),
dequanli: attractor( 40.0 * (y - x) + 0.16 * x * z, 55.0 * x + 20.0 * y - x * z, 1.833 * z + x * y - 0.65 * x * x , {dt: 0.1, shift: 2, clip: 1000, scale: 0.2}),
halvorsen: attractor( -1.4 * x - 4.0 * (y + z) - y * y, -1.4 * y - 4.0 * (z + x) - z * z, -1.4 * z - 4.0 * (x + y) - x * x , {dt: 0.5, shift: 28, clip: 1000, scale: 2}),
rucklidge: attractor( -2.0 * x + 6.7 * y - y * z, x, -z + y * y , {dt: 4.0, shift: 10, clip: 1000, scale: 3}),
hadley: attractor( 4.0 * z * y + z * x - x, z * y - 4.0 * z * x - y + 1.0, -y * y - x * x - 0.2 * z + 0.2 * 8.0 , {shift: 15, scale: 10}),
wangsun: attractor( x * 0.2 + y * z, -0.01 * x + -0.4 * y - x * z, -z - x * y , {dt: 6.0, shift: 28, scale: 15}),
sakarya: attractor( -x + y + y * z, -x - y + 0.4 * x * z, z - 0.3 * x * y , {dt: 1, shift: 22, scale: 1}),
burkeshaw: attractor( -10.0 * (x + y), -y - 10.0 * x * z, 10.0 * x * y + 4.272 , {dt: 0.5, shift: 28, clip: 100, scale: 5}),
bouali: attractor( x * (4.0 - y) + 0.3 * z, -y * (1.0 - x * x), -x * (1.5 - z) - 0.05 * z , {dt: 1.0, shift: 28, scale: 2, clip: 100, scale: 1}),
qichen: attractor( 38.0 * (y - x) + y * z, 80.0 * x + y - x * z, x * y - 8.0 / 3.0 * z , {dt: 0.2, shift: -50, clip: 10000, scale: 0.5, zscale: 2}),
finance: attractor( y - 1.1 * x, (5.0 - 0.001) * y - x - y * z, -0.2 * z + y * y , {dt: 5, shift: -12, scale: 10}),
rayleighbenard: attractor( -9.0 * x + 9.0 * y, 12.0 * x - y - x * z, x * y - 0.5 * z , {dt: 2, shift: 5, clip: 10000, scale: 2}),
};
const eqns = {
lorenz: [
‘10 (y - x)’,
‘(28 - z) x - y’,
‘x y - \frac{8}{3} z’
],
lorenzmod1: [
‘-0.1 x + y^2 - z^2 + 0.14’,
‘x (y - 4 z) + 0.08’,
‘z + x (4 y + z)’
],
lorenzmod2: [
‘-0.9 x + y^2 - z^2 + 8.91’,
‘x (y - 5 z) + 1’,
‘-z + x (5 y + z)’
],
rossler: [
‘28 - z - y’,
‘x + 0.1 y’,
‘0.1 + (z - 28) (x - 14)’
],
chua: [
‘40 (y - x)’,
‘-12 x - x z + 28 y’,
‘x y - 3 z’
],
arneodo: [
‘y’,
‘z’,
‘5.5 x - 3.5 y - z - x^3’
],
chenlee: [
‘5 x - y z’,
‘-10 y + x z’,
‘-0.38 z + \frac{1}{3} x y’
],
coullet: [
‘y’,
‘z’,
‘0.8 x - 1.1 y - 0.45 z - x^3’
],
dadras: [
‘y - 3 x + 2.7 y z’,
‘1.7 y - x z + z’,
‘2 x y - 9 z’
],
thomas: [
‘-0.19 x + \sin(y)’,
‘-0.19 y + \sin(z)’,
‘-0.19 z + \sin(x)’
],
tsucs1: [
‘40 (y - x) + 0.5 x z’,
‘20 y - x z’,
‘0.833 z + x y - 0.65 x^2’
],
tsucs2: [
‘40 (y - x) + 0.16 x z’,
‘55 x - x z + 20 y’,
‘1.833 z + x y - 0.65 x^2’
],
aizawa: [
‘(z - 0.7) x - 3.5 y’,
‘3.5 x + (z - 0.7) y’,
‘0.6 + 0.95 z - \frac{1}{3}z^3 - (x^2 + y^2) (1 + 0.25 z) + 0.1 z x^3’
],
nosehoover: [
‘y’,
‘-x + y z’,
‘1.5 - y^2’
],
yuwang: [
‘10 (y - x)’,
‘40 x - 2 x z’,
‘e^{x y} - 2.5 z’
],
fourwing: [
‘0.2 x + y z’,
‘-0.01 x - 0.4 y - x z’,
‘-z - x y’
],
liuchen: [
‘0.4 x - y z’,
‘-12 y + x z’,
‘-5 z + x y’
],
genesiotesi: [
‘y’,
‘z’,
‘-x - 1.1 y - 0.44 z + x^2’
],
newtonleipnik: [
‘0.4 x + y + 10 y z’,
‘-x - 0.4 y + 5 x z’,
‘0.175 z - 5 x y’
],
luchen: [
‘-4 x + z y’,
‘-10 y + z x’,
‘\frac{20}{7} z - y x + 18.1’
],
dequanli: [
‘40 (y - x) + 0.16 x z’,
‘55 x + 20 y - x z’,
‘1.833 z + x y - 0.65 x^2’
],
halvorsen: [
‘-1.4 x - 4 (y + z) - y^2’,
‘-1.4 y - 4 (z + x) - z^2’,
‘-1.4 z - 4 (x + y) - x^2’
],
rucklidge: [
‘-2 x + 6.7 y - y z’,
‘x’,
‘-z + y^2’
],
hadley: [
‘4 z y + z x - x’,
‘z y - 4 z x - y + 1’,
‘-y^2 - x x - 0.2 z + 0.16’
],
wangsun: [
‘0.2 x + y z’,
‘-0.01 x + -0.4 y - x z’,
‘-z - x y’
],
sakarya: [
‘-x + y + y z’,
‘-x - y + 0.4 x z’,
‘z - 0.3 x y’
],
burkeshaw: [
‘-10 (x + y)’,
‘-y - 10 x z’,
‘10.0 x y + 4.272’
],
bouali: [
‘x (4 - y) + 0.3 z’,
‘-y (1 - x^2)’,
‘-x (1.5 - z) - 0.05 z’
],
qichen: [
‘38 (y - x) + y z’,
‘80 x + y - x z’,
‘x y - \frac{8}{3}z’
],
finance: [
‘y - 1.1 x’,
‘4.999 y - x - y z’,
‘-0.2 z + y^2’
],
rayleighbenard: [
‘-9.0 x + 9.0 y’,
‘12.0 x - y - x z’,
‘x y - 0.5 z’
],
};
const attractorLabels = {
aizawa: ‘Aizawa’,
arneodo: ‘Arneodo’,
bouali: ‘Bouali’,
burkeshaw: ‘Burke-Shaw’,
chua: ‘Chua’,
chenlee: ‘Chen-Lee’,
coullet: ‘Coullet’,
dadras: ‘Dadras’,
finance: ‘Finance’,
fourwing: ‘Four-Wing’,
genesiotesi: ‘Genesio-Tesi’,
hadley: ‘Hadley’,
halvorsen: ‘Halvorsen’,
dequanli: ‘Dequan-Li’,
lorenz: ‘Lorenz’,
lorenzmod1: ‘Lorenz Mod 1’,
lorenzmod2: ‘Lorenz Mod 2’,
liuchen: ‘Liu-Chen’,
luchen: ‘Lü-Chen’,
newtonleipnik: ‘Newton-Leipnik’,
nosehoover: ‘Nose-Hoover’,
qichen: ‘Qi-Chen’,
thomas: ‘Thomas’,
tsucs1: ‘TSUCS1’,
tsucs2: ‘TSUCS2’,
rayleighbenard: ‘Rayleigh-Benard’,
rossler: ‘Rössler’,
rucklidge: ‘Rucklidge’,
sakarya: ‘Sakarya’,
wangsun: ‘Wang-Sun’,
yuwang: ‘Yu-Wang’,
};