Pythonでわかる予習シリーズ理科5年

予習シリーズ理科についてPythonで理解しよう

https://www.python.jp/install/anaconda/windows/install.html
予習シリーズ
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/b4533afb-9939-e507-0e75-863b273eec2c.png)

https://openai-chatgpt.jp/
コードはコピーペーストしてチャットGPTに質問しよう
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/bde9bc47-464e-de2e-fc62-6889a3a1cc27.png)
ワニの表紙のPythonコードを作りました


熱
```
import matplotlib.pyplot as plt
#20℃、300gの水と、70℃、200gの水を混ぜると何℃になりますか。
A=20とB=300とC=70とD=200
(A×B+C×D)/(B+D)
 85°Cと360gの水を35℃にするには、10℃の水を何g混ぜればよいですか。
E=85とF=360とG=35とH=10
(E-G)×F÷(G-H)
95℃, 100gの水を25℃にするには、何℃の水を700g混ぜればよいですか。
a=95とb=100とc=25とd=700
c-(a-c)×b÷d
# 定数の値
A = 20
B = 300
C = 70
D = 200
E = 85
F = 360
G = 35
H = 10
a = 95
b = 100
c = 25
d = 700

# 式の計算
result1 = (A * B + C * D) / (B + D)
result2 = (E - G) * F / (G - H)
result3 = c - (a - c) * b / d

# 結果の出力
print("Result 1:", result1)
print("Result 2:", result2)
print("Result 3:", result3)

# プロット
plt.bar(['Result 1', 'Result 2', 'Result 3'], [result1, result2, result3])
plt.ylabel('Value')
plt.title('Results of Expressions')

# 数値を表示
for i, result in enumerate([result1, result2, result3]):
    plt.text(i, result, str(result), ha='center', va='bottom')

plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/b30b635d-6ed9-3650-0058-124a1f55f060.png)









第3回p30
密度×体積=重さ
```
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# Generate data
density = np.linspace(0.1, 1, 100)  # Density range in kg/m^3
volume = np.linspace(1, 10, 100)     # Volume range in m^3
density, volume = np.meshgrid(density, volume)
weight = density * volume             # Calculate weight in kg

# Plotting
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(density, volume, weight, cmap='viridis')

# Labels with units
ax.set_xlabel('Density (kg/m^3)')
ax.set_ylabel('Volume (m^3)')
ax.set_zlabel('Weight (kg)')

plt.show()

```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/b236510c-13d8-a262-69a4-d5ffa630ac85.png)




第4回p41　星の日周運動

```
import matplotlib.pyplot as plt
import numpy as np

# 角度をラジアンに変換する関数
def degrees_to_radians(degrees):
    return degrees * np.pi / 180

# 点を計算する関数
def calculate_points():
    points = []
    for n in range(13):
        x = np.cos(n * 30 * np.pi / 180)
        y = np.sin(n * 30 * np.pi / 180)
        points.append((x, y))
    return points

# 点をプロットする関数
def plot_points(points):
    x_values = [point[0] for point in points]
    y_values = [point[1] for point in points]
    plt.plot(x_values, y_values, 'bo')
    plt.title('Points on the Unit Circle')
    plt.xlabel('x')
    plt.ylabel('y')
    plt.grid(True)
    plt.axis('equal')
    plt.show()

# メイン関数
def main():
    points = calculate_points()
    plot_points(points)

if __name__ == "__main__":
    main()

```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/60dc1a1c-a8e3-5b91-721b-abf04e667cf8.png)
30度ずつプロットして円を12等分できることがわかる

第8回p75
```
import numpy as np
import matplotlib.pyplot as plt

# 点の座標
A = 3
B = 2
C = 2
D = 3

# ベクトルの定義
vec1 = np.array([-A, 0])
vec2 = np.array([0, -B])
vec3 = np.array([C, 0])
vec4 = np.array([0, -D])

