千葉県富津市寺尾 六所神社 明治4年(1871)
山口正義:やまぶき4,第57号
https://yamabukiwasan.sakura.ne.jp/ymbk57.pdf
山口正義:やまぶき4,第59号
https://yamabukiwasan.sakura.ne.jp/ymbk59.pdf
キーワード:楕円,正五角形,矢
#Julia #SymPy #算額 #和算 #数学
正五角形の内部に 5 本の矢を容れ,大きさの同じ二等辺三角形と小さな正五角形に区分する。二等辺三角形に内接する楕円の短径が 1 寸のとき,長径はいかほどか。

二等辺三角形と楕円の関係は以下の図のようになる。
以下では \(x\) 軸に平行な軸を長径 \(2a\),\(y\) 軸に平行な軸を短径 \(2b\) とする(実際は \(a < b\) であるが,慣例に従ってこのようにする)。
斜辺の長さを \(l\)
楕円と斜辺の交点座標を \( (x_0,\ y_0)\)
として以下の連立方程式を解く。
include("julia-source.txt"); # julia-source.txt ソース
using SymPy
@syms l, x, a, b, x0, y0
x = l*sind(Sym(18))
y0 = b*sqrt(1 - x0^2/a^2) + b
eq2 = -b^2*x0/(a^2*(y0 - b)) - 1/tand(Sym(162))
eq3 = (x - x0)/y0 - tand(Sym(18))
res = solve([eq2, eq3], (b, x0))[1]
(sqrt(5)*sqrt( (-16*a^2*l^2*(15 - 7*sqrt(5))^2 + (-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2)^2)/(-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2)^2)*(-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2)/(4*l*sqrt(5 - 2*sqrt(5))*(15 - 7*sqrt(5))), 4*a^2*l*(15 - 7*sqrt(5))/(-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2))
function draw(more=false)
pyplot(size=(300, 300), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
l = 15
a = 1//2
x = l*sind(18)
(b, x0) = (sqrt(5)*sqrt( (-16*a^2*l^2*(15 - 7*sqrt(5))^2 + (-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2)^2)/(-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2)^2)*(-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2)/(4*l*sqrt(5 - 2*sqrt(5))*(15 - 7*sqrt(5))), 4*a^2*l*(15 - 7*sqrt(5))/(-40*a^2 + 16*sqrt(5)*a^2 - 25*l^2 + 11*sqrt(5)*l^2))
y0 = b*sqrt(1 - x0^2/a^2) + b
@printf("楕円の長径 = %.10g; a = %.10g; b = %.10g\n", 2b, a, b)
@printf("b = %.10g; x0 = %.10g; y0 = %.10g\n", b, x0, y0)
plot([x, 0, -x, x], [0, l*cosd(18), 0, 0], color=:blue, lw=0.5)
ellipse(0, b, a, b)
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)
end
end;
楕円の長径 = 14.09985453; a = 0.5; b = 7.049927263
b = 7.049927263; x0 = 0.1066282377; y0 = 13.93767977
三角形に内接する楕円の長径,短径を求めるには,「算法助術」の公式97 を使うことができる。
求まる数値 7.04992726271756 は上と一致する。
@syms x, h, a, b
x = 15sind(Sym(18))
h = sqrt(15^2 - x^2)
a = 1//2
b = solve(h*(2a)^2 - (h - 2b)*(2x)^2, b)[1]
b |> factor |> println
b.evalf() |> println
-(-447*sqrt(2) + sqrt(10))*sqrt(sqrt(5) + 5)/240
7.04992726271756
@printf("楕円の長径 = %.10g; a = %.10g; b = %.10g\n", 2b, a, b)
楕円の長径 = 14.09985453; a = 0.5; b = 7.049927263
正五角形の一辺の長さが 15 寸のとき,楕円の長径は 14.09985453 である。
描画関数プログラムのソースを見る
function draw(more=false)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
innerx = Vector{Float64}(undef, 6)
innery = Vector{Float64}(undef, 6)
outerx = Vector{Float64}(undef, 6)
outery = Vector{Float64}(undef, 6)
outerlength = 15/(2sind(36))
innerlength = outerlength*sind(22.5)
for i in 1:6
θ = (72*i) - 18
innerx[i] = innerlength*cosd(θ)
innery[i] = innerlength*sind(θ)
θ = (72*i) - 54
outerx[i] = outerlength*cosd(θ)
outery[i] = outerlength*sind(θ)
end
@printf("一辺の長さ = %g\n", outerx[5] - outerx[4])
a = 1//2
b = sqrt(12815212505 - 113904000*sqrt(5))/(60*sqrt(5 - 2*sqrt(5))*(112 + 113*sqrt(5)))
@printf("楕円の長径 = %.8g; a = %.8g; b = %.8g\n", 2b, a, b)
plot()
for i in 1:5
segment(outerx[i], outery[i], innerx[i+1], innery[i+1], :blue)
#segment(innerx[i], innery[i], innerx[i+1], innery[i+1], :green)
segment(outerx[i], outery[i], outerx[i+1], outery[i+1], :red)
end
ox = (outerx[1] + innerx[1])/2
oy = -3.15
l = sqrt(ox^2 + oy^2)
θ = atand(oy/ox)
for i in 0:4
ellipse(l*cosd(72i + θ), l*sind(72i + θ), a, b, φ=72i, color=:green)
end
end;
以下のアイコンをクリックして応援してください