From b7d0d1545d6687b929504baf81e62d0d67fbd0b2 Mon Sep 17 00:00:00 2001 From: Aron T Date: Sat, 21 Sep 2024 13:40:11 +0300 Subject: [PATCH] projextion matrix symbolic polar --- src/linear_algebra_transform.jl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/linear_algebra_transform.jl b/src/linear_algebra_transform.jl index b8abdfb..6ee1fc0 100644 --- a/src/linear_algebra_transform.jl +++ b/src/linear_algebra_transform.jl @@ -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 -