Message Boards Message Boards

Algebraic "millipede" by artist math Chirag Dudhat: various implementations in Wolfram Language

Posted 4 months ago


What you see above is a combined visualization of several solutions by our very talented members of sister community Mathematica Stack Exchange. I asked a question there that I also copy below. You can find their solutions at the link. I liked all solutions and combined them with a few image processing lines. How GiF was generated is shown at the end.

Math artist Chirag Dudhat specializes in simple math that does something interesting visually. He recently had a hit with a "millipede" simulation with simple complex plane formulas. Below is a small part and full video is here.

enter image description here

The full video has a frame with formulas he used:

enter image description here

Quoting Chirag Dudhat own words:

The equation displayed in the video , represents the movement of a single leg. Zroot is where the leg connects to the body, Zjoint is the point where the leg bends and Ztip is the free point of the leg which may touch the surface. Change the value of L from 1 to n for n number of legs. For example , L = 12 gives you the position of 12th leg on complex plane and changing the value of "t" will animate it. This equation gives you a straight walking millipede. However for this animation I drew a curved path on my iPad , exported svg file, extracted x and y coordinates of the path. Moving the centipede on this path is like attaching the legs to the path itself and sliding the whole structure on the curve.

Please note the bold text.

But it turned out to be a bit tricky to get from simple to final form. Here is what I tried. First of all his formulas have a bit different parameter numbers to get the effect and furthermore - another formula is needed to get decreasing size of legs, thier complete number, and some other details. So here is my set of formulas:

zR[L_]:=0.5I L


zJ[L_,t_]:=zR[L]+(-1)^L 3Exp[(5π I)/180 Sin[t+(π L)/6]]damp[L,maxL]
zT[L_,t_]:=zR[L]+(-1)^L 5Exp[(17π I)/180 Sin[t+(π L)/6]]damp[L,maxL]

zJs[L_,t_]:=zR[L]+(-1)^(L+1) 3Exp[(5π I)/180 Sin[t+(π L)/6]]damp[L,maxL]
zTs[L_,t_]:=zR[L]+(-1)^(L+1) 5Exp[(17π I)/180 Sin[t+(π L)/6]]damp[L,maxL]

This is easily animated with a Manipulate:


enter image description here

My question:

How can we make this millipede to move along a path in the plane? For instance a closed random loop given by spline or any other similar path:


Also, can we simplify all the code somehow? Feel free to get creative and create your own version if you want to. All millipedes moving along a curved path are cool :-)

Do not forget to check out answers HERE.

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 and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract