算額(その374)
長野県埴科郡坂城町 諏訪社 文化2年(1805)
中村信弥「改訂増補長野県の算額」
http://www.wasan.jp/zoho/zoho.html
県内の算額1(78)
大小の半円が交わる中に,甲円,乙円を入れる。小円の径が 27 寸,乙円の径が 9寸のとき,甲円の径を求めよ。
算額(その373)に似ているが,この問題ではヒントとなる (0, 2r1)-(2r1, 0) の線分が描かれていないので,条件が足りないなあと思って先送りしていた。
追記: 2024/03/16
乙円の中心座標 (x4, y4) については特に条件を設定しなかったのであるが,暗黙の了解で(?)「乙円の中心は,大円と小円の中心を結ぶ線分上にある」とするようである。そのような条件にすると,中村が指摘した「二百五十分之七十の誤写」のとおりになる。
大円の半径と中心座標を r1, (r1, 0)
小円の半径と中心座標を r2, (0, r2); r2 = 27/2
甲円の半径と中心座標を r3, (x3, r3)
乙円の半径と中心座標を r4, (x4, y4); r4 = 9/2
大円と小円の交点座標を (x0, y0)
として,以下の連立方程式解く。
include("julia-source.txt");
using SymPy
@syms r1::positive, r2::positive, r3::positive, r4::positive,
x3::positive, x4::positive, y4::positibe, x0::positive, y0::positive;
eq1 = (x3 - r1)^2 + r3^2 - (r1 - r3)^2 # 甲円が大円に内接する
eq2 = (r1 - x4)^2 + y4^2 - (r1 - r4)^2 # 乙円が大円に内接する
eq3 = x4^2 + (r2 - y4)^2 - (r2 - r4)^2 # 乙円が小円に内接する
eq4 = x3^2 + (r2 - r3)^2 - (r2 + r3)^2 # 甲円が小円に外接する
eq5 = (2r2 - y0)*r1 - r2*x0 # (x0, y0) は大円と小円の交点
eq5 = y4/(r1 - x4) - r2/r1 # こちらの条件を使う
eq6 = (x0 - r1)^2 + y0^2 - r1^2;
eq7 = x0^2 + (y0 - r2)^2 - r2^2;
res = solve([eq1, eq2, eq3, eq4, eq5, eq6, eq7], (r1, r3, x3, x4, y4, x0, y0))
1-element Vector{NTuple{7, Sym{PyCall.PyObject}}}:
(2*r4*(r2 - r4)/(r2 - 2*r4), 4*r2*r4^2*(r2 - r4)^2/(-r2^2 + r2*r4 + r4^2)^2, 4*r2*r4*(r2 - r4)/(r2^2 - r2*r4 - r4^2), 2*r4*(r2 - r4)^2/(r2^2 - 2*r2*r4 + 2*r4^2), r2^2*r4/(r2^2 - 2*r2*r4 + 2*r4^2), 4*r2^2*r4*(r2 - 2*r4)*(r2 - r4)/(r2^2 - 2*r2*r4 + 2*r4^2)^2, 8*r2*r4^2*(r2 - r4)^2/(r2^2 - 2*r2*r4 + 2*r4^2)^2)
2res[1][2] |> println
2res[1][2](r2 => 27//2, r4 => 9//2) |> println
2res[1][2](r2 => 27//2, r4 => 9//2).evalf() |> println
8*r2*r4^2*(r2 - r4)^2/(-r2^2 + r2*r4 + r4^2)^2
432/25
17.2800000000000
小円の径が 27 寸,乙円の径が 9 寸のとき,甲円の径は 432/25 = 17.28 寸 = 17 寸 7/25 分である。
その他のパラメータは以下のとおりである。
r1 = 18; r3 = 8.64; x3 = 21.6; x4 = 7.2; y4 = 8.1; x0 = 12.96; y0 = 17.28
function draw(more)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
(r2, r4) = (27, 9) .// 2
(r1, r3, x3, x4, y4, x0, y0) = (
2*r4*(r2 - r4)/(r2 - 2*r4),
4*r2*r4^2*(r2 - r4)^2/(-r2^2 + r2*r4 + r4^2)^2,
4*r2*r4*(r2 - r4)/(r2^2 - r2*r4 - r4^2),
2*r4*(r2 - r4)^2/(r2^2 - 2*r2*r4 + 2*r4^2),
r2^2*r4/(r2^2 - 2*r2*r4 + 2*r4^2),
4*r2^2*r4*(r2 - 2*r4)*(r2 - r4)/(r2^2 - 2*r2*r4 + 2*r4^2)^2,
8*r2*r4^2*(r2 - r4)^2/(r2^2 - 2*r2*r4 + 2*r4^2)^2)
@printf("小円の径が 27 寸,乙円の径が 9 寸のとき,甲円の直径は %.10g 寸\n", 2r3)
@printf("r1 = %g; r3 = %g; x3 = %g; x4 = %g; y4 = %g; x0 = %g; y0 = %g\n", r1, r3, x3, x4, y4, x0, y0)
plot()
circle(r1, 0, r1, :black, beginangle=0, endangle=180)
circle(0, r2, r2, :blue, beginangle=270, endangle=450)
circle(x3, r3, r3)
circle(x4, y4, r4, :orange)
if more == true
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)
segment(0, 2r2, 2r1, 0, :gray)
segment(0, r2, r1, 0, :green)
point(r1, 0, "大円:r1 ", :black, :right, :bottom)
point(x3, r3, "甲円:r3\n(x3,r3)\n", :red, :center, :top, delta=-delta/2)
point(x4, y4, "乙円:r4=$r4\n(x4,y4)", :orange, :center, :bottom, delta=delta/2)
point(0, r2, " 小円\n r2=$r2", :blue, :left, :bottom)
point(x0, y0, "(x0,y0)\n", :black, :left, :bottom)
end
end;