算額(その1583)
福島県田村郡三春町御木沢 厳島神社
三春まちなか寺子屋:厳島神社新算額
https://miharukoma.com/wp-content/uploads/2018/11/12.22厳島神社-新算額.pdf
https://miharukoma.com/wp-content/uploads/2018/12/寺子屋12.22 問題解説.pdf
キーワード:円5個,半円2個,長方形
#Julia, #SymPy, #算額, #和算, #数学
長方形の中に,半円 2 個,甲円 1 個,乙円 2 個,丙円 2 個を容れる。半円の半径が 48 寸のとき,乙円,丙円の半径はいかほどか。
半円の半径と中心座標を R, (0, R/2)
甲円の半径と中心座標を r1, (0, 0)
丙円の半径と中心座標を r3, (R - r3, 0)
乙円の半径と中心座標を r2, (r2, 0)
とおき,以下の連立方程式を解く。
include("julia-source.txt")
# julia-source.txt ソース https://blog.goo.ne.jp/r-de-r/e/ad3a427b84bb416c4f5b73089ae813cf
using SymPy
@syms R, r1, r2, r3
eq1 = r2^2 + r1^2 - (R - r2)^2
eq2 = (R - r3)^2 + r1^2 - (R + r3)^2
eq3 = 2r1^2 - R^2
res = solve([eq1, eq2, eq3], (r1, r2, r3))[2] # 2 of 2
(sqrt(2)*R/2, R/4, R/8)
# r1
res[1] |> println
sqrt(2)*R/2
# r2
res[2] |> println
R/4
# r3
res[3] |> println
R/8
甲円,乙円,丙円の半径は,半円の直径の 1/√2, 1/4, 1/8 倍である。
半円の半径が 48 寸のとき,甲円,乙円,丙円の半径は 33.94112549695428 寸, 12 寸,6 寸である。
using Colors
function draw(R, more)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
(r1, r2, r3) = R .* (1/√2, 1/4, 1/8)
@printf("半円の半径が %g のとき,甲円,乙円,丙円の半径は %g, %g, %g である。\n", R, r1, r2, r3)
plot()
circlef(0, r1, R, parse(Colorant, "#FFF565"), beginangle=180, endangle=360)
circlef(0, -r1, R, parse(Colorant, "#FFF565"), beginangle=0, endangle=180)
circlef(0, 0, r1, parse(Colorant, "#FF8B3E"))
x = [R*cosd(z) for z in 45:0.01:135]
y = [R*sind(z) - r1 for z in 45:0.01:135]
append!(x, reverse(x))
append!(y, -reverse(y))
plot!(x, y, seriestype=:shape, color=parse(Colorant, "#FFFCC4"), fcolor=parse(Colorant, "#FFFCC4"), lw=0.5)
circle2f(R - r3, 0, r3, parse(Colorant, "#F02F22"))
circle2f(r2, 0, r2, parse(Colorant, "#757CF7"))
circle(0, r1, R, :black, beginangle=180, endangle=360)
circle(0, -r1, R, :black, beginangle=0, endangle=180)
circle(0, 0, r1, :black)
circle2(R - r3, 0, r3, :black)
circle2(r2, 0, r2, :black)
rect(-R, -r1, R, r1, :black)
if more
delta = (fontheight = (ylims()[2]- ylims()[1]) / 500 * 10 * 2) /3 # size[2] * fontsize * 2
hline!([0], color=:gray80, lw=0.5)
vline!([0], color=:gray80, lw=0.5)
point(0, r1, "半円:R,(0,R/2)", :black, :center, :bottom, delta=delta)
point(R - r3, 0, "丙円:r2,(R-r3,0)", :black, :right, delta=-2delta, deltax=4delta)
point(r2, 0, "乙円:r2,(r2,0)", :black, :center, :bottom, delta=delta)
ylims!(-r1 - 2delta, r1 + 2delta)
end
end;
draw(48, true)