FUNCTION
CDF
Evaluates the Angle distribution CDF.
You're viewing an older version of this page (#289). View the current version.
Interface
#include <codecogs/statistics/distributions/continuous/angle/cdf.h>
using namespace Statistics::Distributions::Continuous::Angle;
This component evaluates the CDF of the Angle distribution with given arguments. x is an angle between 0 and , corresponding to the angle made in an n dimensional space, between a fixed line passing through the origin, and an arbitrary line that also passes through the origin, which is specified by choosing any point on the n dimensional sphere with uniform probability.
The Angle CDF is defined by the following formula
and
for all
The following figure illustrates the typical shape of the Angle distribution for a range of n: \graph x=0:3.5 n=2:6:5
Example 1
In the given example, the CDF is evaluated using a fixed value for n, equal to 4, while the first argument x takes values from 0 up to 2 with a step equal to 0.2. The maximum number of precision digits, implicitly set to 17, may be changed through the <em> PRECISION </em> define.
#include <codecogs/stats/dists/continuous/angle/cdf.h>
#include <iostream>
#include <iomanip>
#define PRECISION 17
int main()
{
std::cout << "The values of the Angle CDF with n = 4 and";
std::cout << std::endl;
std::cout << "x = {0, 0.2, 0.4, ..., 1.8, 2} are" << std::endl;
std::cout << std::endl;
for (double x = 0; x < 2.1; x += 0.2)
{
std::cout << std::setprecision(2);
std::cout << "x = " << std::setw(3) << x << " : ";
std::cout << std::setprecision(PRECISION);
std::cout << Stats::Dists::Continuous::Angle::CDF(x, 4);
std::cout << std::endl;
}
return 0;
}Output
The values of the Angle CDF with n = 4 and
x = {0, 0.2, 0.4, ..., 1.8, 2} are
x = 0 : 0
x = 0.2 : 0.001684123127684655
x = 0.4 : 0.013153186649778228
x = 0.6 : 0.042647304023738355
x = 0.8 : 0.095560829038801032
x = 1 : 0.1735907059637424
x = 1.2 : 0.27446855935925973
x = 1.4 : 0.39231882068278456
x = 1.6 : 0.51858635136931963
x = 1.8 : 0.64338711110041569
x = 2 : 0.75706863044011896Parameters
Returns
References
John Burkardt's library of statistical C++ routines, http://www.csit.fsu.edu/~burkardt/cpp_src/prob/prob.html
Interactive Calculator
Computing…
Set a range above first to export a graph.