裏 RjpWiki

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

算額(その86)

2022年12月29日 | Julia

算額(その86)

福島県田村郡三春町平沢担橋 諏訪神社 大正15年(1926)8月
http://www.wasan.jp/fukusima/miharusuwa.html

中村信弥「改訂増補 長野県の算額」
http://www.wasan.jp/zoho/zoho.html
県内の算額
長野県松本市筑摩 筑摩神社 明治6年(1873)
と同じ(求めるものが違うだけ)

外円の中に「圭」と径が 3 寸の等円が 3 個入っている。外円の径を求めよ。

「圭」とは図のような細長い二等辺三角形のことである。

外接円の半径 R だけならば公式で簡単に求めることができる。等円の半径を r とすれば,内接する三角形の各辺の中点から外接円までの距離(「矢」という)を a', b', c' とすると,

a' + b' + c' = 2R - r … (1)
2a'b'c' = r^2R … (2)

a' = c' = 2r
b' = 2R - 5r

(2) に代入して
8 * r^2 * (2R - 5r) = r^2 * R
これより R が求まる。

using SymPy

@syms R::positive, x::positive, y::positive;
r = 3//2
eq0 = 8*r^2*(2R-5r) - (r^2)*R;

solve(eq0, R) |> println

   Sym[4]

R = 4 である。

次に,点 C の x 座標を求める。y 座標は 1/2 - R で,外接円の円周上にあるので以下を解く。

@syms x1
solve(x1^2 + (1//2-4)^2 - 16) |> println

   Sym[-sqrt(15)/2, sqrt(15)/2]

C は (sqrt(15)/2, 1/2-R), A は (-sqrt(15)/2, 1/2-R) である。

最後に,右の等円の中心座標を求める。外円に接することと,原点から (x, y) を結ぶ直線と BC が直交することから以下の 2 式を得る。

@syms x, y
R, r = 4, 3//2
eq1 = x^2 + y^2 - (R - r)^2;
eq2 = y/x * (4-1//2+R)/(sqrt(Sym(15))//2) - 1;

solve([eq1, eq2], (x, y))

   2-element Vector{Tuple{Sym, Sym}}:
    (-5*sqrt(15)/8, -5/8)
    (5*sqrt(15)/8, 5/8)

x 座標は 5*sqrt(15)/8, y 座標は 5/8 である。

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; fontsize=10, mark=true)
  mark && scatter!([x], [y], color=color, markerstrokewidth=0)
  annotate!(x, y, text(string, fontsize, vertical, position, color))
end;

function segment(x1, y1, x2, y2, color=:black; linestyle=:solid, linewidth=0.5)
plot!([x1, x2], [y1, y2], color=color, linestyle=linestyle, linewidth=linewidth)
end;

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r = 3/2
   (R, x) = (4, 2)
   plot()
   circle(0, 0, R)
   circle(5*sqrt(15)/8, 5/8, r, :blue)
   circle(-5*sqrt(15)/8, 5/8, r, :blue)
   circle(0, -R+1/2+r, r, :green)
   segment(0, R, -sqrt(15)/2, 1/2-R)
   segment(0, R, sqrt(15)/2, 1/2-R)
   segment(-sqrt(15)/2, 1/2-R, sqrt(15)/2, 1/2-R)
   if more
       hline!([0], color=:black, lw=0.5)
       vline!([0], color=:black, lw=0.5)
       point(sqrt(15)/2, 1/2-R, " C", :red)
       point(-sqrt(15)/2, 1/2-R, "A ", :red, :right)
       point(0, R, "  B", :red, :bottom)
       segment(0, -R, 0, 1/2-R, :magenta)
       point(0, 1/4-R, "  b'", :magenta, :top, :left, mark=false)
       point(5*sqrt(15)/8, 5/8, "(x, y)", :blue)
   end
end;

 

 


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

コメントを投稿

Julia」カテゴリの最新記事