# ベクトルの終点
vec1_end = np.array([0, 0]) + vec1
vec2_end = np.array([-A, 0]) + vec2
vec3_end = np.array([C, 0]) + vec3
vec4_end = np.array([C, 0]) + vec4

# プロット
plt.figure()
plt.quiver(0, 0, vec1[0], vec1[1], angles='xy', scale_units='xy', scale=1, color='r', label='Vector 1')
plt.quiver(-A, 0, vec2[0], vec2[1], angles='xy', scale_units='xy', scale=1, color='g', label='Vector 2')
plt.quiver(0, 0, vec3[0], vec3[1], angles='xy', scale_units='xy', scale=1, color='b', label='Vector 3')
plt.quiver(C, 0, vec4[0], vec4[1], angles='xy', scale_units='xy', scale=1, color='y', label='Vector 4')

# 軸の範囲設定
plt.xlim(-max(A, C) - 1, max(A, C) + 1)
plt.ylim(-max(B, D) - 1, 1)

# 軸ラベル
plt.xlabel('X')
plt.ylabel('Y')

# 目盛り
plt.xticks(np.arange(-max(A, C) - 1, max(A, C) + 2, 1))
plt.yticks(np.arange(-max(B, D) - 1, 2, 1))

# グリッド
plt.grid()

# 凡例
plt.legend()

# グラフ表示
plt.show()

# rightとleftの計算
right = A * B
left = C * D

# 結果表示
print("right =", right)
print("left =", left)
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/a8035128-2f88-219c-e08f-a90f8a07fc3f.png)

計算結果が表示される
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/538fcc51-dc18-fd13-75f9-6e1fd8816887.png)



第12回p113～114

100gの水に、25gの砂糖を溶かした砂糖水の濃さは何%ですか。
z=(x/(x+y))×100
zはパーセント
x=水
y=砂糖
```
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# Create grid
x = np.linspace(0.1, 10, 100)  # Range for x (water)
y = np.linspace(0.1, 10, 100)  # Range for y (sugar)
x, y = np.meshgrid(x, y)
z = (x / (x + y)) * 100  # Calculate z

# 3D plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z, cmap='viridis')

# Set axis labels
ax.set_xlabel('Water')
ax.set_ylabel('Sugar')
ax.set_zlabel('z (%)')

# Show the plot
plt.show()
```

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/dc2b87b5-d94c-038a-ddd7-5aae6850d748.png)


20%の食塩水を150gつくるには、何gの水に、何gの食塩を溶かせばよいですか

20%→x%
150g→yg
z=x×y÷100
zは食塩水の量
```
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# Define the range of values for x and y
x_values = np.linspace(0, 100, 100)  # Assuming x ranges from 0 to 100
y_values = np.linspace(0, 100, 100)  # Assuming y ranges from 0 to 100

# Create a meshgrid of x and y values
x, y = np.meshgrid(x_values, y_values)

# Calculate the corresponding values of z using the formula z = x * y / 100
z = x * y / 100

# Create a 3D plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Plot the surface
ax.plot_surface(x, y, z, cmap='viridis')

# Set labels for axes
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')

# Set title
ax.set_title('Volume of Saline Water (z)')

# Show the plot
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/974b14bf-3ab6-6c0f-1821-49910451988b.png)

20%の砂糖水100gと、8%の砂糖水200gを混ぜると、何%の砂糖水になりますか。
```
import matplotlib.pyplot as plt

# Define constants
A = 100
B = 20
C = 200
D = 8

# Calculate F
F = (B + D) * 100 / (A + C)

# Define vector coordinates
vectors = [
    (0, 0, -A, 0),  # Vector 1: from (0,0) to (-A,0)
    (-A, 0, -A, B),  # Vector 2: from (-A,0) to (-A,B)
    (0, 0, C, 0),  # Vector 3: from (0,0) to (C,0)
    (C, 0, C, D),  # Vector 4: from (C,0) to (C,D)
    (-A, F, C, F)  # Vector 5: from (-A,F) to (C,F)
]

