裏 RjpWiki

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

算額(その1208)

2024年08月11日 | Julia

算額(その1208)

(23) 兵庫県姫路市広畑区西蒲田 天満神社 明治21年(1888)
近畿数学史学会:近畿の算額「数学の絵馬を訪ねて」,平成4年5月16日 初版第一刷,大阪教育図書株式会社,大阪市.
キーワード:円4個,外円

外円の中に等円 3 個を容れる。外円の直径が 13 寸のとき,等円の直径および(図に示す)矢の長さはいかほどか。

外円の半径と中心座標を R, (0, 0)
等円の半径と中心座標を r, (0, R - r), (r, y)
とおき,以下の連立方程式を解く。

include("julia-source.txt");

using SymPy

@syms R::positive, r::positive, y::negative;
eq1 = r^2 + (R - r - y)^2 - 4r^2
eq2 = r^2 + y^2 - (R - r)^2
res = solve([eq1, eq2], (r, y))[1]

   (-(-R + R*(-2 + sqrt(3)))*(R*(-2 + sqrt(3)) + R)/(2*R), R*(-2 + sqrt(3)))

等円の半径の式は簡約化でき,R*(2√3 - 3) となる。

r = res[1] |> simplify
r |> println

   R*(-3 + 2*sqrt(3))

等円の半径 r は,外円の半径 R の 2√3 - 3 倍である。
外円の直径が 13 寸のとき,等円の直径は 13*(2√3 - 3) = 6.033320996790807 寸である。

等円径を得る「術」は,「外円径/(1.1547 + 1)」である。分母をなぜ 2.1547 としなかったかというのは,分母は 2√3/3 + 1 で,2√3/3 = 1.1547005383792515 を 1.1547 に丸めたことを残したかったためであろう。それにしても,小数の割り算より掛け算の方が計算しやすくはないだろうか。

外円径 = 13
等円径 = 外円径/(1.1547 + 1)

   6.033322504292941

矢は (y + r) - (R - 2r) = R*(7√3 - 12) である。
外円の直径が 13 寸のとき,0.808311744383917 寸である。

y = res[2]
矢 = ((y + r) - (R - 2r)) |> simplify
矢 |> println
矢(R => 13/2).evalf() |> println

   R*(-12 + 7*sqrt(3))
   0.808311744383917

矢を求める「術」は,「等円径 - √3*等円径/2」である。等円径の計算精度が確保できれば完全に正しい式である。

function draw(R, more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   (r, y) = (-(-R + R*(-2 + sqrt(3)))*(R*(-2 + sqrt(3)) + R)/(2*R), R*(-2 + sqrt(3)))
   println((y + r) - (R - 2r))
   plot()
   circle(0, 0, R, :blue)
   circle(0, R - r, r)
   circle(r, y, r)
   circle(-r, y, 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, R, "R", :blue, :center, :bottom, delta=delta/2)
       point(0, R - r, "等円:r,(0,R-r)", :red, :center, delta=-delta/2)
       point(r, y, "等円:r,(r,y)", :red, :center, delta=-delta/2)
       segment(-1.5r, y + r, 1.5r, y + r, :green)
       dimension_line(0, y+ r, 0, R - 2r, " 矢", :black, :left, lw=1)
   end
end;

draw(13/2, true)


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

コメントを投稿

Julia」カテゴリの最新記事