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つの三角形の連結「高校入試チャレンジ問題 △ABCの面積は?(中学生の知識で)」様を、計算はsympyで作図は手抜きのつもりでした。

0
Last updated at Posted at 2026-08-28

・中学生の知識でも? です。
・(私の新しい書き方? 私は慣れが必要です。)

オリジナル

YUUU0123 様 (0:00〜4:21) いつもお世話になっております。
↓高校入試チャレンジ問題 △ABCの面積は?(中学生の知識で)
https://youtu.be/QMQUvUMxx_4

いつものsympyで(オリジナル Youtbe様の方法を参考に)

ver0.1

・先生の丸写しです。図形の証明は省略です。

# ver0.1
from sympy import *
var('x,h',real=True,positive=True)
BC,BD,BA=10,7,6
x,h     =solve([Eq(x**2+h**2,BA**2),Eq((BC+x)**2+h**2,(BD+BD)**2)],[x,h])[0]
print("#",Rational(1,2)*BC*h)
# 15*sqrt(3)

ver0.2

・上と同じです。

# ver0.2
from sympy import *
var('x,h',real=True,positive=True)
BC,BD,BA=10,7,6
print("#",Rational(1,2)*BC*solve([Eq(x**2+h**2,BA**2),Eq((BC+x)**2+h**2,(BD+BD)**2)],[x,h])[0][1])
# 15*sqrt(3)

いつもの sympyで

ver1.1

・CAを水平にしました。画面を右回転して見て下さい。C(0,0)D(CD,0)
・3元連立方程式

# ver1.1
from sympy import *
var('CD,Bx,By',real=True,positive=True)
BC,BD,BA=10,7,6
C,D,A   =map(Point,[(0,0),(CD,0),(CD+CD,0)])
B       =Point(Bx,By)
sol_CD,sol_Bx,sol_By=solve([Eq(B.distance(C),BC),  \
                            Eq(B.distance(D),BD),  \
                            Eq(B.distance(A),BA)], \
                           [CD,Bx,By])[0]  
rep={CD:sol_CD,Bx:sol_Bx,By:sol_By}
print("#",Triangle(A,B,C).area.subs(rep))
# 15*sqrt(3)

ver1.2

・なかなか書けないです。Gemini先生に 1行化 を教えてもらいました。

# ver1.2
from sympy import *
var('CD,Bx,By',real=True,positive=True)
BC,BD,BA=10,7,6
C,D,A   =map(Point,[(0,0),(CD,0),(CD+CD,0)])
B       =Point(Bx,By)
print("#", Triangle(A, B, C).area.subs(dict(zip([CD, Bx, By], solve([Eq(B.distance(C), BC), Eq(B.distance(D), BD), Eq(B.distance(A), BA)], [CD, Bx, By])[0]))))
# 15*sqrt(3)

(続けて)ChatGPT先生へ

PNG図のみ出力して下さい。
(ソースコードの表示を省略)

image.png

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

sympyのweb上での実行方法

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

(テンプレート)

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

sympy のdoc

・いらないカモ。

ver0.1

ver0.2

ver1.1

ver1.2

Qiita内で

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?