From 0a4bb2381bc8e63dcdb8229f6be7b10dca51bfba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lisa=20Sch=C3=A4tzle?= <lisa.schaetzle@kit.edu>
Date: Thu, 11 Jan 2024 09:31:55 +0000
Subject: [PATCH] Update translOp.m

---
 src/translOp.m | 41 +++++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/src/translOp.m b/src/translOp.m
index e61fc1c..4fe3fad 100644
--- a/src/translOp.m
+++ b/src/translOp.m
@@ -1,18 +1,23 @@
-function [Tc1c2F] = translOp(F, sampling, c1, c2, kappa)
-% Applies generalized far field translation operator on F
-%   INPUT: c1 - shift vector for row space, 2x1 array.
-%          c2 - shift vector for column space, 2x1 array.
-%          kappa - wave number.
-%          F - farfield matrix.
-%          sampling - structure that contains information about the
-%                     discretization.
-%   OUTPUT Tc1c2F - translated far field matrix.
-
-xhat = sampling.xhat;
-d = sampling.d.';
-
-Tc1 = diag(exp(1i*kappa*[cos(xhat), sin(xhat)]*c1));
-Tc2 = diag(exp(1i*kappa*[cos(d), sin(d)]*c2));
-Tc1c2F = Tc1*F*Tc2';
-
-end
\ No newline at end of file
+function [Tc1c2F] = translOp(F, sampling, c1, c2, kappa)
+%% TRANSLOP: Applies generalized translation operator to a far field matrix F.
+%
+% INPUT:    F           Far field matrix, nxhat*nd-array.
+%           sampling    Structure containing information about the discretization.    
+%           c1          Determines translation in row direction, vector of length 2.
+%           c2          Determines translation in column direction, vector of length 2.
+%           kappa       Wave number, >0.
+%
+% OUTPUT:   Tc1c2F  Translated far field matrix, nxhat*nd-array.  
+%
+% SYNTAX:   translOp(F, sampling, c1, c2, kappa)
+%
+% **************************************************************************************
+
+xhat = sampling.xhat;
+d = sampling.d.';
+
+Tc1 = diag(exp(1i*kappa*[cos(xhat), sin(xhat)]*c1));
+Tc2 = diag(exp(1i*kappa*[cos(d), sin(d)]*c2));
+Tc1c2F = Tc1*F*Tc2';
+
+end
-- 
GitLab