From cdabada2e4b935367a152b29cbd1f4e9c4a9295c Mon Sep 17 00:00:00 2001 From: routersys Date: Tue, 6 Oct 2026 09:32:43 +0900 Subject: [PATCH] =?UTF-8?q?=E7=9E=B3=E3=81=AE=E4=BD=8D=E7=9B=B8=E3=81=A8?= =?UTF-8?q?=E5=9B=9E=E8=BB=A2=E5=9B=A0=E5=AD=90=E3=82=92Sin=E3=81=A8Cos?= =?UTF-8?q?=E3=81=A7=E6=B1=82=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・光学系や収差を変えたフレームの点像分布関数の計算を高速化-M --- SpectralConvolution/SpectralConvolution/KernelSpectrum.cs | 4 ++-- WaveOptics/Optics/FraunhoferPsfGenerator.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SpectralConvolution/SpectralConvolution/KernelSpectrum.cs b/SpectralConvolution/SpectralConvolution/KernelSpectrum.cs index 9b44fec..a929a19 100644 --- a/SpectralConvolution/SpectralConvolution/KernelSpectrum.cs +++ b/SpectralConvolution/SpectralConvolution/KernelSpectrum.cs @@ -67,8 +67,8 @@ internal sealed class KernelSpectrum for (var index = 0; index < size / 2; index++) { - var (sin, cos) = Math.SinCos(-2d * Math.PI * index / size); - twiddles[index] = new Float2(Flush((float)cos), Flush((float)sin)); + var angle = -2d * Math.PI * index / size; + twiddles[index] = new Float2(Flush((float)Math.Cos(angle)), Flush((float)Math.Sin(angle))); } var mask = size - 1; diff --git a/WaveOptics/Optics/FraunhoferPsfGenerator.cs b/WaveOptics/Optics/FraunhoferPsfGenerator.cs index d3b3d0e..689a143 100644 --- a/WaveOptics/Optics/FraunhoferPsfGenerator.cs +++ b/WaveOptics/Optics/FraunhoferPsfGenerator.cs @@ -93,9 +93,9 @@ public sealed class FraunhoferPsfGenerator : IPsfGenerator if (IsInsideAperture(normalizedX, normalizedY, in specification, rotation)) { var waves = ZernikeWavefront.Evaluate(normalizedX, normalizedY, specification.Aberration); - var (sin, cos) = Math.SinCos(TwoPi * waves); - real[index] = cos; - imaginary[index] = sin; + var angle = TwoPi * waves; + real[index] = Math.Cos(angle); + imaginary[index] = Math.Sin(angle); openSampleCount++; } else