math.pow → ^

This commit is contained in:
Starbeamrainbowlabs 2022-09-18 16:30:27 +01:00
parent 52d24a63f3
commit 4a6cb2551c
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -35,7 +35,7 @@ function worldeditadditions.conv.kernel_gaussian(dimension, sigma)
-- http://en.wikipedia.org/w/index.php?title=Gaussian_blur&oldid=608793634#Mechanics -- http://en.wikipedia.org/w/index.php?title=Gaussian_blur&oldid=608793634#Mechanics
local gaussian = (1 / math.sqrt( local gaussian = (1 / math.sqrt(
math.pi * two_sigma_square math.pi * two_sigma_square
)) * math.exp((-1) * (math.pow(distance, 2) / two_sigma_square)); )) * math.exp((-1) * ((distance ^ 2) / two_sigma_square));
sum = sum + gaussian sum = sum + gaussian
kernel[i*dimension + j] = gaussian kernel[i*dimension + j] = gaussian