circle_rule


circle_rule, a Fortran77 code which computes quadrature rules for the unit circle in 2D, to approximate integrals of f(x,y) over the circumference of the circle of radius 1 and center (0,0).

The user specifies the value NT, the number of equally spaced angles. The program returns vectors T(1:NT) and W(1:NT), which define the rule Q(f).

Given NT and the vectors T and W, the integral I(f) of a function f(x,y) is estimated by Q(f) as follows:

        q = 0.0
        for i = 1, nt
          x = cos ( t(i) )
          y = sin ( t(i) )
          q = q + w(j) * f ( x, y )
        end
      

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

circle_rule is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

circle_rule_test

f77_rule, a Fortran77 code which computes a quadrature rule which estimates the integral of a function f(x), which might be defined over a one dimensional region (a line) or more complex shapes such as a circle, a triangle, a quadrilateral, a polygon, or a higher dimensional region, and which might include an associated weight function w(x).

Reference:

  1. Philip Davis, Philip Rabinowitz,
    Methods of Numerical Integration,
    Second Edition,
    Dover, 2007,
    ISBN: 0486453391,
    LC: QA299.3.D28.

Source Code:


Last revised on 23 September 2023.