0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

大人用です。四等分円と半円。中学受験2013年灘中(その2/3)「【これぞ図形の最高峰】灘中の算数の難問で頭をフル回転させよう...」様を、Gemini先生に教えてもらいました。

0
Last updated at Posted at 2026-08-23

Gemini は AI であり、不正確な情報を表示することがあります。

(その1/3) の続き
https://qiita.com/mrrclb48z/items/568fb364a9588d2988f1
(その3/3) へ。円弧と円弧の交点計算です。
https://qiita.com/mrrclb48z/items/f042230646cd4e1ba4e4

・以下のソースコードは、技術的、気持ち的に?なかなか書けないです。

(本日の)Gemini先生へ

ver3.1

DEFG内の円弧と円弧の交点計算にして。
計算結果をテキスト形式で出力して。
(ver1.1ソースコードを非表示)
from sympy import *

DE, EF = 4, 6
D, E, F, G = map(Point, [(0, DE), (0, 0), (EF, 0), (EF, DE)])

intersections = Circle(D, DE).intersection(Circle(E.midpoint(F), Rational(1, 2) * EF))

# DEFG内(0 <= x <= 6, 0 <= y <= 4)にある交点を抽出
defg_intersections = [
    p for p in intersections 
    if 0 <= p.x <= EF and 0 <= p.y <= DE
]

# 原点(0,0)以外の交点 H を取得
H = [p for p in defg_intersections if p != E][0]

print("# 交点 H:", H)
print("# 四角形 EFGH の面積:", Polygon(E, F, G, H).area)

計算結果(テキスト出力)

# 交点 H: Point2D(96/25, 72/25)
# 四角形 EFGH の面積: 324/25

ver3.2

円弧と円弧 のInterval にして下さい。
(ver1.1ソースコードを非表示)
from sympy import *

DE, EF = 4, 6
D, E, F, G = map(Point, [(0, DE), (0, 0), (EF, 0), (EF, DE)])

intersections = Circle(D, DE).intersection(Circle(E.midpoint(F), Rational(1, 2) * EF))

# DEFG内(0 <= x <= 6, 0 <= y <= 4)にある交点を抽出
defg_intersections = [
    p for p in intersections 
    if p.x in Interval(0, EF) and p.y in Interval(0, DE)
]

# 原点(0,0)以外の交点 H を取得
H = [p for p in defg_intersections if p != E][0]

print("# 交点 H:", H)
print("# 四角形 EFGH の面積:", Polygon(E, F, G, H).area)

計算結果(テキスト出力)

# 交点 H: Point2D(96/25, 72/25)
# 四角形 EFGH の面積: 324/25

いつもの? sympyの実行環境 と 参考のおすすめです。

sympyのweb上での実行方法

SymPy Live Shellで。
ソースコードの解説は、私よりGemini先生へのソースコードの丸投げがおすすめです。質問の追加はいくらでも。
モーダル対応?「実行して」。「作図して」「問題文章の丸投げ」いい時代です。

(テンプレート)

いつもと違うおすすめです。

sympy のdoc

・いらないカモ。docは私のメモです。

ver3.1

ver3.2

・class sympy.sets.sets.Interval(
start,
end,
left_open=False,
right_open=False,
)
https://docs.sympy.org/latest/modules/sets.html#sympy.sets.sets.Interval

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?