Created
September 19, 2021 08:20
-
-
Save jkrumbiegel/27ce8c72741e8f9259de3b8a4052a624 to your computer and use it in GitHub Desktop.
multiple archimedes spiral makie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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