裏 RjpWiki

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

算額(その1086)

2024年06月21日 | Julia

算額(その1086)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:円10個,外円,弦

全円の中に水平な弦を引き,その上下に乙円 2 個,丙円 2 個,大円 1 個を入れる。大円の中には甲円 2 個,乙円 2 個が入っている。丙円の直径が 1 寸のとき,全円の直径はいかほどか。

全円の半径と中心座標を R, (0, 0)
大円の半径と中心座標を 2r1, (0 2r1 - R)
甲円の半径と中心座標を r1, (0, r1 - R), (0, 3r1 - R)
乙円の半径と中心座標を r2, (x2, 2r1 - R), (r2, 4r1 - R + r2)
丙円の半径と中心座標を r3, (x3, 4r1 - R - r3)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy
@syms R::positive, r1::positive, r2::positive, x2::positive,
     r3::positive, x3::positive, y3::positive,
     r4::positive
eq1 = r2^2 + (4r1 - R + r2)^2 - (R - r2)^2
eq2 = x3^2 + (4r1 - R - r3)^2 - (R - r3)^2
eq3 = x3^2 + (2r1- r3)^2 - (2r1 + r3)^2
eq4 = x2^2 + r1^2 - (r1 + r2)^2
eq5 = x2 + r2 - 2r1
res = solve([eq1, eq2, eq3, eq4, eq5], (R, r1, r2, x2, x3))[1]

   (2401*r3/468, 49*r3/26, 49*r3/39, 98*r3/39, 14*sqrt(13)*r3/13)

全円の半径 R は,丙円の 2401/468 倍である。
丙円の直径が 1 寸のとき,全円の直径は 5 寸と 61/468 である。

divrem(2401, 468)

   (5, 61)

その他のパラメータは以下のとおりである。

  r3 = 0.5;  R = 2.56517;  r1 = 0.942308;  r2 = 0.628205;  x2 = 1.25641;  x3 = 1.94145

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r3 = 1/2
   (R, r1, r2, x2, x3) = (2401*r3/468, 49*r3/26, 49*r3/39, 98*r3/39, 14*sqrt(13)*r3/13)
   @printf("丙円の直径が %g のとき,全円の直径は %g である。\n", 2r3, 2R)
   @printf("r3 = %g;  R = %g;  r1 = %g;  r2 = %g;  x2 = %g;  x3 = %g\n", r3, R, r1, r2, x2, x3)
   plot()
   circle(0, 0, R, :green)
   circle(0, r1 - R, r1)
   circle(0, 3r1 - R, r1)
   circle(0, 2r1 - R, 2r1, :orange)
   circle2(x2, 2r1 - R, r2, :blue)
   circle2(x3, 4r1 - R - r3, r3, :magenta)
   circle2(r2, 4r1 - R + r2, r2, :blue)
   y0 = 4r1 - R
   x0 = sqrt(R^2 - y0^2)
   segment(-x0, y0, x0, y0, :brown)
   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(0, r1 - R, "甲円:r1,(0,r1-R)", :red, :center, delta=-delta/2)
       point(0, 2r1 - R, " 2r1-R", :red, :center, :bottom, delta=delta/2)
       point(0, 4r1 - R, " 4r1-R", :red, :center, delta=-delta/2)
       point(0, 3r1 - R, "甲円:r1,(0,3r1-R)", :red, :center, delta=-delta/2)
       point(x2, 2r1 - R, "乙円:r2\n(x2,2r1-R)", :blue, :center, delta=-delta/2)
       point(r2, 4r1 - R + r2, "乙円:r2\n(r2,4r1-R+r2)", :blue, :center, delta=-delta/2)
       point(x3, 4r1 - R - r3, "丙円:r2\n(x3,4r1-R-r3)", :magenta, :center, :bottom, delta=delta/2)
       point(0, R, "R", :green, :center, :bottom, delta=delta/2)
       point(R, 0, " R", :green, :left, :vcenter)
   end
end;

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

算額(その1085)

2024年06月21日 | Julia

算額(その1085)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:円4個,半円1個,四分円2個,正方形

