import Projectile as prj
import matplotlib.pyplot as plt
import math
p1 = prj.Projectile()
p1.init(30, 0, 0, 45, 1.22, 1, 1, 0.001, 0.01)
x1,y1 = p1.range()
plt.plot(x1,y1)
plt.xlabel("x [m]")
plt.ylabel("y [m]")
plt.title("Putanja kosog hica [Euler]")
plt.show()
p2 = prj.Projectile()
p2.init(30, 0, 0, 45, 1.22, 1, 1, 0.001, 0.01)
x2,y2 = p2.rangeRungeKutta()
plt.plot(x2,y2, c="r")
plt.xlabel("x [m]")
plt.ylabel("y [m]")
plt.title("Putanja kosog hica [Runge-Kutta]")
plt.show()
p3 = prj.Projectile()
p3.init(30, 0, 0, 45, 1.22, 1, 1, 0.001, 0.01)
x3,y3 = p3.range()
p4 = prj.Projectile()
p4.init(30, 0, 0, 45, 1.22, 1, 1, 0.001, 0.01)
x4,y4 = p4.rangeRungeKutta()
plt.plot(x3,y3,c="r")
plt.plot(x4,y4,c="b")
plt.xlabel("x [m]")
plt.ylabel("y [m]")
plt.title("Usporedba putanje kosog hica\n Eulera i Runge-Kutta")
plt.legend(["Euler", "Runge-Kutta"])
plt.show()
