summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-05-12 10:33:14 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-07-07 15:24:33 +0200
commitd3280eb3b47472ab3fc6946d475a7b9c6c55c381 (patch)
tree8d4034e22ba2853ef63ebe68642709fd3a403296 /chart2
parentUpdate git submodules (diff)
downloadcore-d3280eb3b47472ab3fc6946d475a7b9c6c55c381.tar.gz
core-d3280eb3b47472ab3fc6946d475a7b9c6c55c381.zip
tdf#110993 - Corrected spline calculation
The algorithm in Numerical Recipies in C, 2nd edition in Section 3.3, page 166 states a division rather than a multiplication. Change-Id: I2530c506bc48726539e3de99016892e50d6bb87e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115465 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> (cherry picked from commit e6442b39836f9856aa7b87d1a840158f0cb7d9c4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117974 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/Splines.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx
index 774d5fc1d7ac..338179b2827c 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -198,7 +198,7 @@ void lcl_SplineCalculation::Calculate()
( m_fYpN - ( m_aPoints[ n ].second - m_aPoints[ n - 1 ].second ) / xDiff );
}
- m_aSecDerivY[ n ] = ( un - qn * u[ n - 1 ] ) * ( qn * m_aSecDerivY[ n - 1 ] + 1.0 );
+ m_aSecDerivY[ n ] = ( un - qn * u[ n - 1 ] ) / ( qn * m_aSecDerivY[ n - 1 ] + 1.0 );
// note: the algorithm in [1] iterates from n-1 to 0, but as size_type
// may be (usually is) an unsigned type, we can not write k >= 0, as this