裏 RjpWiki

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

算額(その1156)

2024年07月18日 | Julia

算額(その1156)

九八 鴻巣市三ツ木山王 三木神社 明治28年(1895)
埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.
キーワード:円7個,外円,半円1個,

外円の中に,天円 2 個,地円 2 個,等円 2個半を入れる。天円の直径が 1 寸のとき,地円の直径はいかほどか。

外円の半径と中心座標を R, (0, 0)
天円の半径と中心座標を r1, (x1, 4r2 - R)
地円の半径と中心座標を r3, (x3, 2r2 - R)
等円の半径と中心座標を r2, (0, r2 - R), (0, 3r2 - R), (0, 5r2 - R)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy

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

   (39*r1/10, 2*r1, 3*r1/2, 4*r1/3, 2*sqrt(13)*r1/3)

地円の半径 r3 は,天円の半径 r1 の 4/3 倍である。
天円の直径が 1 寸のとき,地円の直径は 4/3 である。

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

  r1 = 0.5;  R = 1.95;  x1 = 1;  r2 = 0.75;  r3 = 0.666667;  x3 = 1.20185

function draw(r1, more=false)
    pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   (R, x1, r2, r3, x3) = r1 .* (39/10, 2, 3/2, 4/3, 2√13/3)
   @printf("天円の直径が %g のとき,地円の直径は %g である。\n", 2r1, 2r3)
   @printf("r1 = %g;  R = %g;  x1 = %g;  r2 = %g;  r3 = %g;  x3 = %g\n", r1, R, x1, r2, r3, x3)
   y = 5r2 - R
   plot()
   circle(0, 0, R)
   circle2(x1, 4r2 - R, r1, :blue)
   circle2(x3, 2r2 - R, r3, :green)
   circle(0, r2 - R, r2, :magenta)
   circle(0, 3r2 - R, r2, :magenta)
   circle(0, y, r2, :magenta, beginangle=180, endangle=360)
   x = sqrt(R^2 - y^2)
   segment(-x, y, x, y, :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(x1, 4r2 - R, "天円:r1\n(x1,4r2−R)", :blue, :center, delta=-delta/2)
       point(x3, 2r2 - R, "地円:r3,(x3,2r2-R)", :green, :center, delta=-delta/2)
       point(0, r2 - R, "等円,(0,r2-R)", :magenta, :center, delta=-delta/2)
       point(0, 3r2 - R, "等円,(0,3r2-R)", :magenta, :center, delta=-delta/2)
       point(0, 5r2 - R, "等円,(0,5r2-R)", :magenta, :center, delta=-delta/2)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事