goo blog サービス終了のお知らせ 

裏 RjpWiki

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

算額(その1054)

2024年06月13日 | Julia

算額(その1054)

八十九 陸前高田市小友町 常膳寺観音堂 天保13年(1842)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.

http://www.wasan.jp/yamamura/yamamura.html

全円の中に正三角形と等円 5 個を容れる。全円の直径が 1 寸のとき,等円の直径はいかほどか。

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

include("julia-source.txt");

using SymPy
@syms R::positive, r::positive
eq1 = r^2 + (r + R/2)^2 - (R - r)^2
res = solve(eq1, r)[1]
res |> println
2res(R => 1/2).evalf()|> println

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

等円の半径 r は,全円の半径 R の (2√3 - 3)/2 倍である。
全円の直径が 1 寸のとき,等円の直径は 0.2320508075688772 寸である。

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


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

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。

Julia」カテゴリの最新記事