以下の内容はhttps://sangaku0418.hatenablog.com/entry/2024/06/04/175843より取得しました。


算額(その1028)

27 岩手県一関市萩荘字八幡 八幡神社 弘化3年(1846)

安富有恒:和算—岩手の現存算額のすべて,青磁社,東京都,1987.
http://www.wasan.jp/iwatenosangaku_yasutomi.pdf
キーワード:円9個,斜線
#Julia #SymPy #算額 #和算 #数学


大円に中心を通る線を 4 本引き,等円を 8 個描く。等円の直径が与えられたとき,大円の直径を求めよ。

大円の半径と中心座標を \(R,\ (0,\ 0)\)
小円の半径と中心座標を \(r,\ ( (R - r)/\sqrt{2},\ (R - r)/\sqrt{2}),\ (R + r,\ 0)\)
斜線の端点座標を \( (x_0,\ y_0)\)
斜線の勾配を \(\theta\)°
とおき,以下の連立方程式を解く。

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

using SymPy
@syms R::positive, r::positive,
     θ::positive, x0::positive, y0::positive
@syms R, r, θ, x0, y0
x0 = R + 2r
θ = asind(y0/sqrt(x0^2 + y0^2))
eq1 = (R - r)*sind(Sym(45) - θ) - (R + r)*sind(θ)
eq2 = dist2(0, 0, x0, y0, (R - r)/√Sym(2), (R - r)/√Sym(2), r);

function H(u)
   (R, y0) = u
   return [
       -y0*(R + r)/sqrt(y0^2 + (R + 2*r)^2) + (R - r)*sin(pi*(-asin(y0/sqrt(y0^2 + (R + 2*r)^2))/pi + 1/4)),  # eq1
       R^4 + 2*R^3*r - 2*R^3*y0 - 5*R^2*r^2 + R^2*y0^2 - 12*R*r^3 + 6*R*r^2*y0 - 2*R*r*y0^2 - 4*r^4 - 4*r^3*y0 - r^2*y0^2,  # eq2
   ]
end;
r = 1/2
iniv = BigFloat[2, 1]
res = nls(H, ini=iniv)

   ([1.4872641552444894, 0.6466017927282794], true)

小円の直径が 1 のとき,大円の直径は 2*1.4872641552444894 = 2.974528310488979 である。

術は以下のとおり。

小円径 = 1
天 = sqrt(2) + 3
大円径 = 小円径 * (sqrt(sqrt(4天 + 2) + 天))

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

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r = 1/2
   (R, y0) = res[1]
   x0 = R + 2r
   θ = asind(y0/sqrt(x0^2 + y0^2))
   @printf("小円の直径が %.15g のとき,大円の直径 = %.15g\n", 2r, 2R)
   @printf("r = %.15g;  R = %.15g;  θ = %.15g;  x0 = %.15g;  y0 = %.15g\n", r, R, θ, x0, y0)
   plot()
   circle(0, 0, R, :blue)
   circle4( (R - r)/√2, (R - r)/√2, r, :magenta)
   circle42(0, (R + r), r, :magenta)
   segment(x0, y0, -x0, -y0)
   segment(-x0, y0, x0, -y0)
   segment(y0, x0, -y0, -x0)
   segment(-y0, x0, y0, -x0)
   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) ", :green, :right, :bottom, delta=delta/2)
       circle(0, 0, 0.4R, beginangle=0, endangle=θ)
       circle(0, 0, 0.42R, beginangle=0, endangle=θ)
       point(0.4R, 0, " θ", :red, :left, :bottom, delta=delta/2, mark=false)
       point(R, 0, " R", :blue, :left, :bottom, delta=delta/2)
       point(R + r, 0, "等円:r\n(R+r,0)", :magenta, :center, delta=-delta/2)
       point( (R - r)/√2, (R - r)/√2, "等円:r\n( (R-r)/√2,(R-r)/√2)", :magenta, :center, :bottom, delta=delta/2)
   end
end;


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




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

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