From 1cb6f611ba35d5f5e769544a3e62a1e5d3c46e22 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Tue, 9 Jun 2020 15:09:04 +0200 Subject: [PATCH 1/5] Added plot of equation Fixes #30 --- CHANGELOG.md | 3 ++- README.md | 3 +++ images/equation.svg | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 images/equation.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dacae0..5ca98e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -* C++ in SonarCloud analysis ([#73](https://github.com/NLESC-JCER/cpp2wasm/issues/73)) +* C++ in SonarCloud analysis ([#73](https://github.com/NLESC-JCER/cpp2wasm/issues/73)) +* Plot of equation ([#30](https://github.com/NLESC-JCER/cpp2wasm/issues/30)) ## [0.2.0] - 2020-06-09 diff --git a/README.md b/README.md index 81b2bcc..0ec40be 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ The code we are using came from [geeksforgeeks.org](https://www.geeksforgeeks.or Let's first define the mathematical equation, which we will be searching for its root, and the derivative of it. The equation and its derivative which we will use in this guide are $x^3 - x^2 + 2$ and $3x^2 - 2x$ respectively. +The root is the X-coordinate you must put in the equation to get `0` as Y-coordinate. In this equation the root is `-1`. + +[![Plotted equation](images/equation.svg)](https://www.desmos.com/calculator/yj0ih4ml0i) ```{.hpp file=src/algebra.hpp} // this C++ code snippet is store as src/algebra.hpp diff --git a/images/equation.svg b/images/equation.svg new file mode 100644 index 0000000..f719e9f --- /dev/null +++ b/images/equation.svg @@ -0,0 +1 @@ +Y axisX axis00-4-4-2-22244-2-222Expression 1 \ No newline at end of file From dfdf8373149cc99a2f3abde1178aaaf82e91a29c Mon Sep 17 00:00:00 2001 From: Faruk D Date: Tue, 9 Jun 2020 16:30:23 +0200 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca98e7..c28a0a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * C++ in SonarCloud analysis ([#73](https://github.com/NLESC-JCER/cpp2wasm/issues/73)) * Plot of equation ([#30](https://github.com/NLESC-JCER/cpp2wasm/issues/30)) +### Fixed + +- Use fabs instead of abs to fix tolerance issue ([#79](https://github.com/NLESC-JCER/cpp2wasm/pull/79)) +- Precision of the result ([#79](https://github.com/NLESC-JCER/cpp2wasm/pull/79)) ## [0.2.0] - 2020-06-09 ### Added From 684c253b40b69a247d57ddf3f51bd3bea8199d0a Mon Sep 17 00:00:00 2001 From: Faruk D Date: Tue, 9 Jun 2020 16:30:49 +0200 Subject: [PATCH 3/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c28a0a5..c640ee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use fabs instead of abs to fix tolerance issue ([#79](https://github.com/NLESC-JCER/cpp2wasm/pull/79)) - Precision of the result ([#79](https://github.com/NLESC-JCER/cpp2wasm/pull/79)) + ## [0.2.0] - 2020-06-09 ### Added From 5ed6fed2c1a103aee1f1c6944c28fab28fe7dfdb Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Tue, 9 Jun 2020 16:35:51 +0200 Subject: [PATCH 4/5] Update README.md Co-authored-by: Faruk D. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ec40be..1c1c284 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Let's first define the mathematical equation, which we will be searching for its The equation and its derivative which we will use in this guide are $x^3 - x^2 + 2$ and $3x^2 - 2x$ respectively. The root is the X-coordinate you must put in the equation to get `0` as Y-coordinate. In this equation the root is `-1`. -[![Plotted equation](images/equation.svg)](https://www.desmos.com/calculator/yj0ih4ml0i) +[![Plotted equation](images/equation.svg)](https://www.wolframalpha.com/input/?i=x%5E3+-+x%5E2+%2B+2) ```{.hpp file=src/algebra.hpp} // this C++ code snippet is store as src/algebra.hpp From eee0b1ce0aabf808721af893bdd446bbdc2b1a92 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Tue, 9 Jun 2020 16:41:34 +0200 Subject: [PATCH 5/5] Update README.md Co-authored-by: Faruk D. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c1c284..33a3985 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The code we are using came from [geeksforgeeks.org](https://www.geeksforgeeks.or Let's first define the mathematical equation, which we will be searching for its root, and the derivative of it. The equation and its derivative which we will use in this guide are $x^3 - x^2 + 2$ and $3x^2 - 2x$ respectively. -The root is the X-coordinate you must put in the equation to get `0` as Y-coordinate. In this equation the root is `-1`. +The root is the value (X-coordinate) which makes the mathematical function (Y-coordinate) equal to `0`. In this equation the root is `-1`. [![Plotted equation](images/equation.svg)](https://www.wolframalpha.com/input/?i=x%5E3+-+x%5E2+%2B+2)