aboutsummaryrefslogtreecommitdiff
path: root/Semestr 3/anm/zad126.jl
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2021-10-05 21:49:54 +0200
committerFranciszek Malinka <franciszek.malinka@gmail.com>2021-10-05 21:49:54 +0200
commitc5fcf7179a83ef65c86c6a4a390029149e518649 (patch)
treed29ffc5b86a0d257453cedcf87d91a13d8bf3b0d /Semestr 3/anm/zad126.jl
parentf8a88b6a4aba1f66d04711a9330eaba49a50c463 (diff)
Duzy commit ze smieciami
Diffstat (limited to 'Semestr 3/anm/zad126.jl')
-rw-r--r--Semestr 3/anm/zad126.jl58
1 files changed, 0 insertions, 58 deletions
diff --git a/Semestr 3/anm/zad126.jl b/Semestr 3/anm/zad126.jl
deleted file mode 100644
index 02b0d31..0000000
--- a/Semestr 3/anm/zad126.jl
+++ /dev/null
@@ -1,58 +0,0 @@
-using Plots
-
-phi = pi / 3
-
-x0 = 0
-y0 = 0
-u0 = 100 * cos(phi)
-v0 = 100 * sin(phi)
-g = 9.81
-
-function iterate(x, y, u, v, h, k)
- xn = x + h * u
- yn = y + h * v
- un = u * (1 - h * k * sqrt(u * u + v * v))
- vn = v - h * (g + k * sqrt(u * u + v * v) * v)
- return (xn, yn, un, vn)
-end
-
-function getPoints(k, h, phi)
- x0 = 0
- y0 = 0
- u0 = 100 * cos(phi)
- v0 = 100 * sin(phi)
-
- x = x0
- y = y0
- u = u0
- v = v0
-
- X = Array{Float64}(undef, 0)
- Y = Array{Float64}(undef, 0)
- i = 1
- while y >= 0
- if (y < 0)
- return (X[1:1:i - 1], Y[1:1:i - 1])
- end
- append!(X, x)
- append!(Y, y)
- x, y, u, v = iterate(x, y, u, v, h, k)
- i += 1
- end
- println(x, " ", y)
- return (X, Y)
-end
-
-function plotArmata(K, phi, h)
- X, Y = getPoints(K[1], h, phi[1])
- p = plot(X, Y, label=string("k: ", (K[1]), " φ: ", string(phi[1])[1:1:5]); draw_arrow=true, aspect_ratio=:equal)
- for i in 2:length(K)
- X, Y = getPoints(K[i], h, phi[i])
- plot!(p, X, Y, label=string("k: ", (K[i]), " φ: ", string(phi[i])[1:1:5]), aspect_ratio=:equal)
- end
- xlabel!("Odległość [m]")
- ylabel!("Wysokość [m]")
- display(p)
-end
-
-# plotArmata([0.01, 0.012, 0.014, 0.016, 0.018, 0.2], 0.01) \ No newline at end of file