裏 RjpWiki

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

算額(その1085)

2024年06月21日 | Julia

算額(その1085)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:円4個,半円1個,四分円2個,正方形

直線の上に大円,小円が載っており,大円の中には水平な元を挟んで,小円 2 個と中円 1 個が入っている。小円の直径が 1 寸のとき,中円の直径はいかほどか。

大円の半径と中心座標を r1, (r1, r1)
中円の半径と中心座標を r2, (x2, y2)
小円の半径と中心座標を r3, (0, r3), (x3, 2r1 - 3r3), (r1, 2r1 - r3)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

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

   (4*r4, 3*r4, 4*r4*(26 - sqrt(-52*sqrt(3)*sqrt(19 - 8*sqrt(3)) - 24*sqrt(3) + 733))/13, 4*r4*(2*sqrt(57 - 24*sqrt(3)) + 13)/13, 8*r4*(sqrt(3) + 9)/13)

r3, x3 は二重根号を外して簡約化できる。

res[3] |> sympy.sqrtdenest |> simplify |> println

   4*r4*(-3 + 4*sqrt(3))/13

res[4] |> sympy.sqrtdenest |> simplify |> println

   4*r4*(7 + 8*sqrt(3))/13

中円の半径 r3 は,小円の半径 r4 の 4(4√3 - 3)/13 倍である。
小円の直径が 1 寸のとき,中円の直径は 4(4√3 - 3)/13 = 1.2086779170078488 寸である。

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

   r4 = 0.5;  r1 = 2;  r2 = 1.5;  r3 = 0.604339;  x3 = 3.20868;  y3 = 3.30217

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r4 = 1/2
   (r1, r2, r3, x3, y3) = (4*r4, 3*r4, 4*r4*(26 - sqrt(-52*sqrt(3)*sqrt(19 - 8*sqrt(3)) - 24*sqrt(3) + 733))/13, 4*r4*(2*sqrt(57 - 24*sqrt(3)) + 13)/13, 8*r4*(sqrt(3) + 9)/13)
   @printf("小円の直径が %g のとき,中円の直径は %g である。\n", 2r4, 2r3)
   @printf("r4 = %g;  r1 = %g;  r2 = %g;  r3 = %g;  x3 = %g;  y3 = %g\n", r4, r1, r2, r3, x3, y3)
   plot(2r1 .* [0, 1, 1, 0, 0], 2r1 .* [0, 0, 1, 1, 0], color=:green, lw=0.5)
   circle(2r1, 0, 2r1, beginangle=90, endangle=180)
   circle(0, 0, 2r1, beginangle=0, endangle=90)
   circle(r1, 2r1, r1, beginangle=180, endangle=360)
   circle(r1, r2, r2, :blue)
   circle(x3, y3, r3, :magenta)
   circle(2r1 - x3, y3, r3, :magenta)
   circle(r1, 2r2 - r4, r4, :green)
   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(r1, r2, "大円:r2,(r1,r2)", :blue, :center, delta=-delta/2)
       point(x3, y3, "中円:r3,(x3,y3)", :magenta, :center, delta=-delta/2)
       point(r1, 2r2 - r4, "小円:r4\n(r1,2r2-r4)", :green, :center, delta=-delta/2)
       point(r1, 2r1, "(r1,2r1)", :green, :center, :bottom, delta=delta/2)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事