Chaotic Motion  1.0
ChenLee.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 // http://chaoticatmospheres.deviantart.com/art/Strange-Attractors-The-Chen-Lee-Attractor-375986645
5 public class ChenLee : ChaosEqn {
6 
7  private float a ;
8  private float b ;
9  private float c ;
10 
11  public ChenLee() {
12  name = "ChenLee";
13 
14  eqnStrings = new string[]{
15  "xdot = ax - yz",
16  "ydot = by + xz",
17  "zdot = cz + xy/3"
18  };
19 
20  paramBundles = new ParamBundle[] {
21  new ParamBundle("default (scaled)", 5f, -10f, -0.38f,
22  new Vector3(1f,1f,1f), new Vector3(-04.1f,-04.4f,-15.5f), 0.15f),
23  new ParamBundle("default", 5f, -10f, -0.38f,
24  new Vector3(1f,1f,1f)),
25  };
26 
27  paramNames = new string[] { "a", "b", "c"};
28  slideShowSpeed = 1f;
29  }
30 
31  public override void SetParams(ParamBundle pb)
32  {
33  a = pb.eqnParam[0];
34  b = pb.eqnParam[1];
35  c = pb.eqnParam[2];
36  }
37 
38  public override void Function(ref float[] x_in, ref float[] x_out) {
39  x_out[0] = a*x_in[0]-x_in[1]*x_in[2];
40  x_out[1] = b*x_in[1]+x_in[0]*x_in[2];
41  x_out[2] = c*x_in[2]+x_in[0]*x_in[1]/3f;
42  }
43 
44 }
float[] eqnParam
parameters used in the equation
Definition: ParamBundle.cs:19
override void Function(ref float[] x_in, ref float[] x_out)
Evaluate the first order evolution of the attractor, given the current position.
Definition: ChenLee.cs:38
override void SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
Definition: ChenLee.cs:31
Chaos eqn. Base class for all equations that define a 3D chaotic system.
Definition: ChaosEqn.cs:9
Parameter bundle. Container class to hold the values for starting a chaotic system. Holds the parameters for the equations and the initial position and scale values.
Definition: ParamBundle.cs:13