From c4f9acd511a5ad2ba36aa80d5acf816213457638 Mon Sep 17 00:00:00 2001 From: Scott MacLachlan Date: Sun, 1 Oct 2023 16:12:09 -0230 Subject: [PATCH 1/3] Using trig identity for sinc2d --- code/mymath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/mymath.py b/code/mymath.py index 2cf42cf..0915cd2 100644 --- a/code/mymath.py +++ b/code/mymath.py @@ -8,7 +8,7 @@ def sinc2d(x,y): elif y==0: return m.sin(x)/x else: - return (m.sin(x)/x)*(m.sin(y)/y) + return (m.cos(x-y) + m.cos(x+y))/(x*y) def addone(x): return x+1 From 2303febaa68ebab537f58622116074a0f959d626 Mon Sep 17 00:00:00 2001 From: Scott MacLachlan Date: Sun, 1 Oct 2023 16:15:19 -0230 Subject: [PATCH 2/3] Fix sign --- code/mymath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/mymath.py b/code/mymath.py index 0915cd2..a971d8a 100644 --- a/code/mymath.py +++ b/code/mymath.py @@ -8,7 +8,7 @@ def sinc2d(x,y): elif y==0: return m.sin(x)/x else: - return (m.cos(x-y) + m.cos(x+y))/(x*y) + return (m.cos(x-y) - m.cos(x+y))/(x*y) def addone(x): return x+1 From 546af7cfc505d1502be50c372ee6741f2584974b Mon Sep 17 00:00:00 2001 From: Scott MacLachlan Date: Sun, 1 Oct 2023 16:16:35 -0230 Subject: [PATCH 3/3] Fix factor of 2 --- code/mymath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/mymath.py b/code/mymath.py index a971d8a..7e67bec 100644 --- a/code/mymath.py +++ b/code/mymath.py @@ -8,7 +8,7 @@ def sinc2d(x,y): elif y==0: return m.sin(x)/x else: - return (m.cos(x-y) - m.cos(x+y))/(x*y) + return (m.cos(x-y) - m.cos(x+y))/(2*x*y) def addone(x): return x+1