Skip to content

Instantly share code, notes, and snippets.

@siddMahen
Created July 31, 2019 17:11
Show Gist options
  • Select an option

  • Save siddMahen/5084fda45ae101ae19c5ea12ea45ab6a to your computer and use it in GitHub Desktop.

Select an option

Save siddMahen/5084fda45ae101ae19c5ea12ea45ab6a to your computer and use it in GitHub Desktop.

Revisions

  1. siddMahen created this gist Jul 31, 2019.
    20 changes: 20 additions & 0 deletions david.jl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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