以下の内容はhttps://sangaku0418.hatenablog.com/entry/2024/02/25/212350より取得しました。


算額(その0729)

富岡村天王社 明治26年(1893)

街角の数学 Street Wasan 街角の数学 ~落書き帳「○△□」~ 539. 関根熊吉の算額
http://streetwasan.web.fc2.com/math19.1.22.html
キーワード:円1個,直角三角形,中鈎
#Julia #SymPy #算額 #和算 #数学


直角三角形内に,内接円と直角の頂点から斜辺(弦)への垂線(中鈎)を容れる。
直角三角形の 3 辺の長さの積が 60 寸(立方寸であるが細かいことは言わない),内接円の直径が 2 寸のとき,短弦(弦と中鈎の交点で区切られる弦の短い方)の長さはいかほどか。

直角を挟む短い方の辺と長い方の辺を,「鈎」,「股」,斜辺を「弦」,中鈎,短弦を「中鈎」,「短弦」という変数にする。
内接円の半径と中心座標を \(r, (股-r, r)\)
として以下の連立方程式を解く。

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

using SymPy
@syms 鈎::positive, 股::positive, 弦::positive, 中鈎::positive, 短弦::positive

r = 2//2
弦 = sqrt(鈎^2 + 股^2)
eq1 = 鈎*股*弦 - 60
eq2 = 鈎 + 股 - 弦 - 2r  # 有名な公式
eq3 = 弦*中鈎 - 股*鈎
eq4 = 短弦/中鈎 - 鈎/股
res = solve([eq1, eq2, eq3, eq4], (鈎, 股, 中鈎, 短弦))

   2-element Vector{NTuple{4, Sym{PyCall.PyObject}}}:
    (3, 4, 12/5, 9/5)
    (4, 3, 12/5, 16/5)

一般に,鈎 < 股 なので,最初のものが適解である。すなわち,短弦は 9/5 寸,すなわち 1 寸 8 分である。

図を描く必要がなければこれで十分である。

図を描くためには中鈎と弦の交点座標があればよい。

交点の座標を \( (x, y)\) とする(\(y\) 座標は \(x\cdot 鈎/股\) であるが,連立させて求める)。

2 条件を追加して連立方程式を解く。

@syms x::positive, y::positive
eq5 = (鈎 - y)/(股 - x) - 鈎/股
eq6 = sqrt(x^2 + y^2) + 短弦 - 弦
res = solve([eq1, eq2, eq3, eq4, eq6, eq5], (鈎, 股, 中鈎, 短弦, x, y))[2]  # 2 of 2

    (3, 4, 12/5, 9/5, 64/25, 48/25)

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

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r = 2//2
   (鈎, 股, 中鈎, 短弦, x, y) = (3, 4, 12/5, 9/5, 64/25, 48/25)
   plot([0, 股, 股, 0], [0, 0, 鈎, 0], color=:green, lw=0.5)
   circle(股 - r, r, r, :blue)
   segment(股, 0, x, y, :red)
   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, " 股", :green, :left, :bottom, delta=delta/2)
       point(股, 鈎, "(股,鈎) ", :green, :right, :vcenter)
       point(x, y, "(x,y) ", :green, :right, :vcenter)
       point(股 - r, r, "r,(股-r,r) ", :blue, :center, delta=-delta/2)
   end
end;


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




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

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