diff options
| author | Fuwn <[email protected]> | 2022-05-30 01:46:07 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-05-30 01:46:07 -0700 |
| commit | baea1377d043f2f408c74d35c6f4715cfe47973b (patch) | |
| tree | 903c54f685fef94e142ef5656da24785559afe08 | |
| parent | fix(ellipse): move variable declrations (diff) | |
| download | ellipse-baea1377d043f2f408c74d35c6f4715cfe47973b.tar.xz ellipse-baea1377d043f2f408c74d35c6f4715cfe47973b.zip | |
docs(ellipse.cc): add links to math resources
| -rw-r--r-- | ellipse/ellipse.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ellipse/ellipse.cc b/ellipse/ellipse.cc index 514b262..bd4f773 100644 --- a/ellipse/ellipse.cc +++ b/ellipse/ellipse.cc @@ -75,6 +75,9 @@ void ellipse::calculate() { // involved, but it was just too boring... and probably out of the scope of // this project anyway. + // The ellipse perimeter calculations are interpretations of Srinivasa + // Ramanujan's (1887-1920) work on ellipse perimeter approximations. + // You probably shouldn't try this on an ill-equipped computer... // { // double limit = std::numeric_limits<double>::infinity(); @@ -95,6 +98,9 @@ void ellipse::calculate() { // double infinite_sum = 0; // double h = std::pow(this->major - this->minor, 2) / // std::pow(this->major + this->minor, 2); + // // An optimized binomial coefficient calculation without recursion: + // // + // https://www.geeksforgeeks.org/space-and-time-efficient-binomial-coefficient/ // std::function<double(double, double)> binomial_coefficient = // [](double n, double k) -> double { // double r = 1; |