## 2019年7月25日木曜日

### 数学 - Python - 図形と数や式の関係 - 平面図形と式 - 円と軌跡 - 軌跡の方程式 - 直線、内分点、平行

1. $\begin{array}{l}{\left(\sqrt{{\left(x+2\right)}^{2}+{y}^{2}}\right)}^{2}-{\left(\sqrt{{\left(x-2\right)}^{2}+{y}^{2}}\right)}^{2}=16\\ {x}^{2}+4x+4+{y}^{2}-{x}^{2}+4x-4-{y}^{2}=16\\ 8x=16\\ x=2\end{array}$

2. Q、 P の座様とそれぞれ、

$\begin{array}{l}Q=\left(u,v\right)\\ P=\left(x,y\right)\end{array}$

とおくと、

$\begin{array}{l}3u+4u-10=0\\ x=\frac{2u}{2+1}\\ y=\frac{-1+2v}{2+1}\\ u=\frac{3}{2}x\\ v=\frac{3y+1}{2}\\ 3·\frac{3}{2}x+4·\frac{3y+1}{2}-10=0\\ 9x+12y+4-20=0\\ 9x+12y-16=0\end{array}$

3. $\begin{array}{l}{x}^{2}+{y}^{2}+{\left(x-1\right)}^{2}+{y}^{2}=2\left({\left(x-2\right)}^{2}+{y}^{2}\right)\\ 2{x}^{2}+2{y}^{2}-2x+1=2{x}^{2}-8x+8+2{y}^{2}\\ 6x=7\\ x=\frac{7}{6}\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, plot, solve, sqrt, Rational

print('28.')

x = symbols('x')
ys = [-1,
(-3 * x + 10) / 4,
(-9 * x + 16) / 12]

colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

p = plot(*ys,
ylim=(-10, 10),
legend=True,
show=False)

for s, color in zip(p, colors):
s.line_color = color

p.show()
p.save('sample28.png')


C:\Users\...>py sample28.py
28.

C:\Users\...>