From a3f7ac933bfa6227bf2218650d318b59cd0e85de Mon Sep 17 00:00:00 2001 From: LyceanEM <60020395+LyceanEM@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:44:56 +0100 Subject: [PATCH] Changing cos term to dot product. --- lyceanem/electromagnetics/empropagation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lyceanem/electromagnetics/empropagation.py b/lyceanem/electromagnetics/empropagation.py index 83b9dbe..cbe07b2 100644 --- a/lyceanem/electromagnetics/empropagation.py +++ b/lyceanem/electromagnetics/empropagation.py @@ -775,12 +775,12 @@ def lossy_propagation(point1,point2,alpha,beta): normal[0] = point1["nx"] normal[1] = point1["ny"] normal[2] = point1["nz"] - angle=cmath.acos(clip(dot_vec(outgoing_dir,normal),-1.0,1.0)) + projection_dot=dot_vec(outgoing_dir,normal) front=-(1/(2*cmath.pi)) G=(cmath.exp(-(alpha+1j*beta)*length))/length #dG=cmath.cos(angle)*(-(alpha+1j*beta)-(1/lengths))*G dG=(-(alpha+1j*beta)-(1/length))*G - loss=front*dG*cmath.cos(angle) + loss=front*dG*projection_dot #loss = G #test replacement with old loss funciton