香川県三豊市豊中町 本山寺 万延元年
和算の館
http://www.wasan.jp/kagawa/honzanji1.html
キーワード:円7個,外円
#Julia #SymPy #算額 #和算 #数学
外円の中に 4 種類の円が収まっている。青,白の円の径はそれぞれ 69 寸,15 寸である。外円の径を求めよ。

下図のように記号を定め,方程式を解く。
include("julia-source.txt"); # julia-source.txt ソース
using SymPy
@syms r0::positive, r1::positive, r2::positive, r3::positive, r4::positive,
x3::positive, y3::positive, x4::positive, y4::positive;
r1 = 69
r4 = 15
eq1 = x3^2 + (2r0-r1-y3)^2 - (r1+r3)^2
eq2 = x3^2 + (r0-y3)^2 - (r0-r3)^2
eq3 = x4^2 + (r0-y4)^2 - (r0-r4)^2
eq4 = x3^2 + (y3-r2)^2 - (r2+r3)^2
eq5 = x4^2 + (r2-y4)^2 - (r2+r4)^2
eq6 = (x3-x4)^2 + (y3-y4)^2 - (r3+r4)^2
eq7 = r1 + r2 - r0;
res = solve([eq1, eq2, eq3, eq4, eq5, eq6, eq7], (r0, r2, r3, x3, y3, x4, y4));
name = ["r0", "r2", "r3", "x3", "y3", "x4", "y4"]
for i in 1:7
println("name[i], " = ", res[1][i])
end
r0 = 115
r2 = 46
r3 = 690/19
x3 = 1380/19
y3 = 1610/19
x4 = 60
y4 = 35
求める外円の径 \(r_0\) は 115 である。
描画関数プログラムのソースを見る
function draw(more=false)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
r1 = 69
r2 = 15
(r0, r2, r3, x3, y3, x4, y4) = (115, 46, 690/19, 1380/19, 1610/19, 60, 35)
plot()
circle(0, r2, r2, :red)
circle(0, 2r0-r1, r1, :blue)
circle(0, r0, r0, :black)
circle2(x3, y3, r3, :brown)
circle2(x4, y4, r4, :magenta)
if more
point(0, 2r0-r1, "2r0-r1 ", :blue, :right)
point(0, r0, "r0 ", :black, :right)
point(0, r2, "r2 ", :red, :right)
point(x3, y3, "(x3,y3),r3", :brown, :center)
point(x4, y4, "(x4,y4),r4", :magenta, :center)
vline!([0], color=:black, linewidth=0.25)
hline!([0], color=:black, linewidth=0.25)
end
end;
以下のアイコンをクリックして応援してください