裏 RjpWiki

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

算額(その1076)

2024年06月18日 | Julia

算額(その1076)

九十九 江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.

http://www.wasan.jp/yamamura/yamamura.html
キーワード:円9個,円弧4個

交わる 4 個の円弧と甲円 4 個,乙円 5 個がある。乙円の直径が 1 寸のとき,甲円の直径はいかほどか。

円弧を構成する円の半径と中心座標を R, (r2 + R, 0)
甲円の半径と中心座標を r1, (0, r2 + r1)
乙円の半径と中心座標を r2, (0, 0), (x2, y2); y2 = x2
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy

@syms R::positive, r1::positive, r2::positive, x2::positive, y2::positive
y2 = x2
eq1 = (r2 + R - x2)^2 + y2^2 - (R - r2)^2 |> expand
eq2 = (r2 + R)^2 + (r2 + r1)^2 - (R + r1)^2 |> expand
eq3 = (r2 + R)/2 - x2 |> expand
res = solve([eq1, eq2, eq3], (r1, R, x2))[1]

   (sqrt(2)*r2, r2*(2*sqrt(2) + 3), r2*(sqrt(2) + 2))

甲円の半径 r1 は乙円の半径 r2 の √2 倍である。
乙円の直径が 1 寸のとき,甲円の直径は 1.4142135623730951 寸である。

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


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

コメントを投稿

Julia」カテゴリの最新記事