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


算額(その1003)

十八 大里郡岡部村岡 稲荷社 文化14年(1817)

埼玉県立図書館:埼玉県史料集 第二集『埼玉の算額』,昭和44年,誠美堂印刷所,埼玉県与野市.
キーワード:楕円,六角形
#Julia #SymPy #算額 #和算 #数学


楕円の中に各辺が同じ長さの六角形を容れる。長径と短径が 14 寸,7 寸のとき,各辺の長さはいかほどか。

楕円の長半径,短半径,中心座標を \(a,\ b,\ (0,\ 0)\)
六角形の頂点の一つの座標を \( (x,\ y)\)
とおき,以下の連立方程式を解く。

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

using SymPy

@syms a::poitive, b::poitive,
     x::poitive, y::poitive
eq1 = x^2/a^2 + y^2/b^2 - 1  # (x, y) が楕円の周上にある
eq2 = sqrt(x^2 + (b - y)^2) - 2y  # 2辺が同じ長さである
res = solve([eq1, eq2], (x, y))[2]

   (2*a*sqrt(b^4*(a^2 + 2*b^2)/(a^2 + 3*b^2)^2)/b, b*(a^2 + b^2)/(a^2 + 3*b^2))

\(x\) 座標は \(\displaystyle \frac{2 a \sqrt{\displaystyle \frac{b^{4} \left( a^{2} + 2 b^{2} \right)}{\left( a^{2} + 3 b^{2} \right)^{2}}}}{b}\)

\(y\) 座標は \(\displaystyle \frac{b \left( a^{2} + b^{2} \right)}{a^{2} + 3 b^{2}}\)

長半径,短半径,がそれぞれ \(14/2,\ 7/2\) のとき,\(x = 4.898979485566356,\ y = 2.5\)

また,六角形の一辺の長さは \(5\) である。

(a, b) = (14/2, 7/2)
x = 2*a*sqrt(b^4*(a^2 + 2*b^2)/(a^2 + 3*b^2)^2)/b
y = b*(a^2 + b^2)/(a^2 + 3*b^2)
(x, y) |> println
2y |> println

   (4.898979485566356, 2.5)
   5.0

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

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   (a, b) = (14, 7) ./ 2
   x = 2*a*sqrt(b^4*(a^2 + 2*b^2)/(a^2 + 3*b^2)^2)/b
   y = b*(a^2 + b^2)/(a^2 + 3*b^2)
   @printf("(x, y) = (%g, %g)\n", x, y)
   @printf("sqrt(x^2 + (b - y)^2) = %.15g\n2y = %.15g\n", sqrt(x^2 + (b - y)^2), 2y)
   plot([0, -x, -x, 0, x, x, 0], [b, y, -y, -b, -y, y, b], color=:blue, lw=0.5)
   ellipse(0, 0, a, b, color=:red)
   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(a, 0, " a", :red, :left, :bottom, delta=delta)
       point(0, b, " b", :red, :left, :bottom, delta=delta)
       point(x, y, " (x,y)", :blue, :left, :bottom, delta=delta)
   end
end;


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




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

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