算額(その573)
群馬の算額 72-6 貫前神社 嘉永2年
http://takasakiwasan.web.fc2.com/gunnsann/g072-6.html
楕円の中に 2 個の合同な菱形と,2 個の合同な円を入れる。円は楕円の長径の端で楕円に接する最大のものとする。楕円の短径が 1 寸のとき,菱形の一辺の長さを求めよ。
楕円の長径と短径を a, b とする。
円は曲率円なので,その半径は b^2/a である。
円の半径と中心座標を r, (0, a - r); r = b^2/a
第一象限にある菱形の頂点座標を (x, y); y = b/2
とおき,以下の連立方程式を解く。
include("julia-source.txt");
using SymPy
@syms a::positive, b::positive, x::positive, y::positive,
r::positive, c::positive
r = b^2/a
y = b/2
eq1 = x^2/a^2 + y^2/b^2 - 1
eq2 = y/sqrt(x^2 + y^2) - r/(a - r);
res = solve([eq1, eq2], (a, x))
1-element Vector{Tuple{Sym, Sym}}:
(sqrt(5)*b, sqrt(15)*b/2)
長径は短径の √5 倍である。
短径が 1/2 寸のとき,長径は a = (1/2)√5 ≒ 1.11803,r = (1/2)^2 / ((1/2)√5) ≒ 0.223607,x = (1/2)*√15/2 ≒ 0.968246,y = 1/4 である。
a = (1/2)^2/√5
r = (1/2)^2 / ((1/2)√5)
x = (1/2)*√15/2
y = 1/4
(a, r, x, y)
(0.11180339887498948, 0.22360679774997896, 0.9682458365518543, 0.25)
菱形の一辺の長さは sqrt(x^2 + y^2) = 1 である。
sqrt(x^2 + y^2)
1.0
function draw(more=false)
pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
b = 1//2
(a, x) = (sqrt(5)*b, sqrt(15)*b/2)
y = b/2
r = b^2/a
c = sqrt(x^2 + y^2)
@printf("a = %g; r = %g; x = %g; y = %g; c = %g\n", a, r, x, y, c)
plot()
ellipse(0, 0, a, b, color=:red)
circle(a - r, 0, r, :green)
circle(r - a, 0, r, :green)
plot!([0, x, 0, -x, x, 0, -x, 0], [0, y, b, y, -y, -b, -y, 0], color=:blue, lw=0.5)
if more
delta = (fontheight = (ylims()[2]- ylims()[1]) / 500 * 10 * 2) /3 # size[2] * fontsize * 2
hline!([0], color=:black, lw=0.5)
vline!([0], color=:black, lw=0.5)
point(x, y, " (x,y)", :green, :left, :vcenter)
point(a - r, 0, "a-r", :green, :center, :bottom, delta=delta/2)
point(a, 0, "a ", :green, :right, :bottom, delta=delta/2)
point(0, b, " b", :green, :left, :bottom, delta=delta/2)
end
end;
※コメント投稿者のブログIDはブログ作成者のみに通知されます