裏 RjpWiki

Julia ときどき R, Python によるコンピュータプログラム,コンピュータ・サイエンス,統計学

算額(その1038)

2024年06月07日 | Julia

算額(その1038)

七十九 藤沢町藤沢道場 藤勢寺 元治2年
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.

http://www.wasan.jp/yamamura/yamamura.html

外円の中に交差する正方形を2個入れ,区分された領域に小円を 3 個容れる。外円の直径が 10 寸のとき,正方形の一辺の長さはいかほどか。

外円の半径と中心座標を R, (0, 0)
小円の半径と中心座標を r, (0, 0), (R - r, 0)
正方形の一辺の長さを a
とおき,以下の連立方程式を解く。

include("julia-source.txt");

using SymPy
@syms R::positive, r::positive, a::positive
b = a/√Sym(2)
eq1 = dist2(0, R - 2b, b, R - b, R - r, 0, r)
eq2 = dist2(0, R - 2b, b, R - b, 0, 0, r)
res = solve([eq1, eq2], (a, r))[2]  # 2 of 3

   (-R/7 + 11*sqrt(2)*R/14, R*(-1/7 + 2*sqrt(2)/7))

正方形の一辺の長さは a = -R/7 + 11*sqrt(2)*R/14 = R(11√2 - 2)/14 である。
外円の半径が 5 寸(直径が 10)寸のとき,5(11√2 - 2)/14 = 4.841553280751445 寸である。

「答」は 4.114 寸であるが,それでは小さすぎる。図を描いてみればわかる。山村も算額の「術」をそのまま書き写しているので,答えが変である。

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   R = 10/2
   (a, r) = (-R/7 + 11*sqrt(2)*R/14, R*(-1/7 + 2*sqrt(2)/7))
   b = a/√2
   plot([0, b, 0, -b, 0], [R - 2b, R - b, R, R - b, R - 2b], color=:blue, lw=0.5)
   plot!([0, b, 0, -b, 0], -[R - 2b, R - b, R, R - b, R - 2b], color=:blue, lw=0.5)
   circle(0, 0, R, :green)
   circle2(R - r, 0, r)
   circle(0, 0, 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(b, R - b, "(a/√2,R-a/√2) ", :blue, :right, :vcenter)
       point(0, R - 2b, " (0,R-2a/√2)", :blue, :left, :vcenter)
       point(R - r, 0, "小円:r,(R-r,0)", :red, :center, delta=-delta/2)
       point(0, R, " R", :green, :left, :bottom, delta=delta/2)
       point(R, 0, " R", :green, :left, :bottom, delta=delta/2)
   end
end;


コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« 算額(その1037) | トップ | 算額(その47) »
最新の画像もっと見る

コメントを投稿

Julia」カテゴリの最新記事