# 家紋シリーズ 輪違い(2) 丸に輪違い
plotter.jl を include
https://blog.goo.ne.jp/r-de-r/e/bd71a52a09801335d56f7c47d879bfe3
include("plotter.jl")
# 塗りつぶしリングを描く
function plotring(x, y, r1=1.0, r2=0.9; startangle=0, endangle=360, fcol=:black)
r1, r2 = max(r1, r2), min(r1, r2)
θ = startangle:endangle;
coordx = cosd.(θ);
coordy = sind.(θ);
plotpolygon(x .+ vcat(r1 .* coordx, r2 .* reverse(coordx)), y .+ vcat(r1 .* coordy, r2 .* reverse(coordy)), col=fcol, lwd=0, fcol=fcol)
end
function maruniwatigai(; r=1, r1=1.25r, r2 = 0.95r, width=400, height=400)
plotbegin(w=width, h=height)
plotring(0, 0, 2.2*r, 1.8*r, fcol=:black)
plotring( 0.5r, 0, r1, r2, fcol=:black)
plotring(-0.5r, 0, r1, r2, fcol=:black)
plotring( 0.5r, 0, r1+0.03r, r1, startangle=110, endangle=150, fcol=:white)
plotring( 0.5r, 0, r2-0.03r, r2, startangle= 90, endangle=130, fcol=:white)
plotring(-0.5r, 0, r1+0.03r, r1, startangle=290, endangle=330, fcol=:white)
plotring(-0.5r, 0, r2-0.03r, r2, startangle=270, endangle=310, fcol=:white)
plotend()
end
maruniwatigai()