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?

メネラウスの定理。大人用「2024 青森公立大学前期【4】」(その1/4)をAI先生へ。sympyで。

Last updated at Posted at 2025-11-01

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

・mathjax をChatGPT先生へ、丸投げです。

オリジナル

問題文(mathjax テキスト形式)

↓2024 青森公立大学 前期MathJax【4】
https://mathexamtest.web.fc2.com/2024/202411051/2024110510100mj.html#top-0106
大学入試数学問題集成 様へ。いつもお世話になっております。
https://mathexamtest.web.fc2.com/daigakubetumj/11051index.html#y2024

web

数学入試問題 様へ。いつもお世話になっております。
https://kamelink.com/blog/2024/04/18/4-6-24-aomorikoritsudai-4/

sympyのweb上での実行方法

SymPy Live Shellで。
https://qiita.com/mrrclb48z/items/00dd08b0317069be9342#web%E4%B8%8A%E3%81%AE%E5%AE%9F%E8%A1%8C%E6%96%B9%E6%B3%95sympy-live-shell%E3%81%A7

(本日の)ChatGPT先生へ

質問

右の図が不要でした。

https://mathexamtest.web.fc2.com/2024/202411051/2024110510100mj.html
上の行のurlの【4】を解いて下さい。  

そのページにアクセスしようとしたらサーバーエラー(503)で中身を取得できませんでした。申し訳ないです。
【お願い】該当ページの「問題【4】」の本文をここに貼っていただけますか?(画像でも可)貼っていただければ、その場で解いて説明します。

<p class="slevel"><span 
class="qnum">【4】</span> 三角形<math>
<mspace width=".2em"></mspace><mi>ABC</mi><mspace width=".2em"></mspace>
</math>において,<math>
<mrow><mi>AB</mi><mo>=</mo><mn>8</mn><mspace width=".2em"></mspace>
<mtext>,</mtext></mrow>
</math><math>
<mrow><mi>CA</mi><mo>=</mo><mn>5</mn><mspace width=".2em"></mspace>
<mtext>,</mtext></mrow>
</math><math>
<mrow><mi>&ang;BAC</mi><mo>=</mo><mn>60</mn><mo>&it;</mo>
<mi mathvariant="normal" class="MathML-Unit">&deg;</mi></mrow><mspace width=".2em"></mspace>
</math>とする.また,右の図のように,辺<math>
<mspace width=".2em"></mspace><mi>AB</mi><mspace width=".2em"></mspace>
</math>上に<math>
<mspace width=".2em"></mspace><mrow><mi>AD</mi><mo>=</mo><mn>3</mn>
</mrow><mspace width=".2em"></mspace>
</math>となる点<math>
<mspace width=".2em"></mspace><mi mathvariant="normal">D</mi><mspace width=".2em"></mspace>
</math>をおき,辺<math>
<mspace width=".2em"></mspace><mi>CA</mi><mspace width=".2em"></mspace>
</math>上に<math>
<mspace width=".2em"></mspace><mrow><mi>CE</mi><mo>=</mo><mn>2</mn>
</mrow><mspace width=".2em"></mspace>
</math>となる点<math>
<mspace width=".2em"></mspace><mi mathvariant="normal">E</mi><mspace width=".2em"></mspace>
</math>をおく.次に線分<math>
<mspace width=".2em"></mspace><mi>BE</mi><mspace width=".2em"></mspace>
</math>と線分<math>
<mspace width=".2em"></mspace><mi>CD</mi><mspace width=".2em"></mspace>
</math>の交点を<math>
<mspace width=".2em"></mspace><mi mathvariant="normal">P</mi><mspace width=".2em"></mspace>
</math>とし,線分<math>
<mspace width=".2em"></mspace><mi>AP</mi><mspace width=".2em"></mspace>
</math>の延長と辺<math>
<mspace width=".2em"></mspace><mi>BC</mi><mspace width=".2em"></mspace>
</math>との交点を<math>
<mspace width=".2em"></mspace><mi mathvariant="normal">F</mi><mspace width=".2em"></mspace>
</math>とする.</p>
<p class="s1level">問題1 <math>
<mrow><mi>AP</mi><mo>:</mo><mi>PF</mi></mrow><mspace width=".2em"></mspace>
</math>を求めよ.</p>
<p class="s1level">問題2 三角形<math>
<mspace width=".2em"></mspace><mi>DEF</mi><mspace width=".2em"></mspace>
</math>の面積を求めよ.
</p><div class="rclear"></div>

(解説解答を省略)

sympy のソースコードを教えて下さい。結果も表示して下さい。

回答

# ver1.0  三角形ABCで AB=8, CA=5, ∠BAC=60°, AD=3, CE=2
from sympy import *

# 角度と変数
deg = pi/180
A = Point(0, 0)
C = Point(5, 0)
B = Point(8*cos(60*deg), 8*sin(60*deg))

# 点 D, E
D = A + (3/8)*(B - A)
E = C + (2/5)*(A - C)

# 交点 P : BE ∩ CD
P = Line(B, E).intersection(Line(C, D))[0]

# 交点 F : APの延長と BC の交点
F = Line(A, P).intersection(Line(B, C))[0]

# 比 AP : PF
AP = A.distance(P)
PF = P.distance(F)
ratio = simplify(AP / PF)

# 面積 [DEF]
S_DEF = abs(Polygon(D, E, F).area)

print("A =", A)
print("B =", B)
print("C =", C)
print("D =", D)
print("E =", E)
print("P =", P)
print("F =", F)
print("AP : PF =", ratio, "", f"{ratio.evalf():.5f}")
print("三角形DEFの面積 =", simplify(S_DEF))
print("数値 =", S_DEF.evalf())

🔹 実行結果(SymPy計算結果)

A = Point2D(0, 0)
B = Point2D(4, 4*sqrt(3))
C = Point2D(5, 0)
D = Point2D(3/2, 3*sqrt(3)/2)
E = Point2D(3, 0)
P = Point2D(99/31, 24*sqrt(3)/31)
F = Point2D(33/7, 8*sqrt(3)/7)
AP : PF = 21/10 → 2.1
三角形DEFの面積 = 15*sqrt(3)/7
数値 = 3.7080992435478315
作図をお願いします。

image.png

Gemini先生へ

copilot先生へ

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

(テンプレート)

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

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?