Julia で青海波を描く
plotter.jl を include
https://blog.goo.ne.jp/r-de-r/e/bd71a52a09801335d56f7c47d879bfe3
include("plotter.jl")
function seigaiha(nx=6, ny=6; r=1, color=:deepskyblue2, width=720, height=360)
function unit(x, y)
for i = 6r:-r:1
col = i % 2 == 1 ? :white : color
plotcircle(x, y, i, startangle=0, endangle=180, col=col, fcol=col)
end
end
plotbegin(w=width, h=height)
for j = 2ny:-1:0
for i = 0:nx
unit(i*12r + (j % 2)*6r, j*3r)
end
end
x1, y1 = 0, 3r
x2, y2 = 12nx*r, (6ny+3)r
plotlimit(x1, y1, x2, y2)
println("(width, height) = ($(x2 - x1), $(Int(y2 - y1)))")
plotend()
savefig("parts.pdf")
end
seigaiha()
savefig("fig1.png")
※コメント投稿者のブログIDはブログ作成者のみに通知されます