Julia-arrows

using CairoMakie

f = Figure(resolution = (400, 400))

Axis(f[1, 1], backgroundcolor = "black")

xs = LinRange(0, pi, 20)

ys = LinRange(0, 2pi, 20)

us = [2sin(x) * cos(y) for x in xs, y in ys]

vs = [-cos(x) * 2sin(y) for x in xs, y in ys]

strength = vec(sqrt.(us .^ 2 .+ vs .^ 2))

arrows!(xs, ys, us, vs, arrowsize = 10, lengthscale = 0.3,

    arrowcolor = strength, linecolor = strength)

f


你可能感兴趣的:(Julia-arrows)