Creative coding using strange attractors creates new species.

A shape like a jellyfish that created with Processing programming language.

New species found in the code!

It's a creative coding artwork made with the 'Processing'.

When I was playing with De Jong attractors, I found this formula occasionally makes a shape like a jellyfish.

x1 = sin(a * y0) - cos(b * x0) + sin(c * y0) - cos(d * x0);
y1 = sin(c * x0) - cos(d * y0) + sin(a * x0) - cos(b * y0);

But it is a very rare thing to make a shape. So I collected the right parameters by hand.







 

The 'Processing' example code.

Please feel free to use this example code under the terms of the GPL.
To see other works based on my code is my pleasure. And my honor.

/**
 * Is There Life Out There.
 * 
 * draw shape like a jellyfish.
 * 
 * @author @deconbatch
 * @version 0.2
 * Processing 3.2.1
 * created 0.1 2018.06.10
 * updated 0.2 2019.04.20 : use ArrayList to avoid duplicate parameter choosing.
 */

class Dna {

  ArrayList<float[]> dnaList;
  float     hueBase;

  Dna() {

    hueBase = random(360);

    float[][] dnas = {

      // Big Oval
      {1.1849121, 0.9095465, 0.8848125, -1.5089083},
      {0.93254054, -0.94148505, 0.6806822, 0.954301},
      {-0.7303996, 0.96663284, -0.7082044, 1.3012471},
      {1.4183311, -0.7739556, 0.8932247, -1.6508615},
      {1.0061936, 0.74306273, 0.57587314, -0.94024205},
      {-1.9807187, -0.98512995, 0.90511715, -1.1383728},
      {-0.39753437, -1.8430407, -1.5989869, 1.97157},
      {1.9872496,  -1.2223938,  0.75760174,  0.8577473},
      {-1.0212829, 1.8065041, -1.065195, -1.2893174},
      {-0.6682879, 1.1899773, -1.0501943, 0.97608304},
      {-0.95598626, -0.67845774, -0.5897205, -0.7853384},
      {-0.6002734, 1.6509838, 1.8099892, -1.0964627},
      {1.2138364, 1.8424428, 1.0873783, -1.5026784},
      {-0.6992879, -1.4193265, -1.2935817, -1.3413115},
      {0.35385942, -1.1933832, -1.7852755, -1.5394485},
      {-1.0097787, -1.7620895, -1.0556421, -1.9306729},
      {1.0139189, -1.6474402, -1.8250722, -1.7590555},
      {1.7736316, -0.99833524, 1.2907677, -1.2401295},
      {1.182705, 0.96390736, 1.9748241, -0.812695},

      // Big Round
      {-1.2797397, -0.87958217, -0.67786217, 1.278327},
      {1.8544704, -0.5590235, 0.8619487, 1.7108389},
      {-1.2070764, 0.80302453, -0.7602345, -1.4232765},
      {1.0074179, -1.1320828, 1.2655354, 0.9310633},

      // Big Rect
      {-0.8031204, 1.5344392, -0.24503994, -1.1079564},
      {-1.801286, -0.59856784, -1.4183506, 0.8612491},
      {1.0504521, -0.8799838, 0.59731424, 1.6561341},
      {-1.5126178, 0.96751165, -1.4654857, 0.39162695},
      {0.4748206, 1.4318291, 0.7834574, -0.78170085},
      {-1.882327, 0.7454052, -1.8220787, 0.59406745},
      {1.0037864, 1.04777, 0.3759683, -1.353185},
      {-0.2930424, -1.2779334, -0.25360557, -1.7757171},
      {0.17204833, -1.7023778, 0.56470084, 1.963506},
      {-0.6, -1.4539845, -0.2113738, -1.7798028},

      // Midium Oval
      {-1.9465947, 1.7589694, 1.389837, 1.7326984},
      {-1.730861, 0.95459366, -0.83617437, 0.24412167},
      {-1.5446866, -1.2540207, -0.31753004, -0.120238066},
      {-1.5951449, -1.0492635, -0.2364794, -0.29167426},
      {1.8142333, 1.6540196, -0.48046672, 0.13015974},
      {-1.6773063, -1.1689367, -0.45730066, -0.26610088},
      {1.4310315, -0.77496755, 0.018437862, -1.8364917},
      {1.6609163, 0.78412163, 0.96825004, -1.3146304},
      {1.3210852, 0.754848, 0.32918036, 1.8211994},
      {1.4341059, -0.9974872, -0.9644693, 1.3870964},
      {1.9581228, -0.78601146, 0.054947495, 1.7886631},
      {-1.7919123, -0.91870475, 0.33036876, -1.953738},
      {1.5484775, -0.51683605, 0.6441766, -1.6338},
      {1.6152817, -0.5806426, -0.7122184, 1.7577422},
      {-1.8441538, -0.22325456, -0.31500757, 1.241184},
      {-0.8945819, -1.3282559, -1.8884094, 0.101511955},
      {-0.4305334, 1.2295167, -1.4078912, 0.63412094},
      {0.69905794, -1.3268771, 1.8773909, 0.88926256},
      {0.9608946, 1.526935, 1.2917542, 0.6744671},
      {0.5857947, -1.4809624, 1.1994996, -0.8638495},
      {-0.5692072, -1.6045585, 1.5878702, -0.16901553},
      {-0.443424, 1.4503305, 1.5551313, -0.63595104},
      {-0.86442184, -1.4106861, -1.1665003, 0.19020247},
      {0.13074791, -1.6833956, -1.5791191, 0.90134645},
      {-0.9612212, -1.265603, -0.22904015, 0.5489944},
      {-0.10190797, -1.0497519, -0.7050872, -0.97304344},
      {-0.76477623, -0.6079043, -1.1919898, -0.3023368},
      {0.8834467, -0.9597125, -0.03519106, 1.0781043},
      {-0.8442018, 0.8730582, -0.0036774874, 1.2375482},
      {-0.055605173, -0.9984672, -0.9284352, -1.3113402},
      {1.7263665, -0.13234115, 0.9308158, -1.6337785},
      {1.0927025, -0.6339817, 0.39143145, 1.696924},
      {-1.6324822, -0.1511184, -0.50280654, -1.3972737},
      {1.8253258, -0.32701004, -0.7343477, 1.7417251},
      {1.3174697, -0.3380171, 0.84481204, 1.5128938},
      {-1.3373101, 0.7658353, -0.82038116, 1.0360359},
      {1.4618424, -0.30335462, 0.6859448, 1.4082092},
      {-1.4713892, -0.0446918, -0.38030994, 1.281949},
      {1.9282612, -0.56053495, 0.8357527, 1.7882413},
      {1.6614151, -0.9171884, 0.44198537, 0.97992384},
      {-1.895432, 0.8124887, -0.5809063, 1.4251728},
      {-1.3358968, 0.5784098, -0.656173, -1.7915728},
      {1.573155, -0.97604156, -0.49153805, -1.7673008},
      {1.3982303, 0.60875034, 0.8057699, -1.7793968},
      {1.5713205, -0.38313913, 0.8031683, 1.5579807},
      {1.689565, -0.9906876, -0.5665313, -1.7728505},
      {1.7615415, -0.089163184, -0.45041764, 1.7219753},
      {1.7335646, -0.6859281, 0.45778573, -1.8296082},
      {-1.4305836, -1.5645888, 0.13956404, 0.83102083},
      {-1.6462411, 1.0734643, -0.34455848, 0.72796464},
      {-1.976744, 1.657812, -0.9153664, -0.1308614},
      {-1.7427628, 1.7868494, 0.2976929, 0.24575019},
      {1.9509783, -1.9764297, -0.8395766, 0.7449101},
      {1.3177984, 0.1433264, 0.88074243, 0.8908167},
      {-0.7601371, -1.3737268, -1.2622802, 0.20960975},
      {-0.574955, -1.845849, -1.4538138, -0.8027086},
      {1.8942447, -1.3003662, -1.2996788, 1.6064854},
      {1.0643706, -1.1258738, -0.14309597, -1.1692727},
      {-0.74886227, 1.774987, -1.8375673, 0.29043174},
      {1.5574002, 1.8453715, 0.47246575, -0.78352594},
      {-1.9145522, -1.5549593, 1.3220832, 1.9297299},
      {-0.2231934, -1.1355813, 1.4720156, -1.5030069},
      {1.3413672,  1.848628,  0.07917428,  0.97517014},
      {0.2746935, -1.9293225, -1.9918222, -1.1164157},
      {-1.7496462, 0.44626546, 0.23361754, -1.7961285},
      {1.048422, -1.5934495, -1.8014144, 1.8853657},
      {-1.0119417, 0.9379139, 1.3950387, 1.7682558},
      {-1.3168592, -0.9006443, -0.8308315, -0.11977494},
      {-1.0619688, 0.8422779, -0.0039972067, 0.8684653},
      {-1.6818013, 0.8691511, -0.55203354, 0.69016147},
      {1.6240658, -1.7089772, 0.34328735, 0.56289184},
      {-1.4741437, 1.5583007, -0.2769848, -0.54520416},
      {1.6444424, -1.8289783, 0.50425446, 0.6019844},
      {-1.683015, 1.6719978, 0.29515135, -0.844509},
      {-1.4194199, 1.7347983, 0.6168746, -0.9466268},
      {-1.667172, -0.88657916, 0.051608205, 1.7629937},
      {-1.6650431, 0.37775326, 0.33541465, 1.8434201},
      {1.4223164, 0.55100656, 0.49716485, 1.6428655},
      {-1.5163244, 0.4479139, 0.036285758, -1.2978761},
      {-1.8220417, 0.69640577, 0.6617968, -1.7121897},
      
      // Midium Round
      {1.6460918, 0.7578703, 0.039756656, 1.6673663},
      {1.5850691, -0.77938485, -0.0088124275, -1.9552058},
      {-1.918999, 0.29473996, -0.1918658, 1.6541685},
      {-1.5164984, 0.9213618, -0.24812913, 1.714503},
      {-0.8824867, -1.5992742, -1.5625699, 0.66312945},
      {0.11071241, -1.9701986, -1.7158189, 0.745958},
      {0.08696866, 1.6187843, 1.742263, -0.6025481},
      {-0.910071, -1.3847178, -1.8182942, 0.4131807},
      {0.8275225, -1.6412234, 1.7822884, -0.67995834},
      {1.470601, -0.733212, 0.018205523, 1.6027497},
      {-1.8664721, -0.61742485, -0.5398445, 1.617141},
      {-1.3899937, -0.5352411, -0.048462868, 1.4123926},
      {1.521275, 0.26149035, 0.96596193, -1.1724942},
      {-1.8529294, 1.5464774, -0.99372435, -0.4649179},

      // Midium Rect
      {1.7804039, -0.122492075, 1.8946829, -1.3945198},
      {1.2306535, 1.8258467, 0.2621975, 0.86369896},
      {1.0511895, 1.7504905, 0.19852757, -0.6846205},
      {0.08815479, 1.7238736, -0.93964684, 1.2135742},
      {-0.08503556, -1.2355243, 0.61759496, -1.1704419},
      {-1.5153672, -1.6223017, 1.128174, 1.8484828},
      {1.6109155, -0.922786, -1.8774289, 1.3826112},
      {-1.5303104, 1.4835638, 1.955475, -1.3815746},
      {1.1972777, -1.6909255, -1.5501943, -1.0349056},
      {-1.3127844, -1.5479167, 1.8265626, -1.2843121},
      {1.8529391, 1.6386267, -1.4421663, -0.953791},
      {1.8401479, -1.6835139, -1.2599678, -1.5183538},
      {1.8532482, -1.802887, -1.412819, 1.2291515},
      {-1.2992105, 1.0856447, 1.6794627, 1.5119364},
      {0.51639056, 1.80406, -1.3071277, 1.2810354},
      {1.1143556, -1.8553946, -1.4474993, 1.5575024},
      {-0.0022146702, -1.2386405, 0.25423622, 1.1112525},
      {0.029160976, -1.7689974, -1.3037977, 1.5815482},
      {-1.1889801, -1.3818119, 0.24878383, -1.8614237},

      // Midium Long
      {1.6476917, 0.535202, 1.0525138, -0.79539895},
      {1.9704357, -1.7049251, -1.5149391, -1.141536},
      {1.7476617, 0.61932206, -0.22354555, -1.3771973},
      {1.718496, 1.5134321, -0.3304677, -0.55999243},
      {1.6859903, -1.1094145, 0.95170677, 0.03142214},
      {1.6628836, 0.7035632, -0.95645726, -1.727245},
      {1.472203, -0.898963, -0.9679501, -1.400193},
      {1.8290453, 0.7760278, -0.4744134, -1.4932538},
      {-1.2330908, 0.34469938, -0.49853098, -1.5406578},
      {1.715469, 0.04186046, -0.3836038, 1.1650492},
      {1.6984602, 0.68749607, -0.48256612, -1.3140318},
      {1.9247553, -1.0537516, 0.9806514, 0.4848814},
      {-0.4760959, 1.1698606, 1.6613967, -0.57288},
      {1.5750878, -0.3097632, 1.1259277, -0.45882177},
      {1.4875183, 0.23624885, 1.2554035, 0.89778733},

      // Midium Jellyfish
      {-1.337883, 0.7986244, -0.7287731, 0.37230742},
      {-1.3406851, -0.28214872, -0.5861671, -1.2162886},
      {-1.4316964, 0.3185227, -0.6400242, 1.1442337},
      {-1.0625868, -1.21026, -0.6712706, -0.46117342},
      {0.9189794, -1.1565351, 0.34334147, -0.79307437},
      {-1.0536402, -1.3200992, -0.5447396, 0.4220116},
      {-1.0032872, 1.2655714, -0.26810575, -0.52376616},
      {-1.6401721, 0.49672115, -0.86271167, 1.0925014},
      {-1.089398, 0.050195098, -0.7560389, 0.9639907},
      {-1.5165274, 0.45882142, -0.763324, 1.0880857},
      {1.2159896, 0.71907735, 1.7588662, -0.8050928},
      {-0.67342365, -1.1019428, -1.1452117, 0.29434526},
      {0.032641053, 0.7753694, -0.7903284, 0.91263294},
      {-1.7141302, -0.5167841, -0.91756153, -1.0736923},
      {-1.5073094, -0.18403065, -0.4235146, -1.1396475},
      {-1.5907371, -0.4164865, -0.29266846, 1.2113163},
      {-1.6313002, -0.91586375, -0.8607278, 1.0326489},
      {-1.7225821, 0.77831185, -0.19446528, -1.3474123},
      {-1.0811185, -0.547776, -0.11046791, -1.1848762},
      {-1.6915625, 0.75691473, -0.17169261, 1.5456556},
      {1.8049909, 0.30004144, -0.57724154, -1.8308672},
      {-1.0283998, -0.59822416, -0.11413801, 1.1734248},
      {-1.3578292, -0.45746374, -0.51071835, 1.1609248},
      {-1.1390313, -0.51329076, -0.54873264, 1.2952505},
      {-1.1412683, -0.8699349, -0.84301496, 0.52159405},
      {-1.1155736, 0.5643594, -0.72264886, -0.5976572},
      {-1.994314, 1.1001192, 1.0783195, 0.97809243},
      {-1.070556, 1.283265, -1.8349171, -0.92877495},
      {-1.18695, 1.6172869, -0.21208334, 0.9708407},
      {1.0284084, 0.90697336, 1.9091114, -0.48130915},
      {-0.3080871,  1.3259976,  -1.1706066,  0.5073533},
      {-0.69023013, -0.1302743, -1.8621659, -1.0325127},
      {-0.6484239, 1.2749679, -1.1394744, -0.44516706},
      {1.0016232, -1.622549, 1.5726357, 0.032066584},
      {-0.52549577, -0.67942905, -1.3125789, -0.5507343},
      {1.8917582, 0.15021777, -0.6037681, -1.8276622},
      {-1.568748, 0.9688648, -0.3640505, 0.50801337},
      {-1.0605584, 0.43145335, -0.28898394, 1.2417426},
      {1.4691906, -0.29476404, 0.3509971, -1.6438289},

      // Small Oval
      {-1.2209034, -1.9364693, 1.624037, -0.89463496},
      {-1.7154304, 0.30037725, 0.5552659, 1.8298564},
      {0.2816223, 1.7652395, -1.9630059, -0.0074948072},
      {-1.0999322, -0.7065116, 0.19727302, -1.6968937},
      {-1.428522, 1.4215118, -0.19567788, -0.28131342},
      {1.9320453, 0.29188907, -0.34393072, -1.694332},
      {1.5224934, -0.45708573, -0.1851772, 1.6764568},
      {1.5854416, 0.14847529, -0.37849796, -1.6866535},
      {-1.582921, -0.4308331, -0.003947735, 1.4218943},
      {1.4534781, -0.63194084, -0.12436688, 1.8669703},
      {1.5655034, 0.1567384, 0.38440907, -1.4910831},
      {1.3665309, 0.5035374, 0.58554673, 1.287977},
      {1.4358952, 0.2323507, 0.18323982, -1.3870456},
      {1.5138388, 0.56453073, 0.067702174, 1.6984639},
      {1.9535902, -0.309726, -0.1853993, 1.8736959},
      {0.18226886, 0.4491577, 1.4308531, -1.5269957},
      {1.5496799, 1.6239533, -0.07193291, 0.44251096},
      {1.6603223, -1.7008573, -0.9214597, -0.41860712},
      {-1.9872514, -1.949431, 0.28242278, -0.082980275},
      {1.2246487, 0.9815867, -0.33256805, -1.6527531},

      // Small Rect
      {1.066198, -0.9836912, -0.4956653, -1.4955009},
      {-1.8875654, 1.0541544, 1.6701783, 1.3673763},
      {1.021009, -1.2431176, -0.67271996, 0.87261355},
      {0.88199544, -1.416499, -1.2734511, -0.9998332},
      {-0.4624852, 0.8432921, 0.92639494, -1.5932047},
      {-1.1976266, -0.7914636, 0.8764535, -1.6663439},
      {-0.68983793, -0.79637814, 1.1002138, 1.9818056},
      {1.0020864, 1.3080509, -0.6799123, -0.81804633},
      {-0.40744567, 1.3564913, 0.843601, -0.79346967},
      {-0.5327811, 0.9770564, 0.97481287, 1.1749895},
      {-0.2816894,  -1.2925198,  -0.038594007,  0.6182854},
      {-1.9844887, -0.092148066, 1.1646574, -0.2779312},
      {-0.6, -1.1537788, 1.0042028, 1.1472845},

      // Small Jellyfish
      {1.5601017, 1.4882118, 0.42056704, -0.14340937},
      {1.1732215, 0.6332152, -0.5784129, 1.6936051},
      {1.5162741, 0.27948642, -0.69752645, 1.7646685},
      {1.58486, -0.27417886, 0.649879, -1.4235511},
      {-1.4250407, -1.1277831, -0.15991056, 0.33121157},
      {-1.4276958, 0.09797263, -0.3287897, 0.99054456},
      {0.40637827, -0.23529363, 1.9798067, -0.92299604},
      {-1.8401535, -0.99712443, -0.62072957, -0.19675004},

      // Star Wars Rebel Alliance
      {-1.5568858, -1.5821334, -1.2908077, -1.0470141},

      // Star Wars Empire
      {1.5798012, 1.2170191, 0.44912982, 0.9654827},

    };

    dnaList = new ArrayList<float[]>();
    for (float[] dna : dnas) {
      dnaList.add(dna);
    };

  }

