裏 RjpWiki

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

算額(その899)

2024年04月30日 | Julia

算額(その899)

七四 加須市大字外野 棘脱地蔵堂 明治7年(1874)

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

外円の中に正三角形と円を 2 個ずつ入れる。外円の直径が 3 寸のとき等円の直径はいかほどか。

外円の半径と中心座標を R, (0, 0)
等円の半径と中心座標を r, (R - r, 0)
とおき,以下の方程式を解く。

include("julia-source.txt");

using SymPy
@syms R::positive, r::positive
eq1 = (R - r)cosd(Sym(30)) - r
res = solve(eq1, r)[1] |> simplify
res |> println
2res(R => 3/2).evalf() |> N

   R*(-3 + 2*sqrt(3))

   1.3923048454132638

等円の半径は,外円の半径の (2√3 - 3) 倍である。
外円の直径が 3 寸のとき,等円の直径は 3(2√3 - 3) = 1.3923048454132632 寸である。

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   R = 3/2
   r = R*(2√3 - 3)
   @printf("外円の直径が %g のとき,等円の直径は %.15g である。\n", 2R, 2r)
   (x, y) = R .* (cosd(60), sind(60))
   plot([x, -x, x, -x, x], [y, y, -y, -y, y], color=:blue, lw=0.5)
   circle(0, 0, R, :green)
   circle2(R - r, 0, r)
   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(R - r, 0, "等円:r,(0,R-r)", :black, :left, delta=-delta)
       point(x, y, "(x,y)", :blue, :left, :bottom, delta=delta)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事