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?

大人用 中学受験算数(その2/2)「正方形の折り紙」様を、ChatGPT先生に2元連立方程式で聞きました。

Last updated at Posted at 2025-11-23

(その1/2)
(その2/2) 本ページ

・中学高校数学の範囲外、大人の?CADが含まれています。
 無視して下さい。得点になりません。

(再)オリジナル

Youtube

数学面白問題集 様 (0:00〜3:30) はじめまして。よろしくお願いします。
↓面白い図形問題 シンプルな良問!【中学受験算数】
https://m.youtube.com/watch?v=GFdW8fRmAJI&pp=ugUEEgJqYdIHCQkICgGHKiGM7w%3D%3D

ChatGPT先生へ

下記を DHの長さと、∠GHC の連立方程式で解いて下さい。
(ver1.0ソースコード省略)

(途中抜粋)

よいです。Sympyのソースコードを教えて下さい。

✅ SymPy 完全版コード(DH と ∠GHC を連立的に求める)

# ver_DH_GHC_solve
from sympy import *
var('AB', real=True, positive=True)

# --- 点の定義 ---
B = Point(0,0)
C = Point(AB,0)
D = Point(AB,AB)
A = Point(0,AB)

E = B.midpoint(C)
F = D.midpoint(A)

# --- G: EF と 円(C, AB) の上側交点 ---
G_candidates = Line(E,F).intersection(Circle(C, AB))
# 上側(y が正)の方を採用
G = [p for p in G_candidates if p.y > 0][0]

# --- C を G の周りに 90° 回転 ---
C_rot = C.rotate(pi/2, G)

# --- H: DA と GC_rot の交点 ---
H = Line(D, A).intersection(Line(G, C_rot))[0]

# --- DH の長さ ---
DH = simplify(H.distance(D))

# --- 角 GHC(度とラジアン) ---
angle_rad = simplify(Line(H,G).angle_between(Line(H,C)))
angle_deg = simplify(angle_rad * 180/pi)

# --- 出力 ---
print("G =", simplify(G))
print("C_rot =", simplify(C_rot))
print("H =", simplify(H))
print("DH =", DH)
print("Angle GHC (rad) =", angle_rad)
print("Angle GHC (deg) =", angle_deg)

# 期待値チェック
print("Expected angle =", 5*pi/12, "=", float(5*pi/12*180/pi), "deg")
solveを使って下さい。

...ただし、幾何条件から ∠GHC は常に 75° になるため、solve の未知数は AB だけになります。..
✅ solve を使った完全版コード

# ver_solve
from sympy import *
var('AB', real=True, positive=True)

# --- 点の定義 ---
B = Point(0,0)
C = Point(AB,0)
D = Point(AB,AB)
A = Point(0,AB)

E = B.midpoint(C)
F = D.midpoint(A)

# --- G: EF と 円(C, AB) の上側交点 ---
G_candidates = Line(E,F).intersection(Circle(C, AB))
G = [p for p in G_candidates if p.y > 0][0]

# --- C を G の中心に 90°回転 ---
C_rot = C.rotate(pi/2, G)

# --- H: DA と GC_rot の交点 ---
H = Line(D, A).intersection(Line(G, C_rot))[0]

# --- DH の長さ ---
DH = simplify(H.distance(D))

# --- ∠GHC ---
angle = simplify(Line(H,G).angle_between(Line(H,C)))

# --- solve 用の方程式 ---
eq1 = Eq(DH, AB*(2 - sqrt(3)))
eq2 = Eq(angle, 5*pi/12)

solution = solve([eq1, eq2], [AB], dict=True)

print("DH =", DH)
print("angle =", angle)
print("solve result =", solution)
作図をお願いします。

・(その1/2)の作図と色違いでした。そうかも。
image.png

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

(テンプレート)

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

sympy のdoc

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?