riveSunder / yuca

Your Universal Cellular Automata
MIT License
12 stars 0 forks source link

Add stencil variants of USkate World config #86

Open riveSunder opened 1 year ago

riveSunder commented 1 year ago

Add 5-point, 9-point, and 25-point stencil variants of USkate world

# 5-point stencil
[[0, 1, 0], \
[1, -4, 1], \
[0, 1, 0]]

# 9-point stencil
[[1, 2, 1], \
[2, -12, 2], \
[1, 2, 1]]

# 25-point stencial
[[0, -1, -1, -1, 0], \
[-1, 2, 10, 2, -1], \
[-1, 10, -36, 10, -1], \
[-1, 2, 10, 2,- 1], \
[0, -1, -1, -1, 0]]

Also, it turns out that the Laplacian of Gaussian version of U-Skate is also missing (never added to git tracking). Please add the LoG U-Skate config as well.

# LoG approximates ∇² by convolving an image with LoG kernel, the Laplacian of the Gaussian. 
# this approach allows kernels to be scaled.

laplacian_of_gaussian = 1 / (pi * sigma**4) * (1 - (r**2 / (2*sigma**2)) * exp(- (r**2 / (2*sigma**2))