Skip to content

Instantly share code, notes, and snippets.

@siddMahen
Created July 31, 2019 14:24
Show Gist options
  • Save siddMahen/76d1a01ed64f5b0e299d6630793c69b2 to your computer and use it in GitHub Desktop.
Save siddMahen/76d1a01ed64f5b0e299d6630793c69b2 to your computer and use it in GitHub Desktop.
m = 1
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))
for j = 1:n
println(a(j))
println(b(j))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment