Message Boards Message Boards

GROUPS:

[GIF] Twist (Spinning lines)

Posted 7 months ago
861 Views
|
1 Reply
|
4 Total Likes
|

Spinning lines

Twist

Very simple one this time. 100 points on the unit circle, each with a line segment passing through it, all rotating at the same speed but at different initial angles (the initial angles make 1.5 additional rotations relative to the radial line).

Here's the code:

With[{n = 100},
 Manipulate[
  Graphics[
   {CapForm["Round"], Thickness[.004],
    Table[
     {Hue[Mod[θ + t, 2 π]/(2 π)], 
      Line[{#, #} + RotationTransform[3/2 θ + t][.4 {-#, #}]] &[{Cos[θ], Sin[θ]}]},
     {θ, 0, 2 π - 2 π/n, 2 π/n}]},
   PlotRange -> 2, ImageSize -> 540, Background -> GrayLevel[.15]],
  {t, -π/4, 2 π - π/4}]
 ]

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming!

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