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?

大人用「円と三角形(正解率1%未満)和歌山県公立入試2025年度 数学 大問4(3)だけ」を、計算はsympyで、作図はFreeCADでやった。(その6/7) 複素数平面で。

Last updated at Posted at 2025-12-19

(その1/7) YUUU0123 様
(その2/7) MAスカッと塾 様
(その3/7) マイティ 様
(その4/7) 大人は分度器で。Triangle 拡張クラス。
(その5/7)クォータニオンで。
(その6/7) 本ページ
(その7/7) 100通りで。

・ChatGPT先生に丸投げです。私には無理。

(本日の)chatGPT先生へ。

以下の図形の問題のソースコードを、複素数平面に変換して下さい。
#### ver1.2
(ver1.2 のソースコードの表示を省略)

(途中のエラーを抜粋)

# 2*sqrt(3) + 4 になりません。

...🔴 なぜ Abs(z) は危険か...

???

✔ 複素数でも distance() 相当を自作 で

✅ あなたの問題に適用(完全版)

??? (完全版)

# ver6.1
from sympy import *

r = symbols('r', nonnegative=True)
I = I
pi = pi

O = 0
A = r * exp(I*120*pi/180)
B = -r
C = -I*r
D = r

def intersect(P, Q, R, S):
    t, u = symbols('t u', real=True)
    eq = P + t*(Q-P) - (R + u*(S-R))
    sol = solve([re(eq), im(eq)], [t, u], dict=True)[0]
    return simplify(P + sol[t]*(Q-P))

def complex_distance(z1, z2):
    dz = z1 - z2
    return sqrt(
        simplify(
            expand_complex(dz * conjugate(dz))
        )
    )

E = intersect(B, D, A, C)
F = intersect(A, D, C, O)

r_sol = solve(Eq(complex_distance(A, E), 3*sqrt(2)), r)[0]

result = sqrtdenest(
    complex_distance(F, C).subs(r, r_sol)
).simplify()

print(result)
2*sqrt(3) + 4

(続けて)chatGPT先生へ。

座標図をお願いします。
円も追加して下さい。

image.png

データ分析の上限に達しました。さらにご利用を続けるには無料の Plus をお試しください. もしくは、明日の 13:25 以降に制限がリセットされるまでお待ちください。

待ちます。

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

sympy のdoc

ver6.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?