summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-05-30 01:46:07 -0700
committerFuwn <[email protected]>2022-05-30 01:46:07 -0700
commitbaea1377d043f2f408c74d35c6f4715cfe47973b (patch)
tree903c54f685fef94e142ef5656da24785559afe08
parentfix(ellipse): move variable declrations (diff)
downloadellipse-baea1377d043f2f408c74d35c6f4715cfe47973b.tar.xz
ellipse-baea1377d043f2f408c74d35c6f4715cfe47973b.zip
docs(ellipse.cc): add links to math resources
-rw-r--r--ellipse/ellipse.cc6
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;