updates
This commit is contained in:
@@ -229,13 +229,24 @@ function secant_line_tangent_line_graph(n)
|
||||
m = (f(c+h) - f(c))/h
|
||||
|
||||
xs = range(0, stop=pi, length=50)
|
||||
plt = plot(f, 0, pi, legend=false, size=fig_size)
|
||||
fig_size=(800, 600)
|
||||
plt = plot(f, 0, pi, legend=false, size=fig_size,
|
||||
line=(2,),
|
||||
axis=([],false),
|
||||
ylims=(-.1,1.5)
|
||||
)
|
||||
plot!([0, 1.1* pi],[0,0], line=(3, :black))
|
||||
plot!([0, 0], [0,2*1], line=(3, :black))
|
||||
|
||||
plot!(plt, xs, f(c) .+ cos(c)*(xs .- c), color=:orange)
|
||||
plot!(plt, xs, f(c) .+ m*(xs .- c), color=:black)
|
||||
scatter!(plt, [c,c+h], [f(c), f(c+h)], color=:orange, markersize=5)
|
||||
|
||||
plot!(plt, [c, c+h, c+h], [f(c), f(c), f(c+h)], color=:gray30)
|
||||
annotate!(plt, [(c+h/2, f(c), text("h", :top)), (c + h + .05, (f(c) + f(c + h))/2, text("f(c+h) - f(c)", :left))])
|
||||
|
||||
annotate!(plt, [(c+h/2, f(c), text("h", :top)),
|
||||
(c + h + .05, (f(c) + f(c + h))/2, text("f(c+h) - f(c)", :left))
|
||||
])
|
||||
|
||||
plt
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user