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?

大人用です。半円「高校入試チャレンジ問題 a²+b²=?」様を、計算はsympyで作図は手抜きのつもりでした。

0
Posted at

オリジナル

YUUU0123 様 (0:00〜4:12) いつもお世話になっております。
↓高校入試チャレンジ問題 a²+b²=?
https://youtu.be/d2dCDyKD71o

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

ver0.1

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

# ver0.1
from sympy import *
var('a,b,x,y',real=True,positive=True)
eq1=Eq((Rational(2,3)*x)**2+(Rational(1,3)*y)**2,b **2)
eq2=Eq((Rational(1,3)*x)**2+(Rational(2,3)*y)**2,a **2)
eq3=Eq( x**2+y**2                               ,15**2)
sol=solve([eq1,eq2,eq3],[a,b,x])
print("#",sol[0][0]**2+sol[0][1]**2)
# 125

>この問題ではAB、BCの長さに拘らず、a²+b²の値は常に一定(=5³)ということですね。
Youtubeのコメント様。ステキ。

いつもの sympyで

ver1.1

・できないかと思いました。cos(θ)、sin(θ)
・点C Point(-7.5,0)がヨカッタかも。

# ver1.1
from sympy import *
var('θ',real=True,positive=True)
CE=ED=DA=5
C,E,D,A=map(Point,[(0,0),(CE,0),(CE+ED,0),(CE+ED+DA,0)])
O      =C.midpoint(A)
r      =O.distance(A) 
B      =O+(r*cos(θ),r*sin(θ))
print("#",(D.distance(B)**2+E.distance(B)**2).simplify())
# 125

(続けて)Gemini先生へ

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

・イロイロやった結果です。

image.png

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

sympyのweb上での実行方法

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

(テンプレート)

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

sympy のdoc

・いらないカモ。

ver0.1

ver1.1

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?