裏 RjpWiki

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

算額(その949)

2024年05月12日 | Julia

算額(その949)

一〇八 加須市騎西町 玉敷神社 大正4年(1915)

埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.

外円の中に中円 1 個,小円 5 個が入っている。小円の直径が 1 寸のとき,外円の直径はいかほどか。

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

include("julia-source.txt");

@syms R::positive, r1::positive, r2::positive,
     x2::positive, y2::negative
r1 = 2r2
eq1 = x2^2 + y2^2 - (R - r2)^2
eq2 = x2^2 + (R - r1 - y2)^2 - (r1 + r2)^2
eq3 = x2^2 + (y2 - (R - 2r1 - r2))^2 - 4r2^2;
res = solve([eq1, eq2, eq3], (R, x2, y2))[1]

   (16*r2/5, 4*sqrt(2)*r2/3, -17*r2/15)

外円の半径は小円の半径の 16/5 倍である。
小円の直径が 1 寸のとき,外円の直径は 16/5 = 3.2 寸である。
その他のパラメータは以下のとおりである。
r1 = 1;  r2 = 0.5;  x2 = 0.942809;  y2 = -0.566667

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r2 = 1/2
   (R, x2, y2) = (16*r2/5, 4*sqrt(2)*r2/3, -17*r2/15)
   r1 = 2r2
   @printf("小円の直径が %g 寸のとき,外円の直径は %g 寸である。\n", 2r1, 2R)
   @printf("r1 = %g;  r2 = %g;  x2 = %g;  y2 = %g\n", r1, r2, x2, y2)
   plot()
   circle(0, 0, R)
   circle(0, R - r1, r1, :green)
   circle2(r2, R - r1, r2, :blue)
   circle2(x2, y2, r2, :blue)
   circle(0, R - 2r1 - r2, r2, :blue)
   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(0, R - r1, "中円:r1,(0,R-r1) ", :green, :right, :vcenter)
       point(x2, y2, "小円:r2,(x2,y2)", :blue, :center, delta=-delta/2)
       point(0, R - 2r1 - r2, "小円:r2\n(0,R-2r1-r2)", :blue, :center, delta=-delta/2)
       point(r2, R - r1, "小円:r2,(r2,R-r1)", :blue, :center, :bottom, delta=delta)
       point(0, R, " R", :red, :left, :bottom, delta=delta/2)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事