# File lib/numru/nusdas.rb, line 1897
    def gausslat(n)
      # this method was written by Y.Kitamura
      # and modified by S.Nishizawa

      @@gausslat ||= Hash.new

      return @@gausslat[n] if @@gausslat[n]

      glat    = NArray.sfloat(n)
#      gweight = NArray.sfloat(n)

      eps = Float::EPSILON*8

      0.upto(n/2-1) do |i|
        y = Math::sin(Math::PI*(n+1-2*(i+1))/(2*n+1))
        tmp = 1.0
        while ((tmp/y).abs > eps)
          p0 = 0.0
          p1 = 1.0
          1.step(n-1, 2) do |j|
            p0 = ((2*j-1)*y*p1 - (j-1)*p0)/j
            p1 = ((2*j+1)*y*p0 - j*p1)/(j+1)
          end
          p2 = n*(p0 - y*p1)/(1.0 - y*y)
          tmp = p1/p2
          y = y - tmp
        end
        glat[i]      =  y
        glat[n-i-1] = -y
#        gweight[i]      = 1.0/(p2*p2*(1.0 - glat[i]*glat[i]))
#        gweight[n-i-1] = gweight[i]
      end

      glat =  NMath::asin(glat)*180/Math::PI

      @@gausslat[n] = glat

      return glat
    end