circle_rule, a C++ 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
The information on this web page is distributed under the MIT license.
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.
circle_arc_grid, a C++ code which computes points equally spaced along a circular arc;
circle_integrals, a C++ code which returns the exact value of the integral of any monomial over the circumference of the unit circle in 2D.
circle_monte_carlo, a C++ code which applies a Monte Carlo method to estimate the integral of a function on the circumference of the unit circle in 2D;
cpp_rule, a C++ 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).