## Interactive ‘Slinky Thing’

Over at Playing with Mathematica, Sol Lederman has been looking at pretty parametric and polar plots. One of them really stood out for me, the one that Sol called ‘Slinky Thing’ which could be generated with the following Mathematica command.

ParametricPlot[{Cos[t] - Cos[80 t] Sin[t], 2 Sin[t] - Sin[80 t]}, {t, 0, 8}]

Out of curiosity I parametrised some of the terms and wrapped the whole thing in a Manipulate to see what I could see. I added 5 controllable parameters by turning Sol’s equations into

{Cos[e t] - Cos[f t] Sin[g t], 2 Sin[h t] - Sin[i t]}, {t, 0, 8}

Each parameter has its own slider (below). If you have Mathematica 8, or the free cdf player, installed then the image below will turn into an interactive applet which you can use to explore the parameter space of these equations.

Here are four of my favourites. If you come up with one that you particularly like then feel free to let me know what the parameters are in the comments.

I started playing with the applet just after finishing this post and came up with a couple more that I liked. For example,

e=5

f=80

g=80

h=55

i=50

or, to use a more compact notation

[5 80 80 55 50]

[4 79 3 3 74]

I experimented in recreating the plotting applet just using HTML5 controls, for anyone who wants to play with the parameters without using the cdf player extension.

http://dpcarlisle.blogspot.com/2011/07/slinky-canvas.html

Hi David

Thanks for that…it looks great. I tried to say as much on your blog but had difficulty with your comment system.

Cheers,

Mike

@Mike Croucher

Sorry about the comment problem, it’s just an out-the-box blogger setup, I had the horrible CAPTCHA word verification thing on as I was getting junk comments but I’ve turned it off again.

Bollocks. Now I have to write a MATLAB version, don’t I?

@Matt well you don’t HAVE to but it is kinda traditional ;)

Here are some that my friend and I came up with:

35 35 70 70 1

35 70 70 70 33

70 35 35 44 55

70 35 35 61 61

70 35 35 70 79

72 35 35 70 72

70 70 29 12 70

31 52 52 52 31

59 59 60 60 58

57 57 56 57 56

57 58 57 57 57

7 67 40 20 60

77 77 20 20 60

39 80 19 20 60

39 80 39 20 20

39 20 41 20 20

39 20 79 20 60

40 79 40 20 60

39 20 79 20 20

40 20 40 20 60

80 20 40 20 60

1 1 80 80 80

80 80 1 1 1

80 80 80 80 80

80 80 1 1 80

80 80 80 80 70

1 1 80 80 1

57 50 57 50 30

41 79 40 80 80

78 79 79 80 80

40 79 40 80 80

78 79 40 80 80

78 79 79 80 80

79 79 79 80 80

1 79 79 80 80

2 79 79 80 80

47 80 47 40 40

53 20 47 20 80

@Nessdude Wow! Some really nice ones there, thanks for sharing your findings.

@Mike Croucher

Sent you the code — share and enjoy!

fyi,

If you set the following: e=14, f=31, g=54, h=50, i=36, then change quality to any value over 15, then you will see a problem with the program.

–Nasser

Thanks for that Nasser. The problem occurs with any set of parameters e,f,g,h,i

As you point out, a quality factor of more than 15 causes an error.

I’ve uploaded a fixed version where the maximum quality is 15. This is because the maximum MaxRecursion that is allowed is 15.

Thanks so much for pointing out the error.

Cheers,

Mike

65 71 6 39 39

Another pure JavaScript version for those interested:

https://paulmasson.github.io/mathcell/docs/examples/slinky-thing.html

Part of an open-source project of mine.