裏 RjpWiki

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

算額(その2032)

2024年08月20日 | Julia

算額(その2032)

(17) 兵庫県姫路市飾磨区英賀宮町 英賀神社 明治12年(1879)
近畿数学史学会:近畿の算額「数学の絵馬を訪ねて」,平成4年5月16日 初版第一刷,大阪教育図書株式会社,大阪市.
キーワード:円4個,外円,正方形2個

直径が 10 寸の大円の中に 4 個の小円を容れる。大円に内接する正方形の一辺の長さはいかほどか。

大円の半径と中心座標を R, (0, 0)
小円の半径と中心座標を r, (R - r, 0)
大円に内接する正方形の一辺の長さを a1
とおき,順次方程式を立てて解く。

1. 大円に内接する正方形の一辺の長さ a1

include("julia-source.txt");

using SymPy
@syms R::positive, a1::positive, a2::positive,
     r::positive
a1 = 2R/√Sym(2)
a1 |> println
a1(R => 10/2).evalf() |> println

   sqrt(2)*R
   7.07106781186548

直径 10 寸の大円に内接する正方形の一辺の長さは 7.07106781186548 寸である。
「答」では「七寸〇七厘七毛壱六七五」としているが近似値としても不適切。

2. 小円の直径 2r

r = (R - a1/2)/2
2r |> println
2r(R => 10/2).evalf() |> println

   -sqrt(2)*R/2 + R
   1.46446609406726

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

draw(10/2, true)

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

PVアクセスランキング にほんブログ村

PVアクセスランキング にほんブログ村