直線の上に大円,小円が載っており,大円の中には水平な元を挟んで,小円 2 個と中円 1 個が入っている。小円の直径が 1 寸のとき,中円の直径はいかほどか。

大円の半径と中心座標を r1, (r1, r1)
中円の半径と中心座標を r2, (x2, y2)
小円の半径と中心座標を r3, (0, r3), (x3, 2r1 - 3r3), (r1, 2r1 - r3)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy
@syms r1::positive, r2::positive,
     r3::positive, x3::positive, y3::positive,
     r4::positive
eq1 = r1^2 + r2^2 - (2r1 - r2)^2
eq3 = (2r1 - x3)^2 +y3^2 - (2r1 - r3)^2
eq4 = (x3 - r1)^2 + (2r1 - y3)^2 - (r1 - r3)^2
eq5 = x3^2 + y3^2 - (2r1 + r3)^2
eq2 = 2r2 - r4 - (r1 + r4)
res = solve([eq1, eq2, eq3, eq4, eq5], (r1, r2, r3, x3, y3))[1]

   (4*r4, 3*r4, 4*r4*(26 - sqrt(-52*sqrt(3)*sqrt(19 - 8*sqrt(3)) - 24*sqrt(3) + 733))/13, 4*r4*(2*sqrt(57 - 24*sqrt(3)) + 13)/13, 8*r4*(sqrt(3) + 9)/13)

r3, x3 は二重根号を外して簡約化できる。

res[3] |> sympy.sqrtdenest |> simplify |> println

   4*r4*(-3 + 4*sqrt(3))/13

res[4] |> sympy.sqrtdenest |> simplify |> println

   4*r4*(7 + 8*sqrt(3))/13

中円の半径 r3 は,小円の半径 r4 の 4(4√3 - 3)/13 倍である。
小円の直径が 1 寸のとき,中円の直径は 4(4√3 - 3)/13 = 1.2086779170078488 寸である。

その他のパラメータは以下のとおりである。

   r4 = 0.5;  r1 = 2;  r2 = 1.5;  r3 = 0.604339;  x3 = 3.20868;  y3 = 3.30217

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r4 = 1/2
   (r1, r2, r3, x3, y3) = (4*r4, 3*r4, 4*r4*(26 - sqrt(-52*sqrt(3)*sqrt(19 - 8*sqrt(3)) - 24*sqrt(3) + 733))/13, 4*r4*(2*sqrt(57 - 24*sqrt(3)) + 13)/13, 8*r4*(sqrt(3) + 9)/13)
   @printf("小円の直径が %g のとき,中円の直径は %g である。\n", 2r4, 2r3)
   @printf("r4 = %g;  r1 = %g;  r2 = %g;  r3 = %g;  x3 = %g;  y3 = %g\n", r4, r1, r2, r3, x3, y3)
   plot(2r1 .* [0, 1, 1, 0, 0], 2r1 .* [0, 0, 1, 1, 0], color=:green, lw=0.5)
   circle(2r1, 0, 2r1, beginangle=90, endangle=180)
   circle(0, 0, 2r1, beginangle=0, endangle=90)
   circle(r1, 2r1, r1, beginangle=180, endangle=360)
   circle(r1, r2, r2, :blue)
   circle(x3, y3, r3, :magenta)
   circle(2r1 - x3, y3, r3, :magenta)
   circle(r1, 2r2 - r4, r4, :green)
   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(r1, r2, "大円:r2,(r1,r2)", :blue, :center, delta=-delta/2)
       point(x3, y3, "中円:r3,(x3,y3)", :magenta, :center, delta=-delta/2)
       point(r1, 2r2 - r4, "小円:r4\n(r1,2r2-r4)", :green, :center, delta=-delta/2)
       point(r1, 2r1, "(r1,2r1)", :green, :center, :bottom, delta=delta/2)
   end
end;

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

算額(その1084)

2024年06月21日 | Julia

算額(その1084)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:キーワード:円9個,外円,弦

直線の上に大円,小円が載っており,大円の中には水平な元を挟んで,小円 2 個と中円 1 個が入っている。小円の直径が 1 寸のとき,中円の直径はいかほどか。

