Group Abstract Group Abstract

Message Boards Message Boards

Red hair tips electric eel in fast and slow motion: translating from P5.JS processing to Wolfram

Red hair tips electric eel in fast and slow motion: translating from P5.JS processing to Wolfram

Attachments:
POSTED BY: Vitaliy Kaurov
2 Replies

A shorter version of code for interactive app part:

ClearAll["`*"];
x = Range[0., 9999];
k = 4 Cos[x/21];
e = x/1880 - 20;
d = Sqrt[k^2 + e^2];
m = UnitStep[k^2 - 15];

Manipulate[
 With[{q = 3 Sin[2 k] + .3/k + k Sin[x/4465] (9 + 2 Sin[14 e - 3 d + 2 t])},
  Graphics[
   ({Blend[{White, Red}, Sin[t]^2], Opacity[.5], PointSize[.01],
      Point@Pick[#, m, 1],
      White, Opacity[.75], PointSize[.0025],
      Point@Pick[#, m, 0]} &)@
    Transpose@{q + 50 Cos[d - t] + 200, 875 - q Sin[d - t] - 39 d},
   PlotRange -> {{100, 300}, {75, 320}},
   Background -> Black,
   ImageSize -> 550]],
 {t, 0, 2 Pi, Appearance -> "Labeled"},
 SaveDefinitions -> True]
POSTED BY: Vitaliy Kaurov

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard