福島県田村郡三春町平沢担橋 諏訪神社 大正15年(1926)
和算の館
http://www.wasan.jp/fukusima/miharusuwa.html
キーワード:円3個,斜線,直線上
#Julia #SymPy #算額 #和算 #数学
2 本の線分に挟まれて,3 個の円がある。大円,中円の径を 4,2 としたとき,小円の径を求めよ。

大円,中円の半径を 2, 1 として,図のよう記号を定め方程式を解く。

include("julia-source.txt"); # julia-source.txt ソース
using SymPy
@syms x1::positive, r1::positive, x2::positive, x3::positive;
eq1 = (x2 - x1)^2 + (1 - r1)^2 - (1 + r1)^2
eq2 = (x3 - x2)^2 + (2 - 1)^2 - (2 + 1)^2
eq3 = (2 - r1)/(x3 - x1) - (1 - r1)/(x2 - x1)
eq4 = r1/x1 - 1/x2
solve([eq1, eq2, eq3, eq4], (r1, x1, x2, x3))[1]
(1/2, sqrt(2), 2*sqrt(2), 4*sqrt(2))
小円の径は 1 である。
描画関数プログラムのソースを見る
function draw(more=false)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
(r1, x1, x2, x3) = (1/2, sqrt(2), 2*sqrt(2), 4*sqrt(2))
plot()
circle(x1, r1, r1)
circle(x2, 1, 1, :blue)
circle(x3, 2, 2, :green)
hline!([0], color=:black, lw=0.5)
θ = atan(2, x3)
y = 6tan(2θ)
plot!([0, 6], [0, y], color=:black, lw=0.5)
if more
point(x1, r1, "(x1,r1)", :red, :top, :center)
point(x2, 1, "(x2,2)", :blue, :top, :center)
point(x3, 2, "(x3,4)", :green, :top, :center)
point(6, y, "(6, y)", :black)
end
end;
以下のアイコンをクリックして応援してください