裏 RjpWiki

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

算額(その1061)

2024年06月14日 | Julia

算額(その1061)

九十五 大船渡市猪川町長谷堂 気仙長谷寺 文政5年(1822)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.

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

全円の中に,交差する甲円 2 個,乙円 2 個,丙円 5 個を容れる。丙円の直径が 1 寸のとき,全円の直径はいかほどか。

全円の半径と中心座標を R, (0, 0)
甲円の半径と中心座標を r1, (0, R - r1)
乙円の半径と中心座標を r2, (R - r2, 0)
丙円の半径と中心座標を r3, (x3, y3), (0, 0)
とおき,以下の連立方程式を解く。

include("julia-source.txt");

using SymPy
@syms R::positive, r1::positive, r2::positive,
     r3::positive, x3::positive, y3::positive
eq1 = 2r1 - r3 - R
eq2 = x3^2 + y3^2 - (R - r3)^2
eq3 = (R - r2)^2 + (R - r1)^2 - (r1 +r2)^2
eq4 = x3^2 + (R - r1 - y3)^2 - (r1 + r3)^2
eq5 = (R - r2 - x3)^2 + y3^2 - (r2 + r3)^2
res = solve([eq1, eq2, eq3, eq4, eq5], (R, r1, r2, x3, y3))[1]

   (r3*(3 + 2*sqrt(3)), r3*(sqrt(3) + 2), sqrt(3)*r3, r3*(sqrt(3) + 3), r3*(1 + sqrt(3)))

全円の半径 R は,丙円の半径 r3 の (3 + 2√3) 倍である。
丙円の直径が 1 寸のとき,全円の直径は 6.464101615137754 寸である。

その他のパラメータは以下のとおりである。

   r3 = 0.5;  R = 3.23205;  r1 = 1.86603;  r2 = 0.866025;  x3 = 2.36603;  y = 1.36603

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r3 = 1/2
   (R, r1, r2, x3, y3) = r3 .* (3 + 2√3, √3 + 2, √3, √3 + 3, 1 + √3)
   @printf("丙円の直径が %g のとき,全円の直径は %g である。\n", 2r3, 2R)
   @printf("その他のパラメータは以下のとおりである。\nr3 = %g;  R = %g;  r1 = %g;  r2 = %g;  x3 = %g;  y = %g\n", r3, R, r1, r2, x3, y3)
   plot()
   circle(0, 0, R, :green)
   circle22(0, R - r1, r1)
   circle2(R - r2, 0, r2, :blue)
   circle(0, 0, r3, :magenta)
   circle4(x3, y3, r3, :magenta)
   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(R, 0, " R", :blue, :left, :bottom, delta=delta/2)
       point(0, R, " R", :blue, :left, :vcenter)
       point(0, R - r1, "甲円:r1,(0,R-r1)", :red, :center, delta=-delta/2)
       point(R - r2, 0, "乙円:r2,(R-r2,0)", :blue, :center, delta=-delta/2)
       point(x3, y3, "丙円:r3\n(x3,y3)", :magenta, :center, delta=-delta/2)
       point(0, 0, "丙円:r3\n(0,0)", :magenta, :center, delta=-delta/2)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事