# Plotting the vectors
for vector in vectors:
    plt.plot([vector[0], vector[2]], [vector[1], vector[3]], marker='o')

# Set plot limits and labels
plt.xlim(-A - 50, C + 50)
plt.ylim(min(0, F) - 10, max(B, D, F) + 10)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('Plot of Vectors')
plt.grid(True)
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/fb3a8631-aac3-c27e-32a1-1fcc3668ffe7.png)
面積図をベクトルで描写した
もっと上手いやり方はあるはず

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/9920046a-1e92-5175-7bf4-702f47941150.png)
イメージの面積図



20%の食塩水100gを5%にうすめるには、何gの水を加えればよいですか。
```


# 定義された変数
A = 100
B = 20
D = 5
C = A * (B - D) / D

# ベクトルの始点と終点を定義
vectors = [
    ((0, 0), (-A, 0), 'r'),       # ベクトル1 (赤)
    ((-A, 0), (-A, B), 'g'),      # ベクトル2 (緑)
    ((0, 0), (C, 0), 'b'),        # ベクトル3 (青)
    ((C, 0), (C, D), 'c'),        # ベクトル4 (シアン)
    ((-A, D), (C, D), 'm')        # ベクトル5 (マゼンタ)
]

# プロット
for start, end, color in vectors:
    plt.quiver(start[0], start[1], end[0] - start[0], end[1] - start[1], color=color, angles='xy', scale_units='xy', scale=1)

# プロットの設定
plt.xlim(-110, 310)  
plt.ylim(-1, 33)
plt.gca().set_aspect('equal', adjustable='box')
plt.xlabel('X-axis') 
plt.ylabel('Y-axis')  
plt.title('Vector Plot')

# グリッドを追加
plt.grid()

# 表示
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/069c8339-b01b-c17c-eba6-83ef35703fe1.png)
ベクトルが潰れてしまった
水は濃度0％として扱う
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/93b7678a-3dc5-83cf-cf6a-0f6ffa8abfd5.png)


125m^3の水に、35%の濃い塩酸を加えて、10%のうすい塩酸をつくろうと思います。濃い 塩酸を何加えればよいですか。ただし、水1cm^3は1gで、35%の塩酸1gの体積は0.85cm^3です。
A = 125
B = 10
A cm^3→125gの水
方程式をたてると
(x / (A + x)) * 100=B
となるが、分数にxが入ることを回避するために面積図で解く
ちなみに(x / (A + x))は双曲線関数
```
import numpy as np
import matplotlib.pyplot as plt

# 定数を定義
A = 125
B = 10

# 関数を定義
def f(x):
    return (x / (A + x)) * 100

# y=Bの水平線を作成
y_horizontal = np.full_like(np.arange(0, 150, 0.1), B)

# グラフを描画
x_values = np.arange(0, 150, 0.1)
plt.plot(x_values, f(x_values), label='f(x)')
plt.plot(x_values, y_horizontal, label='y=B', linestyle='--')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()

# 交点を見つける
intersection_points = np.argwhere(np.diff(np.sign(f(x_values) - y_horizontal))).flatten()
for point in intersection_points:
    plt.plot(x_values[point], f(x_values[point]), 'ro')
    plt.text(x_values[point], f(x_values[point]), f'({x_values[point]:.2f}, {f(x_values[point]):.2f})')

plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/a44630d9-633e-52a0-3655-65297a3b8e1e.png)
描写すると高校3年生の問題になる

