30 lines
624 B
Python
30 lines
624 B
Python
import math
|
||
import matplotlib.pyplot as plt
|
||
|
||
|
||
H = 1
|
||
g = 10
|
||
u0 = (2 * g * H) ** 0.5
|
||
alpha = 0.2
|
||
T = 2 * u0 / g
|
||
|
||
points_x = []
|
||
points_y = []
|
||
for t in range(200):
|
||
t = t / 100
|
||
points_x.append((u0 * math.sin(alpha) * t + g * math.sin(alpha) * t ** 2 / 2) * math.sin(alpha))
|
||
points_y.append(H + (u0 * math.cos(alpha) * (t % T) - g * math.cos(alpha) * (t % T)**2 / 2) * math.cos(alpha))
|
||
|
||
print(points_y)
|
||
|
||
plt.figure(figsize=(10, 6))
|
||
|
||
plt.scatter(points_x, points_y, c="blue", label="Точки", alpha=0.6)
|
||
|
||
plt.xlabel("x")
|
||
plt.ylabel("y")
|
||
plt.title("График с точками")
|
||
plt.legend()
|
||
plt.grid()
|
||
|
||
plt.show() |