裏 RjpWiki

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

算額(その27)

2022年11月18日 | Julia

算額(その27)

一〇八 北埼玉郡騎西町騎西 玉敷神社 大正4年(1915)
埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.

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

埼玉県加須市騎西 玉敷神社 大正4年(1915)
http://www.wasan.jp/saitama/tamasiki.html

埼玉県北本市本宿 天神社 明治24年
山口正義:やまぶき2,第41号

https://yamabukiwasan.sakura.ne.jp/ymbk41.pdf

キーワード:円7個,外円

図のように,円の中に交わる甲円が 3 個,乙円が 3 個ある。甲円の直径が 5 のとき乙円の直径はいくつか。

以下のように記号を定め,方程式を立てる。

甲円の半径を r1,乙円の半径と中心座標を r2, (x2, y2) とする。

using SymPy

@syms r1::positive, r2::positive, x2::positive, y2::positive;

x2, y2 は以下のようになる。

x2 = (2r1 - r2)*sqrt(Sym(3))/2
y2 = (2r1 - r2)/2

また,甲円と乙円が接することから

eq1 = x2^2 + (r1 - y2)^2 - (r1 + r2)^2
eq1 |> simplify |> println

   r1*(2*r1 - 5*r2)

eq1 を r2 について解く。

res = solve(eq1, r2)

   r2 = 2r1/5

甲円の直径が 5 ならば乙円の直径は 2 である。

using Plots

function circle(ox, oy, r, color=:red; beginangle=0, endangle=360)
   θ = beginangle:0.1:endangle
   x = r.*cosd.(θ)
   y = r.*sind.(θ)
   plot!(ox .+ x, oy .+ y, color=color, linewidth=0.5)
end;

function point(x, y, string="", color=:green, position=:left, vertical=:top; mark=true)
   mark && scatter!([x], [y], color=color, markerstrokewidth=0)
   annotate!(x, y, text(string, 10, position, color, vertical))
end;

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r1, r2 = 5, 2
   println("r1 = $r1;  r2 = $r2")
   x2, y2 = (sqrt(3)*(10 - r2)/2, 5 - r2/2)
   plot()
   circle(0, 0, 2r1)
   circle(0, r1, r1, :green)
   circle(r1*cos(pi/6), -r1*sin(pi/6), r1, :green)
   circle(-r1*cos(pi/6), -r1*sin(pi/6), r1, :green)
   circle(x2, y2, r2, :magenta)
   circle(-x2, y2, r2, :magenta)
   circle(0, r2 - 2r1, r2, :magenta)
   if more
       point(0, 0, " O", :red)
       point(0, r1, " r1 甲", :green)
       point(x2, y2, "(x2, y2) 乙", :magenta, :center)
       vline!([0], color=:black, linewidth=0.25)
       hline!([0], color=:black, linewidth=0.25)
   end
end;


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

コメントを投稿

Julia」カテゴリの最新記事