Created
August 28, 2021 22:23
-
-
Save jstrube/df26cc213ff2c24bd83a2c70e145a355 to your computer and use it in GitHub Desktop.
Plotting the ZVTop algorithm on three tracks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GLMakie | |
const σT = 0.3 | |
function tube(x0, κ, ϕ, x, y) | |
exp(-0.5*(x*cos(ϕ) + y*sin(ϕ) - x0 - κ*(y*cos(ϕ) - x*sin(ϕ))^2)^2 / σT^2) | |
end | |
f1(x, y) = tube(0, 0.01, 1.05, x, y) | |
f2(x, y) = tube(0.1, 0.005, 0, x, y) | |
f3(x, y) = tube(-0.1, 0.01, 2.8, x, y) | |
d1 = [f1(x, y) for x=-5:0.1:5, y=-10:0.1:10] | |
d2 = [f2(x, y) for x=-5:0.1:5, y=-10:0.1:10] | |
d3 = [f3(x, y) for x=-5:0.1:5, y=-10:0.1:10] | |
surface(collect(-5:0.1:5), collect(-10:0.1:10), d1) | |
surface!(collect(-5:0.1:5), collect(-10:0.1:10), d2) | |
surface!(collect(-5:0.1:5), collect(-10:0.1:10), d3) | |
overlap(x, y) = f1(x,y) + f2(x,y) + f3(x,y) - (f1(x,y)^2 + f2(x,y)^2 + f3(x,y)^2)/ (f1(x,y) + f2(x,y) + f3(x,y)) | |
d4 = [overlap(x, y) for x=-5:0.1:5, y=-10:0.1:10] | |
surface(collect(-5:0.1:5), collect(-10:0.1:10), d4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a Julia translation of the Maple worksheet tubePlotting.mw