first commit with current lessons

This commit is contained in:
elvis
2023-10-29 02:06:02 +01:00
parent ececf6cfcb
commit b3fc9cb021
204 changed files with 31603 additions and 0 deletions

11
10-04/plotQ.jl Normal file
View File

@ -0,0 +1,11 @@
using LinearAlgebra
using Plots
function plotQ(Q::Matrix, q::Vector, xyrange::Tuple{Tuple{Number, Number}, Tuple{Number, Number}})::Plots.Plot
f(x, y) = dot((1/2) * hcat(x, y) * Q, vcat(x, y)) + dot(q', vcat(x, y))
xrange = LinRange(xyrange[1][1], xyrange[2][1], 200)
yrange = LinRange(xyrange[1][2], xyrange[2][2], 200)
z = @. f(xrange', yrange)
plt = contour(xrange, yrange, z)
plt
end