裏 RjpWiki

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

算額(その513)

2023年11月26日 | Julia

算額(その513)

岩手県盛岡市 八幡宮 文化6年(1869)
一関市博物館>>和算に挑戦>>平成27年度出題問題>>平成27年度出題問題(2)[中級問題]&解答例
https://www.city.ichinoseki.iwate.jp/museum/wasan/h27/normal.html

大円内に 8 個の小円が入っている。大円の直径が 25 寸のとき,小円の直径を求めよ。

大円の直径と中心座標を R, (0, 0)
小円の直径と中心座標を r, (r, 2√3r), (0, √3r), (r, 0)
として,以下の連立方程式を解く。

include("julia-source.txt");

using SymPy
@syms R::positive, r::positive

eq = r^2 + (2sqrt(Sym(3))r)^2 - (R - r)^2
solve(eq, r)[1] |> println

   R*(-1 + sqrt(13))/12

小円の半径は大円の半径の (√13 - 1)/12 倍である。

   R = 12.5;  r = 2.71412;  小円の直径 = 5.42823

大円の直径が 25 寸のとき小円の直径は約 5.42823 寸である。

using Plots

function draw(more)
    pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   R = 25/2
   r = R*(√13 - 1)/12
   @printf("R = %g;  r = %g;  小円の直径 = %g\n", R, r, 2r)
   plot()
   circle(0, 0, R)
   circle4(r, 2√3r, r, :blue)
   circle(0, √3r, r, :blue)
   circle(0, -√3r, r, :blue)
   circle(r, 0, r, :blue)
   circle(-r, 0, r, :blue)
   if more == true
       delta = (fontheight = (ylims()[2]- ylims()[1]) / 500 * 10 * 2) /3  # size[2] * fontsize * 2
       hline!([0], color=:black, lw=0.5)
       vline!([0], color=:black, lw=0.5)
       point(r, 0, "r", :blue, :center, :bottom, delta=delta/2)
       point(0, √3r, " √3r", :blue, :left, :vcenter)
       point(r, 2√3r, " 小円:r\n (r,2√3r)", :blue, :center, :top, delta=-delta)
       point(R, 0, "R ", :red, :right, :bottom, delta=delta/2)
   else
       plot!(showaxis=false)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事