Skip to content

Instantly share code, notes, and snippets.

@JohannesNE
Created December 2, 2021 20:37
Show Gist options
  • Save JohannesNE/3b892bc7d47159112c1a95845812bc94 to your computer and use it in GitHub Desktop.
Save JohannesNE/3b892bc7d47159112c1a95845812bc94 to your computer and use it in GitHub Desktop.
Draw a lot of tangets to a sine function
using Plots, Colors
f = sin
f´ = cos
p = plot(xlim = [-2pi, 7pi],
ylim = [-6,6],
lw= 0,
axis = nothing, border = :none)
for i in 0:0.01:5pi
p = plot!(p, x -> f´(i)*(x-i)+f(i),
color = RGB(i/5pi, ((1+i)%5pi)/5pi, 0.5),
alpha = 0.1, leg=false)
end
p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment