以下の内容はhttps://sangaku0418.hatenablog.com/entry/2024/05/07/215419より取得しました。


算額(その0928)

三十五 群馬県安中市鷺宮 咲前神社 明治20年(1887)

群馬県和算研究会:群馬の算額,上武印刷株式会社,高崎市,1987年3月31日.

「算額」第三集 全国調査,香川県算額研究会.(香川県立図書館蔵)

キーワード:円12個,菱形
#Julia #SymPy #算額 #和算 #数学


菱形の中に等円が 12 個入っている。菱形の短い方の対角線が 5.4 寸,菱形の一辺の長さが 4.5 寸のとき,等円の直径はいかほどか。

菱形の長いほうの対角線の長さを \(2a\),短い方の対角線の長さを \(2b\) とする。
菱形の一辺の長さを \(c\) とすると,\(a = \sqrt{c^2 - b^2}\) である。
等円の半径と中心座標を \(r,\ (x,\ r),\ (r,\ y),\ ( (r + x)/2,\ (r + y)/2)\)
と置き,以下の連立方程式を解く。

include("julia-source.txt");  # julia-source.txt ソース

using SymPy
@syms a::positive, b::positive, c::positive,
     r::positive, x::positive, y::positive
a = sqrt(c^2 - b^2) 
eq1 = dist2(a, 0, 0, b, r, y, r)
eq2 = dist2(a, 0, 0, b, x, r, r)
eq3 = (x - r)^2/4 + (y - r)^2/4 - 4r^2 |> expand |> simplify;

eq1, eq2 から \(y,\ x\) を求める。

ans_y = solve(eq1, y)[1]
ans_y |> println
ans_x = solve(eq2, x)[1]
ans_x |> println

   (b^2 - b*c + r*sqrt(-b^2 + c^2))/(b - c)
   (-c*r + (b - r)*sqrt(-b^2 + c^2))/b

\(y,\ x\) を eq3 に代入する。

eq13 = eq3(x => ans_x, y => ans_y) |> expand |> simplify |> numerator
eq13 |> println

   b^3*c^2 - 16*b^3*r^2 - b^2*c^3 - 2*b^2*c^2*r + 16*b^2*c*r^2 + 2*b*c^3*r + 2*b*c^2*r*sqrt(-b^2 + c^2) - 2*c^3*r^2 - 2*c^2*r^2*sqrt(-b^2 + c^2)

\(r\) について解く。

ans_r = solve(eq13, r)[2]  # 2 of 2
ans_r |> println

   b*c*(4*b*(b - c) + c*(-b + c + sqrt(-b^2 + c^2)))/(2*(8*b^3 - 8*b^2*c + c^3 + c^2*sqrt(-b^2 + c^2)))

\(ans_r\) は \(b,\ c\) のみを含むので,それぞれの値を代入すれば,その条件における等円の直径が求まる。

ans_r(b => 2.7, c=> 4.5) |> println

   0.500000000000001

\(ans_x,\ ans_y\) は \(b,\ c\) の他に \(r\) を含む式であるが,上で得られた \(ans_r\) を代入すればよい。

ans_x(b => 2.7, c=> 4.5, r => 0.5) |> println
ans_y(b => 2.7, c=> 4.5, r => 0.5) |> println

   2.10000000000000
   1.70000000000000

描画関数プログラムのソースを見る

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   (b, c) = (5.4/2, 4.5)
   a = sqrt(c^2 - b^2)
   t = b - c
   r = b*c*(4b*t + c*(a - t))/(2(8b^3 - 8b^2*c + c^3 + c^2*a))
   y = (b^2 - b*c + r*a)/t
   x = (sqrt(-t*(b + c))*(b - r) - c*r)/b
   @printf("a = %g;  b = %g;  c = %g\n", a, b, c)
   @printf("r = %g;  x = %g;  y = %g\n", r, x, y)
   @printf("等円の直径は %g 寸である。\n", 2r)
   plot([a, 0, -a, 0, a], [0, b, 0, -b, 0], color=:green, lw=0.5)
   circle4(r, y, r)
   circle4( (r + x)/2, (r + y)/2, r)
   circle4(x, r, r)
   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, y, "(r,y)", :red, :right, delta=-delta, deltax=4delta)
       point( (r + x)/2, (r + y)/2, "( (r+x)/2,(r+y)/2)", :red, :right, delta=-delta, deltax=6delta)
       point(x, r, "(x,r)", :red, :right, delta=-delta, deltax=4delta)
       point(0, b, " b", :green, :left, :bottom, delta=delta/2)
       point(a, 0, " a", :green, :left, :bottom, delta=delta/2)
   end
end;


以下のアイコンをクリックして応援してください




以上の内容はhttps://sangaku0418.hatenablog.com/entry/2024/05/07/215419より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14