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?

大人向け。正方形の中に直角三角形「【数学練習】120」様を、sympy で計算と作図。

0
Last updated at Posted at 2026-11-10

・ver1.2 ?普通はコレだと思います。

オリジナル

算数・数学ちゃんねる 様 (0:00〜4:05) いつもお世話になっております。
↓【数学練習】120
https://youtu.be/zpvU4FKOp4s

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

ver0.1

・先生の丸写しです。ステキです。ソースコード内で、図形の証明は省略です。
・補助線無しでした。

# ver0.1
from sympy import *
var('a', real=True, positive=True)
a=solve(Eq(sqrt(a**2+(2*a)**2)*sqrt(a**2+(a/2)**2)/2,5),a)[0]
print("#",(a*2)**2)
# 16

sympyで

ver1.1

・2元連立方程式です。
・記号は、左下から反時計回りに一筆書きです。

# ver1.1
from sympy import *
var('AB AE', real=True, positive=True)
A,B,C,D=map(Point,[(0,0),(AB,0),(AB,AB),(0,AB)])
E      =Point(AE,0)
F      =B.midpoint(C)
print("#",solve([Eq(Triangle(D,E,F).area,5),  \
                 Eq((D-F).dot(F-E)      ,0)], \
                [AB,AE])[0][0]**2)
# 16

ver1.2

・(再) ver1.2 ?普通はコレだと思います。
・Line の.perpendicular_line で交点計算で方程式です。

# ver1.2
from sympy import *
var('AB', real=True, positive=True)
A,B,C,D=map(Point,[(0,0),(AB,0),(AB,AB),(0,AB)])
F      =B.midpoint(C)
E      =Line(A,B).intersection(Line(D,F).perpendicular_line(F))[0]   #;print(E)
print("#",solve(Eq(Triangle(D,E,F).area,5),AB)[0]**2)  
# 16

(本日の)Gemini 先生へ。作図。

PNG図 のみ出力して下さい。各辺の長さ、面積を厳密値で追加表示して下さい。
(ver1.1 ソースコード表示省略)

・今回、matplotlib 経由なしです。再実行です。
 上記が、直角が直角に見えません。直して
image.png

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

sympyのweb上での実行方法

(SymPy Live Shellで。よりも)
ソースコードの実行、解説は、私よりGemini先生へのソースコードの丸投げがおすすめです。質問の追加はいくらでも。「教えて」
モーダル対応?「実行して」。「作図して」「問題文章の丸投げ」いい時代です。
AI先生に、今はテキスト渡しです。urlを渡して、「教えて」の時代が来ているカモ。音声で

(テンプレート)

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

Qiita 内

sympy のdoc

・いらないカモ。

ver0.1

ver1.1

ver1.2

・perpendicular_line < Line
https://docs.sympy.org/latest/modules/geometry/lines.html#sympy.geometry.line.LinearEntity.perpendicular_line

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?