private float GetSpectrumSample(float i, float j, float dk, float kMin, float amp, ISpectrum spectrum) { if (spectrum == null) { return(0f); } float num = i * dk; float num2 = j * dk; float num3 = 0f; if (Math.Abs(num) >= kMin || Math.Abs(num2) >= kMin) { float num4 = spectrum.Spectrum(num, num2) * amp; num3 = Mathf.Sqrt(num4 * 0.5f) * dk; if (float.IsNaN(num3) || float.IsInfinity(num3)) { num3 = 0f; } } return(num3); }
float GetSpectrumSample(float i, float j, float dk, float kMin, float amp, ISpectrum spectrum) { if (spectrum == null) { return(0.0f); } float kx = i * dk; float ky = j * dk; float h = 0.0f; if (Math.Abs(kx) >= kMin || Math.Abs(ky) >= kMin) { float S = spectrum.Spectrum(kx, ky) * amp; h = Mathf.Sqrt(S * 0.5f) * dk; if (float.IsNaN(h) || float.IsInfinity(h)) { h = 0.0f; } } return(h); }
private float GetSpectrumSample(float i, float j, float dk, float kMin, float amp, ISpectrum spectrum) { if (spectrum == null) { return 0f; } float num = i * dk; float num2 = j * dk; float num3 = 0f; if (Math.Abs(num) >= kMin || Math.Abs(num2) >= kMin) { float num4 = spectrum.Spectrum(num, num2) * amp; num3 = Mathf.Sqrt(num4 * 0.5f) * dk; if (float.IsNaN(num3) || float.IsInfinity(num3)) { num3 = 0f; } } return num3; }
float GetSpectrumSample(float i, float j, float dk, float kMin, float amp, ISpectrum spectrum) { if (spectrum == null) return 0.0f; float kx = i * dk; float ky = j * dk; float h = 0.0f; if (Math.Abs(kx) >= kMin || Math.Abs(ky) >= kMin) { float S = spectrum.Spectrum(kx, ky) * amp; h = Mathf.Sqrt(S * 0.5f) * dk; if (float.IsNaN(h) || float.IsInfinity(h)) h = 0.0f; } return h; }