裏 RjpWiki

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

算額(その715)

2024年02月21日 | Julia

算額(その715)

八六 加須市多聞寺 愛宕神社 明治13年(1880)
埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.

埼玉の算額ほか
https://gunmawasan.web.fc2.com/files/saitama-sangaku-h24.html
愛宕神社の復元算額 明治13年(部分拡大図)(加須市)
https://gunmawasan.web.fc2.com/files/sangak-corner/atago-3s.jpg

キーワード:円6個,外円,楕円2個

外円内に長径が互いに直行する 2 つの楕円がある。中央に大円,その周りに 4 個の小円が入っている。
外円と大円の直径がそれぞれ 10 寸,3 寸のとき,小円の直径はいかほどか。

計算を簡単にするために図形を45度回転させたものを考える。
外円の半径と中心座標を R, (0, 0 )
大円の半径と中心座標を r1, (0, 0)
小円の半径と中心座標を r2, (r1 + r2, 0)
とおく。
楕円の長半径と短半径は a = R, b = r1 である。
楕円と小円の接点座標を (x0, y0)
とおき,以下の連立方程式を解く。

include("julia-source.txt");

using SymPy
@syms R::positive, a::positive, b::positive,
     r1::positive, r2::positive,
     x0::positive, y0::positive
(a, b) = (R, r1)
eq1 = (x0 - r1 - r2)^2 + y0^2 - r2^2
eq2 = -b^2*x0/(a^2*y0) - (r1 + r2 - x0)/y0
eq3 = x0^2/a^2 + y0^2/b^2 - 1
res = solve([eq1, eq2, eq3], (r2, x0, y0))

   1-element Vector{Tuple{Sym, Sym, Sym}}:
    (r1 - 2*r1^3/R^2, 2*r1, r1*sqrt(R^2 - 4*r1^2)/R)

小円の直径は 2(r1 - 2*r1^3/R^2) である。
外円,大円の半径がそれぞれ 10 寸,3 寸のとき,小円の直径は 2.46 寸である。

(R, r1) = (10, 3) ./ 2
2(r1 - 2*r1^3/R^2)  # r2

   2.46

2*r1, r1*sqrt(R^2 - 4*r1^2)/R  # x0, y0

   (3.0, 1.2)

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   (R, r1) = (10, 3) .// 2
   (a, b) = (R, r1)
   (r2, x0, y0) = (r1 - 2*r1^3/R^2, 2*r1, r1*sqrt(R^2 - 4*r1^2)/R)
   @printf("小円の直径 = %g;  r2 = %g;  x0 = %g;  y0 = %g\n", 2r2, r2, x0, y0)
   plot()
   circle(0, 0, R)
   circle(0, 0, r1)
   circle42(0, r1 + r2, r2, :green)
   ellipse(0, 0, R, r1, color=:blue)
   ellipse(0, 0, r1, R, color=:blue)
   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(x0, y0, "(x0,y0)", :blue, :left, :bottom, delta=delta/2)
       point(R, 0, " R", :red, :left, :bottom, delta=delta/2)
       point(0, r1, " r1", :red, :left, delta=-delta/2)
       point(0, 0, "大円:r1\n(0,0)", :red, :center, :vcenter)
       point(r1 + r2, 0, "小円:r2\n(r1+r2,0)", :green, :center, :vcenter)
   end
end;

 


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

コメントを投稿

Julia」カテゴリの最新記事