算額(その878)
六十三 羽生市須影 八幡神社 慶応元年(1865)
埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.
正方形内に半円 2 個,等円 2 個を入れる。等円の直径が 1 寸のとき,正方形の一辺の長さはいかほどか。
正方形の一辺の長さを 2r1
半円の半径と中心座標を r1, (r1, 0)
等円の半径と中心座標を r2, (r2, y2), (2r1 - y2, 2r1 - r2)
とおき,以下の連立方程式を解く。
include("julia-source.txt");
using SymPy
@syms r1::positive, r2::positive, y2::positive
eq1 = (r1 - r2)^2 + y2^2 - (r1 + r2)^2
eq2 = (2r1 - y2 - r2)^2 + (2r1 - r2 - y2)^2 - 4r2^2;
res = solve([eq1, eq2], (r1, y2))
3-element Vector{Tuple{Sym{PyCall.PyObject}, Sym{PyCall.PyObject}}}:
(r2/2, sqrt(2)*r2)
(r2*(2 - sqrt(2))^2/4, r2*(2 - sqrt(2)))
(r2*(sqrt(2) + 2)^2/4, r2*(sqrt(2) + 2))
3 組の解が得られるが,3 番目のものが適解である。
res[3][1]/r2 |> expand |> println
sqrt(2) + 3/2
半円の半径は等円の半径の (√2 + 3/2) 倍である。
等円の直径が 1 寸のとき,半円の直径は 2.914213562373095 寸で,それは正方形の一辺の長さでもある。
function draw(more=false)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
r2 = 1/2
(r1, y2) = (r2*(sqrt(2) + 2)^2/4, r2*(sqrt(2) + 2))
@printf("等円の直径 = %g; 正方形の一辺の長さ = %g\n", 2r2, 2r1)
plot([0, 2r1, 2r1, 0, 0], [0, 0, 2r1, 2r1, 0], color=:green, lw=0.5)
circle(r1, 0, r1, beginangle=0, endangle=180)
circle(2r1, r1, r1, beginangle=90, endangle=270)
circle(r2, y2, r2, :blue)
circle(2r1 - y2, 2r1 - r2, r2, :blue)
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(r1, 0, "r1", :red, :center, :bottom, delta=delta/2)
point(2r1, 0, " 2r1", :red, :left, :bottom, delta=delta/2)
point(0, 2r1, " 2r1", :red, :left, :bottom, delta=delta/2)
point(2r1, r1, "", :red)
point(r2, y2, "等円:r2,(r2,y2)", :blue, :center, delta=-delta/2)
point(2r1 - y2, 2r1 - r2, "等円:r2\n(2r1-y2,2r1-r2)", :blue, :center, delta=-delta/2)
end
end;
※コメント投稿者のブログIDはブログ作成者のみに通知されます