大円の半径と中心座標を r1, (r1, r1)
中円の半径と中心座標を r2, (x2, y2)
小円の半径と中心座標を r3, (0, r3), (x3, 2r1 - 3r3), (r1, 2r1 - r3)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy
@syms r1::positive, r2::positive, x2::positive, y2::positive,
     r3::positive, x3::positive
eq1 = r1^2 + (r1 - r3)^2 - (r1 + r3)^2
eq2 = (x3 - x2)^2 + (2r1 - 3r3 - y2)^2 - (r2 + r3)^2
eq3 = (r1 - x2)^2 + (r1 - y2)^2 - (r1 - r2)^2
eq4 = (x3 - r1)^2 + (r1 - 3r3)^2 - (r1 - r3)^2
eq5 = y2 + r2 - (2r1 - 2r3)
res = solve([eq1, eq2, eq3, eq4, eq5], (r1, r2, x2, y2, x3))[4]  # 4 of 4

   (4*r3, r3*(2*sqrt(2) + 3)/2, r3*(sqrt(2) + 2), r3*(9/2 - sqrt(2)), 2*r3*(sqrt(2) + 2))

中円の半径 r2 は,小円の半径 r3 の (2√2 + 3)/2 倍である。
小円の直径が 1 寸のとき,中円の直径は 2.914213562373095 寸である。

その他のパラメータは以下のとおりである。

   r3 = 0.5;  r1 = 2;  r2 = 1.45711;  x2 = 1.70711;  y2 = 1.54289;  x3 = 3.41421

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r3 = 1/2
   (r1, r2, x2, y2, x3) = (4*r3, r3*(2*sqrt(2) + 3)/2, r3*(sqrt(2) + 2), r3*(9/2 - sqrt(2)), 2*r3*(sqrt(2) + 2))
   @printf("小円の直径が %g のとき,中円の直径は %g である。\n", 2r3, 2r2)
   plot()
   circle2(r1, r1, r1, :blue)
   circle2(x2, y2, r2, :green)
   circle2(x3, 2r1 - 3r3, r3)
   circle(0, r3, r3)
   circle2(r1, 2r1 - r3, r3)
   y0 = r1 - 2r3
   x0 = sqrt(r1^2 - y0^2)
   segment(r1 - x0, r1 + y0, r1 + x0, r1 + y0, :magenta)
   segment(x0 - r1, r1 + y0, -r1 - x0, r1 + y0, :magenta)
   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(r1, r1, "大円:r1,(r1,r1)", :blue, :center, delta=-delta/2)
       point(x2, y2, "中円:r2,(x2, y2)", :green, :center, delta=-delta/2)
       point(0, r3, "小円:r3,(0,r3)", :black, :center, delta=-delta/2)
       point(r1, 2r1 - r3, "小円:r3,(r1,2r1-r3)", :black, :center, delta=-delta/2)
       point(x3, 2r1 - 3r3, "小円:r3,(x4,2r1-3r3)", :black, :center, delta=-delta/2, deltax=-6delta)
       segment(-2r1, 0, 2r1, 0)
   end
end;

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

算額(その1083)

2024年06月21日 | Julia

算額(その1083)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:円11個,円弧,1/3円,外円

全円の中に,円弧(1/3円) 2 個,甲円 2 個,乙円 2 個,丙円 4 個,丁円 2 個を容れる。全円の直径が 3 寸のとき,10 個の円(甲,乙,丙,丁)の直径の和はいかほどか。



全円の半径と中心座標を R, (0, 0)
半円の半径と中心座標を R, (0, R), (0, -R)
甲円の半径と中心座標を r1, (0, R - r1)
乙円の半径と中心座標を r2, (R - r2, 0)
丙円の半径と中心座標を r3, (x3, y3)
丁円の半径と中心座標を r4, (x4, 0)

include("julia-source.txt")

using SymPy
@syms R::positive, r1::positive, r2::positive,
     r3::positive, x3::positive, y3::positive,
     r4::positive, x4::positive