```
import matplotlib.pyplot as plt

# 定数の設定
A = 125
B = 10
D = 35
C = (A * B) / (D - B)
x = 50

# ベクトルの始点と終点を定義
vectors = [
    ((0, 0), (-A, 0), 'red'),        # ベクトル1: 赤色
    ((0, 0), (C, 0), 'green'),       # ベクトル2: 緑色
    ((C, 0), (C, D), 'blue'),        # ベクトル3: 青色
    ((-A, B), (C, B), 'purple')      # ベクトル4: 紫色
]

# プロット
for i, (start, end, color) in enumerate(vectors):
    plt.arrow(start[0], start[1], end[0] - start[0], end[1] - start[1],
              head_width=5, head_length=5, fc=color, ec=color)
    plt.text((start[0] + end[0]) / 2, (start[1] + end[1]) / 2, f"v{i+1}", fontsize=12)

# グラフの設定
plt.xlim(-A - 20, C + 20)
plt.ylim(-5, D + 20)
plt.gca().set_aspect('equal', adjustable='box')
plt.xlabel('X')
plt.ylabel('Y')
plt.title('Vectors')
plt.grid(True)
plt.axhline(0, color='black',linewidth=0.5)
plt.axvline(0, color='black',linewidth=0.5)
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/0ccc6208-7c08-373c-b98a-6edb4b1008cd.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/fdffd211-11cd-2f18-8872-8d6886553f0b.png)
面積図
1g:0.85cm^3=Cg :ycm^3
0.85×C=1×y
y=0.85×C/1で答えが求められる
予習シリーズの解説が特にわかりにくい部分である



第13回p121　周期Tの波
```
import numpy as np
import matplotlib.pyplot as plt

# サンプリングする時間の範囲を設定
t = np.linspace(0, 10, 1000)  # 0から10の範囲で1000点サンプリング

# 周期Tのサイン波
T = 2  # 周期
sin_wave_T = np.sin(2 * np.pi * t / T)

# 振幅fのサイン波
f = 3  # 振幅
sin_wave_f = f * np.sin(2 * np.pi * t)

# プロット
plt.figure(figsize=(10, 5))
plt.subplot(2, 1, 1)
plt.plot(t, sin_wave_T)
plt.title('Periodic Sinusoidal Wave with T = {}'.format(T))
plt.xlabel('Time')
plt.ylabel('Amplitude')

plt.subplot(2, 1, 2)
plt.plot(t, sin_wave_f)
plt.title('Sinusoidal Wave with Amplitude = {}'.format(f))
plt.xlabel('Time')
plt.ylabel('Amplitude')

plt.tight_layout()
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/01be3165-5f53-657d-d169-a86356e21495.png)
周波数と周期は波(サイン波)で使われる

振り子の周期
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/831a5d50-ec56-6b62-b0cb-bce26264e7cb.png)



```

```

```
import numpy as np
import matplotlib.pyplot as plt

# Function to calculate l(T) = 25 * T^2
def l_T(T):
    return 25 * T**2

# Function to calculate T(l) = sqrt(l / 25)
def T_l(l):
    return np.sqrt(l / 25)

# Generate values of T for plotting l(T) = 25 * T^2
T_values = np.linspace(0, 10, 100)  # Values of T from 0 to 10 seconds
l_values = l_T(T_values)  # Calculate corresponding l values

# Generate values of l for plotting T(l) = sqrt(l / 25)
l_values_inverse = np.linspace(0, 500, 100)  # Values of l from 0 to 500 cm
T_values_inverse = T_l(l_values_inverse)  # Calculate corresponding T values

# Plot l(T) = 25 * T^2
plt.figure(figsize=(10, 5))
plt.subplot(1, 2, 1)
plt.plot(T_values, l_values)
plt.xlabel('T (seconds)')
plt.ylabel('l (cm)')
plt.title('l(T) = 25 * T^2')

# Plot T(l) = sqrt(l / 25)
plt.subplot(1, 2, 2)
plt.plot(l_values_inverse, T_values_inverse)
plt.xlabel('l (cm)')
plt.ylabel('T (seconds)')
plt.title('T(l) = sqrt(l / 25)')

plt.tight_layout()  # Adjust layout to prevent overlapping
plt.show()


```

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/0ac878cf-3064-4b4c-cab5-79998f9f30c4.png)


