Skip to content

Commit

Permalink
projection matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
AronT-TLV committed Sep 21, 2024
1 parent 75f4520 commit 0aecae9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/linear_algebra_transform.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Symbolics
include("./linear_algebra_basic.jl")

"""
function projection_matrix_symbolic() -> Matrix
Create matrix for projection on [u, v] using E₁ = [1,0] and E₂ =[0,1]
"""
function projection_matrix_symbolic()
[orthproj([u, v], [1, 0])[1] orthproj([u, v], [1, 0])[2]; orthproj([u, v], [0, 1])[1] orthproj([u, v], [0, 1])[2]]
end

function projection_matrix(x::Vector)
Symbolics.value.(substitute.(projection_matrix_symbolic(), (Dict(u =>x[1], v=> x[2]), )))
end

0 comments on commit 0aecae9

Please sign in to comment.