Skip to content

Commit

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

@variables u v
"""
function projection_matrix_symbolic() -> Matrix
Create matrix for projection on [u, v] using E₁ = [1,0] and E₂ =[0,1]
Create symbolic matrix for projection on [u, v] using E₁ = [1,0] and E₂ =[0,1] to get first and second row
"""
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]]
[orthproj([u, v], [1, 0])[1] orthproj([u, v], [0, 1])[1]; orthproj([u, v], [1, 0])[2] orthproj([u, v], [0, 1])[2]]
end

function projection_matrix_symbolic_polar()
simplify.(substitute.(projection_matrix_symbolic(),(Dict(u => cos(θ), v => sin(θ)),)))
end
"""
function projection_matrix(x::Vector) -> Matrix
value of Matrix with an actual x
"""
function projection_matrix(x::Vector)
Symbolics.value.(substitute.(projection_matrix_symbolic(), (Dict(u =>x[1], v=> x[2]), )))
end

0 comments on commit b7d0d15

Please sign in to comment.