r1 = R/2
x3 = r1 + r3
y3 = r1
eq1 = x3^2 + (R - y3)^2 - (R - r3)^2
eq2 = (R - r2)^2 + R^2 - (R + r2)^2
eq3 = x4^2 + R^2 - (R + r4)^2
eq4 = x4 + r4 + 2r2 - R;
(r2, r3, r4, x4) = solve([eq1, eq2, eq3, eq4], (r2, r3, r4, x4))[1]

   (R/4, R/6, R/12, 5*R/12)

全円の直径 2R が 3 寸のとき,10 個の円(甲,乙,丙,丁)の直径の和は 14R/3 = 7 寸である。

2(2r1 + 2r2 + 4r3 + 2r4) |> println
2(2r1 + 2r2 + 4r3 + 2r4)(R => 3//2) |> println

   14*R/3
   7

その他のパラメータは以下のとおりである。

   R = 1.5;  r1 = 0.75;  r2 = 0.375;  r3 = 0.25;  r4 = 0.125;  x3 = 1;  y3 = 0.75;  x4 = 0.625

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   R =3/2
   (r2, r3, r4, x4) = (R/4, R/6, R/12, 5*R/12)
   r1 = R/2
   x3 = r1 + r3
   y3 = r1
   @printf("R = %g;  r1 = %g;  r2 = %g;  r3 = %g;  r4 = %g;  x3 = %g;  y3 = %g;  x4 = %g\n",
       R, r1, r2, r3, r4, x3, y3, x4)
   plot()
   circle(0, 0, R, :blue)
   circle(0, R, R, :blue, beginangle=210, endangle=330)
   circle(0, -R, R, :blue, beginangle=30, endangle=150)
   circle22(0, R - r1, r1, :magenta)
   circle2(R - r2, 0, r2, :red)
   circle4(x3, y3, r3, :green)
   circle2(x4, 0, r4, :orange)
   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(0, R, " R", :blue, :left, :bottom, delta=delta/2)
       point(R, 0, " R", :blue, :left, :bottom, delta=delta/2)
       point(0, R - r1, "甲円:r1,(0,R-r1)", :magenta, :center, delta=-delta/2)
       point(R - r2, 0, "乙円:r2\n(R-r2,0)", :red, :center, delta=-delta/2)
       point(x3, y3, "丙円:r3\n(x3,y3)", :green, :center, delta=-delta/2)
       point(x4, 0, "丁円:r4,(x4,0)", :black, :left, :bottom, delta=delta/2)
   end
end;

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

算額(その1082)

2024年06月21日 | Julia

算額(その1082)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:円6個,半円3個,正三角形

正三角形の中に,半円,大円,小円を 3 個ずつ容れる。小円の直径が 1 寸のとき,大円の直径はいかほどか。

半円の半径は正三角形の一辺の長さの √3/2 倍で,その中心は正三角形の辺の中点である。
正三角形の一辺の長さを 2a
半円の半径と中心座標を R, (0, 0), (a/2, √3a/2), (-a/2, √3a/2)
大円の半径と中心座標を r1, (0, R - r1), (x1, r1)
小円の半径と中心座標を r2, (0, r2)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy
@syms a::positive, R::positive, r1::positive, x1::positive, r2::positive
R = √Sym(3)a/2
eq1 = x1^2 + r1^2 - (R - r1)^2
eq2 = x1^2 + (R - 2r1)^2 - 4r1^2
eq3 = (a/2)^2 + (√Sym(3)a/2 - r2)^2 - (R + r2)^2
res = solve([eq1, eq2, eq3], (a, r1, x1))[1]

   (8*sqrt(3)*r2, 4*r2, 4*sqrt(3)*r2)

大円の半径は,小円の半径の 4 倍である。
小円の直径が 1 寸のとき,大円の直径は 4 寸である。

その他のパラメータは以下のとおりである。

r2 = 0.5;  a = 6.9282;  r1 = 2;  x1 = 3.4641;  R = 6

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r2 = 1/2
   (a, r1, x1) = (8*sqrt(3)*r2, 4*r2, 4*sqrt(3)*r2)
   R = √3a/2
   @printf("r2 = %g;  a = %g;  r1 = %g;  x1 = %g;  R = %g\n",  r2, a, r1, x1, R)
   plot([a, 0, -a, a], [0, √3a, 0, 0], color=:magenta, lw=0.5)
   circle(0, 0, R, :blue,  beginangle=0, endangle=180)
   circle(a/2, √3a/2, R, :blue, beginangle=120, endangle= 300)
   circle(-a/2, √3a/2, R, :blue, beginangle=-120, endangle= 60)
   circle(0, a/√3, r1)
   circle2(x1, r1, r1)
   circle2(0, R + r1, r1)
   circle(0, r2, r2, :green)
   circle((R - r1 - r2)*cosd(30), (R - r1) + (R - r1 - r2)*sind(30), r2, :green)
   circle((R - r1 - r2)*cosd(150), (R - r1) + (R - r1 - r2)*sind(150), r2, :green)
   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(0, R - r1, "大円:r1,(0,R-r1)", :red, :center, delta=-delta/2)
       point(x1, r1, "大円:r1,(x1,r1)", :red, :center, delta=-delta/2)
       point(0, r2, " 小円:r2,(0,r2)", :black, :left, :vcenter)
       point(a/2, √3a/2, "半円:R\n(a/2,√3a/2)", :blue, :left, :vcenter, deltax=2delta)
       point(0, R, " R", :blue, :center, :bottom, delta=delta/2)
       point(0, √3a, " √3a", :blue, :center, :bottom, delta=delta/2)
       point(R, 0, " R", :blue, :left, :bottom, delta=delta/2)
       point(a, 0, " a", :magenta, :left, :bottom, delta=delta/2)
   end
end;

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

算額(その1081)

2024年06月21日 | Julia

算額(その1081)

九十八 岩手県江刺市 雨宝堂 現中善観音堂 文政10年(1827)
山村善夫:現存 岩手の算額,昭和52年1月30日,熊谷印刷,盛岡市.
http://www.wasan.jp/yamamura/yamamura.html

キーワード:円11個,外円,二等辺三角形(直角三角形)

全円の中に圭(二等辺三角形),甲円 3 個,乙円 1 個,丙円 2 個,丁円 4 個を容れる。丙円の直径が 1 寸のとき,乙円の直径はいかほどか。

注:「問」では圭(二等辺三角形)といっているが底辺は全円の直径である。したがって,三角形は二等辺直角三角形である。

全円の半径と中心座標を R, (0, 0)
甲円の半径と中心座標を r1, (0, R - r1), (r1, -r1)
乙円の半径と中心座標を r2, (0, r2 - R)
丙円の半径と中心座標を r3, (x3, x3)
丁円の半径と中心座標を r4, (x4, y4), (y4, x4)
とおき,以下の連立方程式を解く。

include("julia-source.txt")

using SymPy
@syms R::positive, r1::positive, r2::positive, r3::positive, x3::positive
eq1 = 2r1^2 - (R - r1)^2
eq2 = r1^2 + (-r1 -(r2 - R))^2 - (r1 + r2)^2
eq3 = 2x3^2 - (R - r3)^2
eq4 = 2(R - 2r3)^2 - R^2
res = solve([eq1, eq2, eq3, eq4], (r1, r2, x3, R))[2];  # 2 of 2

r1 = res[1] |> sympy.sqrtdenest |> simplify
r2 = res[2] |> sympy.sqrtdenest |> simplify
x3 = res[3] |> sympy.sqrtdenest |> simplify
R = res[4]
(r1, r2, x3, R)

   (2*sqrt(2)*r3, 2*r3*(2 - sqrt(2)), r3*(4 + 3*sqrt(2))/2, 2*r3*(sqrt(2) + 2))

乙円の半径は丙円の半径の 4 - 2√2 = 1.17157287525381 倍である。
丙円の直径が 1 寸のとき,乙円の直径は 1.17157287525381 寸である。

---

これ以降で,図を描くために丁円の半径と中心座標を求める。

パラメータを簡単にするために図を反時計回りに 45° 回転させたものを使う。
まず丁円の半径を求める。算法助術の公式29 を使うまでもなく,以下で求めることができる。中心座標は後で求めるので使わない(使用するためには回転しなければならずかえって面倒になる)。

using SymPy
@syms R::positive, r3::positive, r4::positive, x4::positive, y4::positive
y4 = R - 2r3 + r4
eq5 = x4^2 + y4^2 - (R - r4)^2
eq6 = x4^2 + (r3 - r4)^2 - (r3 + r4)^2
res2 = solve([eq5, eq6], (r4, x4))[1]

   (-r3*(-R + r3)/R, 2*r3*sqrt(R - r3)/sqrt(R))

@syms x4::positive, y4::positive
x3 = r3*(4 + 3√Sym(2))/2
R = 2r3*(√Sym(2) + 2)
r4 = -r3*(-R + r3)/R
eq7 = (x4 - x3)^2 + (y4 - x3)^2 - (r3 + r4)^2 |> expand |> simplify
eq8 = x4^2 + y4^2 - (R - r4)^2 |> expand |> simplify
res3 = solve([eq7, eq8], (x4, y4))[1]

   (-r3*sqrt(47321*sqrt(2) + 66922)/(140 + 99*sqrt(2)) + 5*sqrt(2)*r3/4 + 9*r3/4, r3*sqrt(47321*sqrt(2) + 66922)/(140 + 99*sqrt(2)) + 5*sqrt(2)*r3/4 + 9*r3/4)

丙円の直径が 1 寸のときの描画パラメータは以下のとおりである。

r3= 0.5;  r1 = 1.41421;  r2 = 0.585786;  x3 = 2.06066;  R = 3.41421
r4 = 0.42677669529663687

function draw(more=false)
   pyplot(size=(500, 500), grid=false, aspectratio=1, label="", fontfamily="IPAMincho")
   r3 = 1/2
   (r1, r2, x3, R) = (2*sqrt(2)*r3, 2*r3*(2 - sqrt(2)), r3*(4 + 3*sqrt(2))/2, 2*r3*(sqrt(2) + 2))
   r4 = -r3*(-R + r3)/R
   (x4, y4) = (-r3*sqrt(47321*sqrt(2) + 66922)/(140 + 99*sqrt(2)) + 5*sqrt(2)*r3/4 + 9*r3/4, r3*sqrt(47321*sqrt(2) + 66922)/(140 + 99*sqrt(2)) + 5*sqrt(2)*r3/4 + 9*r3/4)
   @printf("丙円の直径が %g のとき,乙円の直径は %g である。\n", 2r3, 2r2)
   @printf("r3= %g;  r1 = %g;  r2 = %g;  x3 = %g;  R = %g\n", r3, r1, r2, x3, R)
   plot([0, R, -R, 0], [R, 0, 0, R], color=:hotpink, lw=0.5)
   circle(0, 0, R, :blue)
   circle(0, r1, r1)
   circle2(r1, -r1, r1)
   circle(0, r2 - R, r2, :magenta)
   circle2(x3, x3, r3, :darkred)
   circle2(x4, y4, r4, :green)
   circle2(y4, x4, r4, :green)
   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(0, R, " R", :blue, :left, :bottom, delta=delta/2)
       point(R, 0, " R", :blue, :left, :bottom, delta=delta/2)
       point(0, r1, "甲円:r1,(0,r1)", :red, :center, delta=-delta/2)
       point(r1, -r1, "甲円:r1,(r1,-r1)", :red, :center, delta=-delta/2)
       point(0, r2 - R, "乙円:r2\n(0,r2-R)", :magenta, :center, :bottom, delta=delta/2)
       point(x3, x3, " 丙円:r3,(x3,x3)", :darkred, :center, delta=-delta/2, deltax=-4delta)
       point(x4, y4, " 丁円:r4,(x4,y4)", :green, :center, :bottom, delta=delta, deltax=-4delta)
       point(y4, x4, " 丁円:r4,(y4,x4)", :green, :center, delta=-delta/2, deltax=-8delta)
   end
end;

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

PVアクセスランキング にほんブログ村

PVアクセスランキング にほんブログ村