以下の内容はhttps://sangaku0418.hatenablog.com/entry/2025/01/31/170214より取得しました。


算額(その1573)

岡山県瀬戸内市長船町土師宮森 片山日子神社 明治6年(1873)

http://www.wasan.jp/okayama/katayamahiko.html

深川英俊,トニー・ロスマン:聖なる数学:算額,p. 96,森北出版株式会社,2010年4月22日.
キーワード:円1個,二等辺三角形
#Julia #SymPy #算額 #和算 #数学


二等辺三角形に円を容れる。底辺と斜辺が与えられたとき,円の直径はいかほどか。

底辺と斜辺を \(a, b\)
円の半径と中心座標を \(r, (0, r)\)
とおき,以下の連立方程式を解く。

include("julia-source.txt");  # julia-source.txt ソース

using SymPy
@syms a, b, r, h
h = sqrt(b^2 - (a/2)^2)
eq1 = ( (a + 2b)*r/2) - (h*a/2)
res = solve(eq1, r)[1]
res |> println

    a*sqrt(-a^2 + 4*b^2)/(2*(a + 2*b))

円の半径は \(a\sqrt{4b^2 - a^2}/(2a + 4b)\) である。
底辺が 12,斜辺が 10 のとき,内接円の直径は 6 である。

2*res(a => 12, b => 10) |> println

    6

以下のほうが簡単。

@syms a, b, r, h
h = sqrt(b^2 - (a/2)^2)
eq2 = (a/2)/b - r/(h - r)
res2 = solve(eq2, r)[1]
res2 |> println

    a*sqrt(-a^2 + 4*b^2)/(2*(a + 2*b))

描画関数プログラムのソースを見る

function draw(a, b, more)
    pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
    r = a*sqrt(4b^2 - a^2)/(2a + 4b)
    @printf("a = %g;  b = %g;  r = %g\n", a, b, r)
    plot([a/2, 0, -a/2, a/2], [0, sqrt(b^2 - (a/2)^2), 0, 0], color=:blue, lw=0.5)
    circle(0, r, r)
    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, sqrt(b^2 - a^2/4), "sqrt(b^2-a^2/4)", :blue, :center, :bottom, delta=delta/2)
        point(a/2, 0, "a/2", :blue, :left, :bottom, delta=delta/2)
        point(0, r, " r", :red, :left, :vcenter)
    end  
end;

draw(12, 10, true)


以下のアイコンをクリックして応援してください




以上の内容はhttps://sangaku0418.hatenablog.com/entry/2025/01/31/170214より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14