Skip to content

Instantly share code, notes, and snippets.

@siddMahen
Created July 31, 2019 17:13
Show Gist options
  • Save siddMahen/f058f6a9064c315c179bdd157e5efc3f to your computer and use it in GitHub Desktop.
Save siddMahen/f058f6a9064c315c179bdd157e5efc3f to your computer and use it in GitHub Desktop.
m = 2
n = 4*m + 1
a(j) = (1/n)*(1 + sin((2*π*j*m + π*j)/n)/sin((π*j)/n))
function b(j)
s = 2
for k = 1:m
s += 2*cos((2*π*k*j)/n)
end
return s/n
end
# println(a(1) - a(2) + a(3) - a(4) + a(5))
# println(b(1) - b(2) + b(3) - b(4) + b(5))
a = 0
b = 0
for j = 1:n
a += (-1)^(j + 1)*a(j)
b += (-1)^(j + 1)*b(j)
println(a)
println(b)
end
println(a)
println(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment