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?

大人用です。中学受験2025年東海中「【2025年度最高のヒラメキ図形】これぞ図形の真骨頂!難関中学の問題で力試ししよう」様を、計算はsympyで作図は手抜きのつもりでした。

0
Last updated at Posted at 2026-08-15

スバラシくないですか...

だそうです。そうカモ。
・ver1.2 がおすすめ。
・ver2.1。BC はvar でイイんじゃないの。です。公式風です。
・ver2.2。 〃

オリジナル

まなびスクエア 様 (0:00〜38:05) いつもお世話になっております。
↓【2025年度最高のヒラメキ図形】これぞ図形の真骨頂!難関中学の問題で力試ししよう
https://youtu.be/qm-MdMNhn-Q

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

ver0.1

・先生の丸写しです。図形の証明を省略です。
>ADの中点があるから、ACの中点がある。...

# ver0.1
from sympy import *
BC    =8
DH    =BC-2
BCD   =BC*DH*Rational(1,2)
sikaku=BCD/4
CDE   =3*sikaku
print("#",CDE)
# 18

いつもの sympyで

ver1.1

・BCの中点を原点。45°で方程式です。

# ver1.1
from sympy import *
var('h',real=True,positive=True)
BC   =8 
A,B,C=map(Point,[(0,h),(-BC/2,0),(BC/2,0)])
D    =A.midpoint(B)
rep  ={h:solve(Eq(Line(C,D).angle_between(Line(C,B)),pi/4),h)[0]}   #;print(rep)
A    =A.subs(rep)
D    =D.subs(rep)
E    =Line(C,D).perpendicular_line(D).intersection(Line(A,C))[0]    #;print(E)
print("#",Triangle(C,E,D).area)
# 18

ver1.2

・CAD風??? なら簡単。point.reflect(Line) がありました。
 平行線と垂直二等分線の交点計算です。

# ver1.2
from sympy import *
var('h',real=True,positive=True)
BC   =8 
A,B,C=map(Point,[(0,h),(-BC/2,0),(BC/2,0)])
B_ref=B.reflect(Line(C,C+Point(-1,1)))                                                          # Point(-1,1)は、Point(cos(rad(180-45),sin(rad(180-45))) でも
A    =Line(C,C+Point(-1,1)).parallel_line(B_ref).intersection(Line(Point(0,0),Point(0,1)))[0]   # 垂直二等分線でも
D    =Line(A,B).intersection(Line(C,C+Point(-1,1)))[0]
E    =Line(C,D).perpendicular_line(D).intersection(Line(A,C))[0]                                #;print(E)
print("#",Triangle(C,E,D).area)
# 18

(続けて)Gemini先生へ。作図

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

image.png

(さらに続けて)sympyで。

・(再) BC はvar でイイんじゃないの。です。もっとsympy風。公式風です。

ver2.1

# ver2.1
from sympy import *
var('h' ,real=True,positive=True)
var('BC',real=True,positive=True)            # BC=8 
A,B,C=map(Point,[(0,h),(-BC/2,0),(BC/2,0)])
D    =A.midpoint(B)
rep  ={h:solve(Eq(Line(C,D).angle_between(Line(C,B)),pi/4),h)[0]}   #;print(rep)
A    =A.subs(rep)
D    =D.subs(rep)
E    =Line(C,D).perpendicular_line(D).intersection(Line(A,C))[0]    #;print(E)
print("#",Triangle(C,E,D).area)
print("#",Triangle(C,E,D).area.subs({BC:8}))
# 9*BC**2/32
# 18

ver2.2

# ver2.2
from sympy import *
var('h' ,real=True,positive=True)
var('BC',real=True,positive=True)            # BC=8 
A,B,C=map(Point,[(0,h),(-BC/2,0),(BC/2,0)])
B_ref=B.reflect(Line(C,C+Point(-1,1)))                                                          # Point(-1,1)は、Point(cos(rad(180-45),sin(rad(180-45))) でも
A    =Line(C,C+Point(-1,1)).parallel_line(B_ref).intersection(Line(Point(0,0),Point(0,1)))[0]   # 垂直二等分線でも
D    =Line(A,B).intersection(Line(C,C+Point(-1,1)))[0]
E    =Line(C,D).perpendicular_line(D).intersection(Line(A,C))[0]                                #;print(E)
print("#",Triangle(C,E,D).area)
print("#",Triangle(C,E,D).area.subs({BC:8}))
# 9*BC**2/32
# 18

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

sympyのweb上での実行方法

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

(テンプレート)

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

sympy のdoc

・いらないカモ。

ver0.1

ver1.1

・angle_between(l2) < Line
https://docs.sympy.org/latest/modules/geometry/lines.html#sympy.geometry.line.LinearEntity.angle_between

ver1.2

・reflect(line) < Entities
https://docs.sympy.org/latest/modules/geometry/entities.html#sympy.geometry.entity.GeometryEntity.reflect

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?