```py



import numpy as np
import matplotlib.pyplot as plt

# Constants
g = 9.8  # Acceleration due to gravity (m/s^2)
pi = np.pi  # Value of pi

# Define the range of T (e.g., from 0 to 10 seconds, with 0.1-second intervals)
T_values = np.linspace(0, 10, 100)  # Array of 100 points from 0 to 10 seconds

# Calculate l(T)
l_values = (g / (2 * pi)**2) * T_values**2

# Plotting
plt.plot(T_values, l_values, label='l(T)')
plt.xlabel('T (seconds)')
plt.ylabel('l (centimeters)')
plt.title('Relationship of l(T) with T')
plt.grid(True)
plt.legend()
plt.show()


```



```
import numpy as np
import matplotlib.pyplot as plt

# 重力加速度
g = 9.81  # m/s^2
# 振り子の周期の値の範囲
T_values = np.linspace(0.1, 10, 100)  # 0.1から10の範囲で100個の値を生成

# Lを計算
L_values = (g / (4 * np.pi ** 2)) * T_values ** 2

# プロット
plt.plot(T_values, L_values)
plt.xlabel('Period of pendulum (s)')
plt.ylabel('Length of pendulum (m)')
plt.title('Length of Pendulum vs Period of Pendulum')
plt.grid(True)
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/bc88a715-5379-92c1-6aa3-5c54d464cf56.png)

角度が微小のときのみ成り立つ式であった
https://www.youtube.com/watch?v=n-wpASaO3oE


p125 斜面を転がる球

https://www2.nhk.or.jp/school/watch/clip/?das_id=D0005301103_00000

```
import numpy as np
import matplotlib.pyplot as plt

# 重力加速度
g = 9.81

# 速度の範囲を設定
v = np.linspace(0, 20, 100)

# 高さを計算
h_kinetic = 0.5 * v**2 / g
h_potential = v**2 / (2 * g)

# プロット
plt.plot(v, h_potential, label='h')
plt.xlabel('Velocity (m/s)')
plt.ylabel('Height (m)')
plt.title('Relationship between Velocity and Height')
plt.legend()
plt.grid(True)
plt.show()

```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/4ed8a0cd-a4e7-a4fc-7fed-9894457f3c68.png)



第17回　p159
```
import numpy as np
import matplotlib.pyplot as plt

A = 450
B = 14

# 1. yは0からBまでプロット
x1 = np.arange(0, B+1, 1)
y1 = (A/B) * x1

# 2. Bから先はy=Aをずっとプロット
x2 = np.arange(B, 100, 1)
y2 = np.full_like(x2, A)

# プロット
plt.plot(x1, y1, label='y = (A/B)x')
plt.plot(x2, y2, label='y = A')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.title('Plot of y = (A/B)x and y = A')
plt.grid(True)
plt.show()



```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/e9d45298-4d00-dff1-454e-3d22758ad594.png)


100=k(2.0)^2
k=25

l(T)=25×T^2
Tは秒、lはcm

T(l)= √(l/25)
Tは秒、lはcm

```py

import numpy as np
import matplotlib.pyplot as plt

# Function to calculate l(T) = 25 * T^2
def l_T(T):
    return 25 * T**2

# Function to calculate T(l) = sqrt(l / 25)
def T_l(l):
    return np.sqrt(l / 25)

# Generate values of T for plotting l(T) = 25 * T^2
T_values = np.linspace(0, 10, 100)  # Values of T from 0 to 10 seconds
l_values = l_T(T_values)  # Calculate corresponding l values

# Generate values of l for plotting T(l) = sqrt(l / 25)
l_values_inverse = np.linspace(0, 500, 100)  # Values of l from 0 to 500 cm
T_values_inverse = T_l(l_values_inverse)  # Calculate corresponding T values

