Functions to compute a circular kernel.

smooth_uniform_circle_kernel(r)

hard_uniform_circle_kernel(r)

Arguments

r

[numeric] Circle radius.

Value

A matrix corresponding to the kernel.

Examples


smooth_uniform_circle_kernel(r = 3)
#>             [,1]        [,2]      [,3]      [,4]      [,5]        [,6]
#> [1,] 0.000000000 0.007942803 0.3117253 0.4860527 0.3117253 0.007942803
#> [2,] 0.007942803 0.693194567 1.0000000 1.0000000 1.0000000 0.693194567
#> [3,] 0.311725319 1.000000000 1.0000000 1.0000000 1.0000000 1.000000000
#> [4,] 0.486052659 1.000000000 1.0000000 1.0000000 1.0000000 1.000000000
#> [5,] 0.311725319 1.000000000 1.0000000 1.0000000 1.0000000 1.000000000
#> [6,] 0.007942803 0.693194567 1.0000000 1.0000000 1.0000000 0.693194567
#> [7,] 0.000000000 0.007942803 0.3117253 0.4860527 0.3117253 0.007942803
#>             [,7]
#> [1,] 0.000000000
#> [2,] 0.007942803
#> [3,] 0.311725319
#> [4,] 0.486052659
#> [5,] 0.311725319
#> [6,] 0.007942803
#> [7,] 0.000000000
hard_uniform_circle_kernel(r = 3)
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,]    0    0    0    1    0    0    0
#> [2,]    0    1    1    1    1    1    0
#> [3,]    0    1    1    1    1    1    0
#> [4,]    1    1    1    1    1    1    1
#> [5,]    0    1    1    1    1    1    0
#> [6,]    0    1    1    1    1    1    0
#> [7,]    0    0    0    1    0    0    0