  void changeHue() {
    hueBase = (hueBase + 120) % 360;
  }
  
  float getHue() {
    return hueBase;
  }

  float[] getRandomDna() {
    int choice = floor(random(dnaList.size()));
    float[] dnaChose = dnaList.get(choice);
    dnaList.remove(choice);
    return dnaChose;
  }

}


/* ---------------------------------------------------------------------- */
Dna dna;

void setup() {

  size(980, 980);
  colorMode(HSB, 360, 100, 100, 100);
  blendMode(SCREEN);
  smooth();
  noStroke();
  textSize(20);

  dna = new Dna();
  
}

void draw() {

  float[] rndDna = dna.getRandomDna();
  dna.changeHue();

  background(dna.getHue(), 100.0, 10.0, 100.0);
  translate(width / 2, height / 2);

  /*
    fill(0, 0, 100, 100);
    text("a=", 240, 340);  text(rndDna[0], 280, 340);
    text("b=", 240, 360);  text(rndDna[1], 280, 360);
    text("c=", 240, 380);  text(rndDna[2], 280, 380);
    text("d=", 240, 400);  text(rndDna[3], 280, 400);

    println(frameCount, "{", rndDna[0], ",", rndDna[1], ",", rndDna[2], ",", rndDna[3], "},");
    println();
  */

  float briMax = 50.0;
  
  float prevX = 0.0;
  float prevY = 0.0;
  float prevZ = 0.0;

  for (int i = 0; i < 2000000; ++i) {

    float x = sin(rndDna[0] * prevY) - cos(rndDna[1] * prevX) + sin(rndDna[2] * prevY) - cos(rndDna[3] * prevX);
    float y = sin(rndDna[2] * prevX) - cos(rndDna[3] * prevY) + sin(rndDna[0] * prevX) - cos(rndDna[1] * prevY);
    float z = sin(rndDna[0] * prevX) - cos(rndDna[1] * prevZ) + sin(rndDna[0] * prevY) - cos(rndDna[1] * prevZ);
    
    float size = 1;
    float hueApply = (dna.getHue() + map(z, -4.0, 4.0, 0.0, 90.0)) % 360;
    float briApply = map(z, -4.0, 4.0, briMax, 3.0);
    float alpApply = log(briMax) / log(briApply) * 35.0;

    fill(hueApply, 40, briApply, alpApply);
    pushMatrix();
    translate(x * width / 10.0, y * height / 10.0);
    ellipse(0, 0, size, size);
    popMatrix();

    prevX = x;
    prevY = y;
    prevZ = z;

  }

  saveFrame("frames/####.png");
  if (frameCount >= 3) {
    exit();
  }

}


/*
Copyright (C) 2018- deconbatch

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>
*/




Yet another example images.

A shape like a jellyfish that created with Processing programming language.
A shape like a jellyfish that created with Processing programming language.

 

Next Post Previous Post
No Comment
Add Comment
comment url