# Plot l(T) = 25 * T^2
plt.figure(figsize=(10, 5))
plt.subplot(1, 2, 1)
plt.plot(T_values, l_values)
plt.xlabel('T (seconds)')
plt.ylabel('l (cm)')
plt.title('l(T) = 25 * T^2')

# Plot T(l) = sqrt(l / 25)
plt.subplot(1, 2, 2)
plt.plot(l_values_inverse, T_values_inverse)
plt.xlabel('l (cm)')
plt.ylabel('T (seconds)')
plt.title('T(l) = sqrt(l / 25)')

plt.tight_layout()  # Adjust layout to prevent overlapping
plt.show()

```
第17回

x=加えた過酸化水素水体積cm^3
y=発生酸素体積cm^3
k=傾き=108/10
y=kx

```py
import matplotlib.pyplot as plt
import numpy as np

# Given data
k = 108 / 10  # Slope
x = np.array([1, 2, 3, 4, 5])  # Volume of added hydrogen peroxide solution (cm^3)
y = k * x  # Volume of evolved oxygen (cm^3), y = kx

# Plotting
plt.figure(figsize=(8, 6))
plt.plot(x, y, marker='o', linestyle='-', color='b')
plt.title('Plot of Volume of Evolved Oxygen vs. Volume of Added Hydrogen Peroxide')
plt.xlabel('Volume of Added Hydrogen Peroxide (cm$^3$)')
plt.ylabel('Volume of Evolved Oxygen (cm$^3$)')
plt.grid(True)
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3759109/77881643-18f9-c43a-61bc-c7df8cf20299.png)




```py
import matplotlib.pyplot as plt

# Data points
data_points = [(0, 0), (10, 11), (16, 17)]

# Extract x and y values from data points
x = [point[0] for point in data_points]
y = [point[1] for point in data_points]

# Plotting the data points
plt.figure(figsize=(8, 6))
plt.plot(x, y, marker='o', linestyle='-')

# Adding arrows with annotations
for i in range(len(data_points) - 1):
    dx = x[i + 1] - x[i]
    dy = y[i + 1] - y[i]
    plt.arrow(x[i], y[i], dx, dy, color='r', head_width=0.5, head_length=0.5)
    plt.annotate(f'{dy}/{dx}', (x[i] + dx * 0.5, y[i] + dy * 0.5), fontsize=10)

# Setting plot title and labels
plt.title('Relationship between Calcium Carbonate Weight and Remaining Solid Weight')
plt.xlabel('Weight of Calcium Carbonate (g)')
plt.ylabel('Remaining Solid Weight (g)')

# Display the plot
plt.grid(True)
plt.show()

```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3759109/8ec5b976-4f3e-8e35-7183-4f03dba6df45.png)




第19回　p176 地球の大きさ
```
import matplotlib.pyplot as plt
import numpy as np

A = 450
pi = 3
B = 4
C = A / (B / 360)
D = C / 3

# 原点を中心とし、半径がDの円をプロット
theta = np.linspace(0, 2 * np.pi, 100)
circle = D * np.exp(1j * theta)
plt.plot(circle.real, circle.imag, label='Circle')

# 点D×exp(i×0×(2π／360))をプロット
point1 = D * np.exp(1j * 0 * (2 * np.pi / 360))
plt.plot(point1.real, point1.imag, 'ro', label='Point 1')

# 点D×exp(i×B×(2π／360))をプロット
point2 = D * np.exp(1j * B * (2 * np.pi / 360))
plt.plot(point2.real, point2.imag, 'bo', label='Point 2')

plt.xlabel('Real')
plt.ylabel('Imaginary')
plt.title('Complex Plane')
plt.axis('equal')
plt.legend()
plt.grid(True)
plt.show()
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3760770/23ecd32b-fe4c-879b-651c-c0d3eb983050.png)