裏 RjpWiki

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

算額(その103)

2023年01月20日 | Julia

算額(その103)

七〇 加須市大字外野 棘脱地蔵堂 明治6年(1873)
埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.

東京都中央区 福徳神社 令和2年(2020)
http://www.wasan.jp/tokyo/hukutoku.html

大円の中に斜線を隔てて甲円 2 個,乙円 2 個,丙円 1 個を入れる。乙円の直径が1のとき,丙円の直径はいかほどか。

大円の半径を R として,以下のように記号を定める。

⊿ABC と ⊿ADE が相似で,甲円の半径 DE = 1 なので,丙円の半径 BC は DE/2=0.5。∠BAC を θ とすれば,cosθ = √8/3, sinθ = sqrt(1-cosθ^2) により,B,D,F の座標を求めることができる。



include("julia-source.txt")

using SymPy

@syms R, r1, x2, y2, r2

R = 2r1
r3 = r1/2  # ⊿ABC と ⊿ADE が相似,DE = 1
AD = sqrt(Sym(8))  # sqrt(AE^2 - ED^2) = sqrt(3^2 - 1)
cosθ = sqrt(Sym(8))/3  # AD/3, θ = ∠BAC
sinθ = sqrt(1 - cosθ^2)
Dx = AD * sinθ
Dy = R - AD * cosθ;

次に,乙円の中心座標を (x2, y2),半径を r2 として以下の方程式を立て解く。

eq1 = x2^2 + (R - r1 - y2)^2 - (r1+ r2)^2 |> expand
eq2 = x2^2 + y2^2 - (R - r2)^2 |> expand
eq3 = dist2(0, R, Dx, Dy, x2, y2, r2)
res = solve([eq1, eq2, eq3], (r1, x2, y2))[4]  # 4 of 4

   (25*r2/16, 3*sqrt(2)*r2/2, r2/8)

甲円の半径 r1 は乙円の半径 r2 の 25/16 倍である。
さらに,丙円の半径は乙円の半径の 1/2 である。
よって,丙円の直径は 乙円の直径の 25/32 倍である。

乙円の直径が 1 寸のとき,丙円の直径は 0.78125 寸である。

その他のパラメータは以下の通りである。

   x2 = 1.06066;  y2 = 0.0625
   r2 = 0.5;  r3 = 0.390625
   Bx = 0.368285;  By = 0.520833;  Dx = 0.73657;  Dy = -0.520833

function draw(r2, more=false)
    pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   (r1, x2, y2) = (25*r2/16, 3*sqrt(2)*r2/2, r2/8)
   R = 2r1
   r3 = r1/2  # ⊿ABC と ⊿ADE が相似,DE = 1
   AD = √8r1  # sqrt(AE^2 - ED^2) = sqrt(3^2 - 1)
   cosθ = √8/3  # AD/3, θ = ∠BAC
   sinθ = sqrt(1 - cosθ^2)
   AB = √2r1  # sqrt((R - r3)^2 -r3^2)
   Bx = AB * sinθ
   By = R - AB * cosθ
   Dx = AD * sinθ
   Dy = R - AD * cosθ
   AF = 4AD / 3                                                                         
   Fx = AF * sinθ
   Fy = R - AF * cosθ
   @printf("x2 = %g;  y2 = %g\n", x2, y2)
   @printf("r2 = %g;  r3 = %g\n", r2, r3)
   @printf("Bx = %g;  By = %g;  Dx = %g;  Dy = %g\n", Bx, By, Dx, Dy)
   plot()
   circle(0, 0, R)
   circle22(0, r1, r1)
   circle(0, r3, r3, :magenta)
   circle2(x2, y2, r2, :blue)
   segment(0, R, Fx, Fy)
   segment(0, R, -Fx, Fy)
    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)
       segment(0, R, 0, -R)
       segment(0, -R, Fx, Fy)
       segment(0, r3, Bx, By)
       segment(0, -r1, Dx, Dy)
       point(0, 0, "0 ", :red, :right, delta=-delta/2)
       point(0, R, "A ", :red, :right, :bottom, delta=delta/2)
       point(0, r3, "C ", :magenta, :right, :bottom)
       point(Bx, By, " B", :magenta)
       point(Dx, Dy, " D", :red)
       point(Fx, Fy, " F", :red)
       point(0, -R, " G", :red)
       point(0, -r1, "E ", :red, :right, :bottom)
       point(x2, y2, "乙円:r2,(x2,y2)", :blue, :center, :bottom, delta=delta/2)
       point(0, r1, "甲円:r1\n(0,r1)", :red, :center, delta=-delta/2)
       point(0, r3, "丙円:r3\n(0,r3)", :magenta, :center, delta=-delta/2)
    end
end;


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

コメントを投稿

Julia」カテゴリの最新記事