using System namespace Lab public static class ArrFix public static fl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
using System;
namespace Lab
{
public static class ArrFix
{
public static float[] AntiAlising(float[] arr)
{
int N = arr.Length - 1;
arr[0] = (arr[0] + arr[1]) / 2;
arr[N] = (arr[N] + arr[N - 1]) / 2;
for (int i = 1; i < N; i++)
arr[i] = (arr[i - 1] + 2 * arr[i] + arr[i + 1]) / 4;
return arr;
}
}
}