裏 RjpWiki

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

算額(その1024)

2024年06月03日 | Julia

算額(その1024)

十五 前沢町赤生津坊主山 前沢月山神社坊主山 明治43年(1910)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.

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

大円に内接する正方形を描き,正方形内に対角を中心とする四分円を 2 個描く。四分円が交差してできる領域に小円を描く。大円の直径が 12 寸のとき,小円の直径はいかほどか。

大円の半径と中心座標を R, (0, 0)
右下の四分円の半径と中心座標は √2R, (R/√2, -R/√2)
小円と四分円の接点座標を (r/√2, -r/√2)
とおき,以下の方程式を解く。

include("julia-source.txt");

using SymPy
@syms R::positive, r::positive
eq1 = (√Sym(2)R - r)^2 - 2(R/√Sym(2))^2
res = solve(eq1, r)[1]  # 1 of 2
res |> println

   R*(-1 + sqrt(2))

小円の直径は,大円の直径の (√2 - 1) 倍である。

大円の直径が 12 寸のとき,小円の直径は 12(√2 - 1) = 4.970562748477142 寸である。

山村の例解は間違えており,「術」も理解不能である。

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   R = 12/2
   r = (√2 - 1)R
   @printf("大円の直径が %g のとき,小円の直径は %gである。", 2R, 2r)
   a = R/√2
   plot([a, a, -a, -a, a], [-a, a, a, -a, -a], color=:green, lw=0.5)
   circle(0, 0, R)
   circle(a, -a, √2R, :blue, beginangle=90, endangle=180)
   circle(-a, a, √2R, :blue, beginangle=270, endangle=360)
   circle(0, 0, r, :green)
   segment(0, 0, a, -a, :gray70)
   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/√2, -R/√2, "  (R/√2,-R/√2)", :black, :left, :bottom, delta=delta/2)
       point(r/√2, -r/√2, "  (r/√2,-r/√2)", :black, :left, :bottom, delta=delta/2)
       point(r, 0, " r", :green, :left, :bottom, delta=delta/2)
       point(R, 0, " R", :red, :left, :bottom, delta=delta/2)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事