changeset 26200:33e6ab3e1491

mkpp.m: Document how ppval will calculate values for each piecewise section (patch #9095). * mkpp.m: Add Programming Note to documentation explaining how the lower bound of the piecewise segment will be subtracted from the value of the polynomial calculated for that segment.
author Rik <rik@octave.org>
date Mon, 10 Dec 2018 21:41:39 -0800
parents 704cd93ca748
children 750a6f9957ea
files scripts/polynomial/mkpp.m
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/polynomial/mkpp.m	Mon Dec 10 17:23:17 2018 -0800
+++ b/scripts/polynomial/mkpp.m	Mon Dec 10 21:41:39 2018 -0800
@@ -42,6 +42,10 @@
 ## @var{r}-th polynomial defined on interval @var{i}.  In any case @var{coefs}
 ## is reshaped to a 2-D matrix of size @code{[@var{ni}*prod(@var{d}) @var{m}]}.
 ##
+## Programming Note: @code{ppval} evaluates polynomials at
+## @code{@var{xi} - @var{breaks}(i)}, i.e., it subtracts the lower endpoint of
+## the current interval from @var{xi}.  This must be taken into account when
+## creating piecewise polynomials objects with @code{mkpp}.
 ## @seealso{unmkpp, ppval, spline, pchip, ppder, ppint, ppjumps}
 ## @end deftypefn