Message Boards Message Boards

[GIF] Twinkle (Pseudo-randomly located oscillators)

Pseudo-randomly located oscillators

Twinkle

Inspired by Jerome Herr. Here's the code:

DynamicModule[{points, start?, cols},
 cols = RGBColor /@ {"#598EA3", "#B0DDDF", "#F0AB7B", "#2D4861"};
 points = 
  RandomVariate[
   TransformedDistribution[
    r {Cos[?], Sin[?]}, {r \[Distributed] 
      NormalDistribution[1, 1/8], ? \[Distributed] 
      UniformDistribution[{0, 2 ?}]}], 1000];
 start? = RandomReal[{0, 2 ?}, 1000];
 Manipulate[
  Graphics[{Table[{cols[[Mod[i, 3, 1]]], 
      PointSize[.0065 + .0025 Sin[? + start?[[i]]]], 
      Point[points[[i]]]}, {i, 1, 1000}]}, Background -> cols[[4]], 
   PlotRange -> 1.9, ImageSize -> 540], {?, 0, 2 ?}]
 ]
5 Replies

enter image description here - another post of yours has been selected for the Staff Picks group, congratulations !

We are happy to see you at the tops of the "Featured Contributor" board. Thank you for your wonderful contributions, and please keep them coming!

POSTED BY: Moderation Team

This feels like something that could pop up in a Doctor Who episode, where it would of course contain a subliminal alien message. Wolfram Research, what have you done with RandomVariate? And don't tell me it's "random".

POSTED BY: Bianca Eifert

Wait, what's wrong with RandomVariate?

I'm sorry, I can't quite tell if you're playing along or if my joke was too silly to register as a joke... this forum needs smilies!

(Either way I enjoy the animation, obviously!)

POSTED BY: Bianca Eifert

Sorry, literalism gene kicked in there. Anyway, thanks for the kind words!

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

Group Abstract Group Abstract