裏 RjpWiki

Julia ときどき R, Python によるコンピュータプログラム,コンピュータ・サイエンス,統計学

算額(その1404)改訂版

2025年03月06日 | Julia

算額(その1404) 改訂版

算額(その1404)は,依拠した図がでたらめなものであったので,改訂版を書いた。

三十二 一関市舞川 観福寺内地蔵堂 明治43年(1901)

山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

今有如図
https://w.atwiki.jp/sangaku/pages/158.html


キーワード:円2個,直角三角形4個,等脚台形
#Julia, #SymPy, #算額, #和算

問の原文は以下のとおりである。
「今有如図半円内設等円二個従其親所洩二斜容等円一個其等円径若干問得半円径術如何」

山村の図は正しいものではない。「今有如図」の図に従って解を求めると,術に一致する解が得られた。

円弧の半径と中心座標を R, (0, 0)
等円の半径と中心座標を r, (x, r), (0 - r)
円弧と等円の接点座標を (x0, y0)
とおき,以下の連立方程式を解く。

斜線は,(x0, y0), (x, 0), (0, y01) を通る。

include("julia-source.txt");
# # julia-source.txt ソース https://blog.goo.ne.jp/r-de-r/e/ad3a427b84bb416c4f5b73089ae813cf

@syms R::positive, r::positive, x::positive, x0::positive, y0::positive
eq1 = dist2(x, 0, x0, y0, 0, -r, r)
eq2 = x^2 + r^2 - (R - r)^2
eq3 = (x0 - x)^2 + (y0 - r)^2 - r^2
eq4 = x0^2 + y0^2 - R^2
res = solve([eq1, eq2, eq3, eq4], (R, x, x0, y0))[1]

    (3*r, sqrt(3)*r, 3*sqrt(3)*r/2, 3*r/2)

円弧の半径 R は,等円の半径 r の 3 倍である。
等円の直径が 1 寸のとき,円弧直径は 3 寸である。
x = 0.866025,x0 = 1.29904, y0 = 0.75

function draw(r, more)
    pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
    (R, x, x0, y0) = (3*r, sqrt(3)*r, 3*sqrt(3)*r/2, 3*r/2)
    @printf("等円の直径が %g のとき,円弧の直径は %g である。ただし,x = %g,x0 = %g, y0 = %g である。\n", 2r, 2R, x, x0, y0)
    plot()
    circle(0, 0, R, beginangle=0, endangle=180)
    circle2(x, r, r, :blue)
    circle(0, -r, r, :blue)
    (x01, y01) = float.(intersection(x0, y0, x, 0, -x0, y0, -x, 0))
    println((x01, y01))
    segment(x0, y0, 0, y01)
    segment(-x0, y0, 0, y01)
    segment(-R, 0, R, 0, :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(x0, y0, "(x0,y0)", :blue, :right, :vcenter, deltax=-delta)
        point(x, 0, "x", :blue, :center, delta=-delta)
        point(R, 0, "R", :red, :center, delta=-delta)
        point(x, r, "等円:r,(x,r)", :blue, :center, delta=-delta, deltax=-2delta)
        point(0, -r, "等円:r,(0,-r)", :blue, :center, delta=-delta, deltax=-2delta)
        point(0, y01, "y01", :black, :left, :vcenter, deltax=delta)
    end
end;

draw(1/2, true)

 


コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« 算額(その1403) 改訂版 | トップ | 次の記事へ »
最新の画像もっと見る

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。

Julia」カテゴリの最新記事