Skip to content

Instantly share code, notes, and snippets.

@jkrumbiegel
Created September 19, 2021 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkrumbiegel/27ce8c72741e8f9259de3b8a4052a624 to your computer and use it in GitHub Desktop.
Save jkrumbiegel/27ce8c72741e8f9259de3b8a4052a624 to your computer and use it in GitHub Desktop.
multiple archimedes spiral makie
using CairoMakie
##
s = Scene(resolution = (500, 500), camera = campixel!, show_axis = false)
o = Point2f(250, 250)
n = 5
linewidth = 10
center_offset = 0
rotation_gain = 1.5
angle = 5pi
nsections = 1000
for i in 1:n
ps = map(range(0, angle, length = nsections)) do ang
r = center_offset + (i-0.5) * linewidth +
(ang / 2pi) * (n * linewidth * rotation_gain)
o + Point2f(cos(ang), sin(ang)) * r
end
lines!(s, ps, color = cgrad(:viridis, n, categorical = true)[i],
linewidth = linewidth)
end
s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment